Page 2 of 2

Re: Service Monitoring with Special Characters

Posted: Mon Jul 18, 2016 4:48 pm
by tgriep
The check_nt command also requires a password and the port used in the command line to work. Add those and try again.
-p, --port=INTEGER
Optional port number (default: 12489)
-s, --secret=<password>

Re: Service Monitoring with Special Characters

Posted: Mon Jul 18, 2016 4:50 pm
by Box293
This sounds like a bigger issue. Can you please post your nsc.ini or nsclientl.ini file from the NSClient++ directory on the Windows server.

Re: Service Monitoring with Special Characters

Posted: Mon Jul 18, 2016 4:52 pm
by ssax
In addition to the others,

Because of the dollar signs you will need to wrap it in single quotes:

Code: Select all

/usr/local/nagios/libexec/check_nt -H x.x.x.x -s 'SECRETPASS' -v SERVICESTATE -d SHOWALL -l 'MSSQL$MICROSOFT##WID'
You may also want to look at trying it as a user macro:

Edit /usr/local/nagios/etc/resource.cfg and add this at the bottom:

Code: Select all

$USER9$=MSSQL$MICROSOFT##WID
Then edit the service and change the $ARG2$ to:

Code: Select all

-d SHOWALL -l '$USER9$'
Apply config and test, note that the test check command button won't work with user macros.

Let us know the results.