[Pkg-nagios-devel] Bug#528262: Bug#528262: nagios-plugins-standard: Error in command_line in nt.cfg causes errors

Soren Stoutner sorens at h3solution.com
Tue May 12 15:47:19 UTC 2009


> 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.
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  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.

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.

Let me step through each of them with a little more explanation.

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.

Having two arguments ($ARG2$) is required if using the sample 
windows.cfg file contained in nagios3-common.  For example, it contains  
the following section:

define service{
	use			generic-service
	host_name		winserver
	service_description	CPU Load
	check_command		check_nt!CPULOAD!-l 5,80,90

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.

The ' marks around the arguments also causes problems for me on some of 
the commands.  It occurred on all the commands that contained two -.  

define service{
	use			generic-service
	host_name			winserver
	service_description	Memory Usage
	check_command		check_nt!MEMUSE!-w 80 -c 90

define service{
	use			generic-service
	host_name			winserver
	service_description	C:\ Drive Space
	check_command		check_nt!USEDDISKSPACE!-l c -w 80 -c 90

define service{
	use			generic-service
	host_name			winserver
	service_description	W3SVC
	check_command		check_nt!SERVICESTATE!-d SHOWALL -l W3SVC

define service{
	use			generic-service
	host_name			winserver
	service_description	Explorer
	check_command		check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe

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.

All of these recommendations follow the documentation found on 
nagios.org and contained in the Debian Nagios packages.  Specifically, 
on http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html near 
the bottom of the page, it recommends the following syntax:

define command{
	command_name	check_nt
	command_line	$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20090512/6d77ebe4/attachment.htm>

More information about the Pkg-nagios-devel mailing list