I have NSClient++ installed on some distributed windows servers that I am using Icinga to monitor. I also have a UPS attached to each server that can execute a custom command before scheduling a shutdown. I would like to create a batch script that calls the NSCA client to notify my central server that the host is running on battery power.
It seems from the nsc.ini that it is only possible for NSCAClient to periodically check a local command/service and submit the results to the central server.
Is it possible to do what I want and if so, how?
Call NSCA from windows batch script (using NSClient++)
icingansclient++
Best Answer
Yes it is.
You can use NSCA and NRPE from command line (if you have a newer version of NSClient++) which means you can submit data at whim. This will work with 0.4.2 and 0.4.3 (and possibly 0.4.1)
For some more options run:
If you want to test this you can use the following config:
And then start nsclient++ (in test mode) and issuing the above command and a file output.txt will be written to for each command you send to NSCA (using the above command).