<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
On 31/01/2012 11:13 PM, Robert Jackson wrote:
<blockquote
cite="mid:D1D5923DB08E1C4BAEA198E9104E88A00482997D@wm-exchange1.WMNET.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Times New Roman","serif";
color:windowtext;
font-weight:normal;
font-style:normal;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Times New Roman","serif";
color:#4F81BD;
font-weight:normal;
font-style:normal;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Times New Roman","serif";
color:#4F81BD;
font-weight:normal;
font-style:normal;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Times New Roman","serif";
color:#4F81BD;
font-weight:normal;
font-style:normal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD">Hi Matthew,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD">Many thanks for
the reply. I’m really sorry for all the hassle. I really
like check_wmi_plus.pl and it’s a bit of a learning curve
for me at the moment. I hope you can bear with me?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD">Is there a
switch on the command that allows multiple runs or how do I
run the command twice with Centreon/Nagios?<o:p></o:p></span></p>
</div>
</blockquote>
I don't think you really want to do that.<br>
check_wmi_plus calculates using counters because that way it gets
really accurate results. To do this however it needs 2 WMI samples
so that is can difference the counters and give you a result. To get
2 WMI samples you could do this the old way it used to do it which
was take a sample, wait a bit, take another sample, calculate
results from those 2 samples.<br>
The newer way is take a sample, calculate results from the sample
just taken and the sample taken the last time it ran. If there was
no last time you ran or the sample is older than KEXPIRY (set on the
command line by --keepexpiry KEXPIRY and defaulted to 3600 seconds)
then check_wmi_plus can't calculate any results so it just collects
a sample and then waits till the next time it is run.<br>
The newer way means less WMI calls, less chance of a timeout and
also means that the calculations include counter activity when
check_wmi_plus is not even running.<br>
<br>
If you really want to run the old way then you have to <br>
use the --nokeepstate and -y DELAY parameters<br>
<br>
<blockquote
cite="mid:D1D5923DB08E1C4BAEA198E9104E88A00482997D@wm-exchange1.WMNET.local"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD">The complete
error from Nagios is:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal">UNKNOWN - The WMI query had problems. You
might have your username/password wrong or the user's access
level is too low. Wmic error text on the next line.<br>
[librpc/rpc/dcerpc_util.c:1290:dcerpc_pipe_auth_recv()] Failed
to bind to uuid 4d9f4ab8-7d1c-11cf-861e-0020af6e7c57 -
NT_STATUS_NET_WRITE_FAULT<br>
[librpc/rpc/dcerpc_connect.c:790:dcerpc_pipe_connect_b_recv()]
failed NT status (c0000022) in dcerpc_pipe_connect_b_recv<br>
[wmi/wmic.c:196:main()] ERROR: Login to remote object.<br>
NTSTATUS: NT_STATUS_ACCESS_DENIED - Access denied<span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD">Obviously this
indicates username/password or access rights issues. However
the username/password combination I have combined with
access rights (member of the local Administrators group)
works as is proven by the plugin script test in Centreon:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<table class="MsoNormalTable"
style="width:100.0%;border-collapse:collapse;border:none"
border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#F7FAFF;padding:1.5pt
0cm 1.5pt 30.0pt" valign="top">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">Command
Line<o:p></o:p></span></p>
</td>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#F7FAFF;padding:1.5pt
0cm 1.5pt 3.75pt">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">/usr/lib/nagios/plugins/check_wmi_plus.pl
-H wm-tsrv2 -u 'WM-Tsrv2/nagios-wmi' -p 'wmicheck'
-m checkcpu -w '85' -c '95' ' ' ' ' ' '<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#EDF4FF;padding:1.5pt
0cm 1.5pt 30.0pt" valign="top">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">Output<o:p></o:p></span></p>
</td>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#EDF4FF;padding:1.5pt
0cm 1.5pt 3.75pt">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">OK
(Sample Period 899 sec) - Average CPU Utilisation
8.48%|'Avg CPU Utilisation'=8.48%;85;95;<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#F7FAFF;padding:1.5pt
0cm 1.5pt 30.0pt" valign="top">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">Status<o:p></o:p></span></p>
</td>
<td style="border-top:solid #D1DCEB
1.0pt;border-left:solid #D1DCEB
1.0pt;border-bottom:none;border-right:none;background:#F7FAFF;padding:1.5pt
0cm 1.5pt 3.75pt">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial","sans-serif";color:windowtext;mso-fareast-language:EN-GB">OK<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"> <o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Times New
Roman","serif";color:#4F81BD"><o:p> </o:p></span></p>
</div>
</blockquote>
I don't fully understand how Centreon works but that WMI error is
just what is returned from Windows by wmic. So whatever user
Centreon is passing when is runs for real is either not what you
think it is or just does not have the permission level on the
Windows server. You'll need to turn on debugging maybe in Nagios and
maybe in Centreon to see what the full command that it is actually
executing against the Windows host. check_wmi_plus has a debug mode
too. Add -d to the command line. Add -z also if you want to see the
user/password it is using for the WMI calls.<br>
<br>
<div class="moz-signature">-- <br>
<font size="-1"> <a moz-do-not-send="true"
href="http://www.smartmon.com.au">Smartmon System Monitoring</a>
<br>
<a moz-do-not-send="true" href="http://www.smartmon.com.au">www.smartmon.com.au</a>
</font></div>
</body>
</html>