I am using the check_nrpe command in nagiosxi and nsclient++ on the server.
Nagios Command: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_winfile -a '$ARG1$' '$ARG2$' '$ARG3$'
nsc.ini Modifications:
External Scripts
check_winfile=scripts\check_winfile.exe --target $ARG1$ --warn $ARG2$ --critical $ARG3$
arguments and allow nasty characters are enabled
If I run test command from the service I created, it works fine.
If I save service and have Nagios do the checks like normal, I get "File Unknown-Target does not exist".
If I turn on debug mode in the nsc.ini and look at the log. When I run the test command I see these lines:
2013-08-28 13:44:50: debug:NSClient++.cpp
2013-08-28 13:44:50: debug:NSClient++.cpp
2013-08-28 13:44:50: debug:NSClient++.cpp
When Nagios executes the check like normal I get this:
2013-08-28 13:45:01: debug:NSClient++.cpp
2013-08-28 13:45:01: debug:NSClient++.cpp
2013-08-28 13:45:01: debug:NSClient++.cpp
It drops the \\ from the file path. Explaining the file unknown error.
I am able to create a new command for each file needing monitored with success, but I would rather not create a command for each check I need to do. I just hard code the path, warning, and critical data in the command located in the nsc.ini. I want to get around this and have it be configured through the NagiosXI interface.
Any idea what the problem could be?
Thanks for your help!
Caleb