<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jan<br>
<div class="moz-signature">
<title></title>
<font color="#000000"><br>
</font></div>
<blockquote cite="mid:200905120925.33479.waja@cyconet.org" type="cite">
<pre wrap="">For me "check_nt!'MEMUSE -w 80 -c 90'" and "check_nt!'USEDDISKSPACE -l c -w 90
-c 95'" works without problems.
Actual I don't see any need for changes. Using different ports is an issue,
but I'm not willing to break existing systems with changing it (default port
is 1248).
With kind regards, Jan.
</pre>
</blockquote>
I'm new to Nagios and spent the last few days setting it up and
learning the ins and outs of the system. I did a fresh install of
nagios on my Debian server and a new install of the latest version of
NSClient++ from their website (version 0.3.5.2). From the
conversations that has occurred in this bug report, it appears that the
command_line that ships with this package worked correctly with older
versions of NSClient++. However, in my case, all of the changes I
mentioned were required for NSClient++ to work correctly.<br>
<br>
It seems to me that the default config files should work on a virgin
installation of the package. Of course, advanced admins always have
the right to tweak them to meet specific needs.<br>
<br>
Let me step through each of them with a little more explanation.<br>
<br>
I didn't realize until reading the responses to this bug report that
the default port for NSClient++ has changed. That probably explains
why it must be explicitly stated in the command_line. Not stating it
causes all checks to fail. Making this change to the config file will
cause problems for those who are using older version of NSClient++ and
those who have manually changed their port numbers, but it seems to me
that deference should me paid to working correctly with current
versions.<br>
<br>
Having two arguments ($ARG2$) is required if using the sample
windows.cfg file contained in nagios3-common. For example, it
contains the following section:<br>
<br>
<pre>define service{
        use                        generic-service
        host_name                winserver
        service_description        CPU Load
        check_command                check_nt!CPULOAD!-l 5,80,90
        }
</pre>
<br>
which is split into two arguments. Not listing $ARG2$ causes this
command to fail because -l 5,80,90 is not passed on. This
check_command could be modified to group everything into one argument
and it would probably work that way (I didn't test it, so your mileage
may vary). However, all the documentation on both the Nagios website
and included in the various Debian Nagios packages lists the examples
this way. Including $ARG2$ causes no damage and matches this
documentation, so it seems like an obvious choice.<br>
<br>
The ' marks around the arguments also causes problems for me on some of
the commands. It occurred on all the commands that contained two -.
Specifically:<br>
<br>
<pre>define service{
        use                        generic-service
        host_name                        winserver
        service_description        Memory Usage
        check_command                check_nt!MEMUSE!-w 80 -c 90
        }
</pre>
<pre>define service{
        use                        generic-service
        host_name                        winserver
        service_description        C:\ Drive Space
        check_command                check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }</pre>
<pre>define service{
        use                        generic-service
        host_name                        winserver
        service_description        W3SVC
        check_command                check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
        }</pre>
<pre>define service{
        use                        generic-service
        host_name                        winserver
        service_description        Explorer
        check_command                check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
        }
</pre>
Removing the ' marks from the arguments solved the problem. This may
be another case of the system working correctly with older versions of
NSClient++ but not the current version.<br>
<br>
All of these recommendations follow the documentation found on
nagios.org and contained in the Debian Nagios packages. Specifically,
on <a class="moz-txt-link-freetext" href="http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html">http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html</a> near
the bottom of the page, it recommends the following syntax:<br>
<br>
<pre>define command{
        command_name        check_nt
        command_line        $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$
        }
</pre>
The $USER1$ and -s PASSWORD are optional configurations that should be
made by admins who understand what they are doing, but I felt the other
changes I have recommended are necessary for the system to function
correctly in a virgin installation.<br>
</body>
</html>