Service Monitoring with Special Characters

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Service Monitoring with Special Characters

Post 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>
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Service Monitoring with Special Characters

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Monitoring with Special Characters

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