I have 3 machines, all remote IPs and all of them running nsclient++ with remote and local IP addresses:
46.*.*.1/192.168.1.1
46.*.*.2/192.168.1.2
46.*.*.3/192.168.1.3
I want nagios/icinga to remotely ping other local machines to see whether VLAN is working correctly.
Is there a way to tell nagios/icinga to use machine 192.168.1.1 and to ping 192.168.1.2 and 192.168.1.3 ? check_ping is pinging only machine defined in host_name from icinga server. Icinga is on completely different ip range 92.*.*.*
Is there a way to do this to see VLAN workes fine?
Best Answer
As you are using nsclient++, I assume these are Windows hosts, and other remote execution options (e.g., push_check) are not available. However, nsclient++ has its own remote execution built-in. See details here: http://www.nsclient.org/nscp/wiki/CheckExternalScripts, for example, in the nsclient++ configuration, include
and a simple batch file scripts\ping.bat under the nsclient++ folder along these lines:
This will exit with code 0 (Nagios "OK") if the host is reachable and code 1 (Nagios "Warning") if not. You could build a more elaborate batch script to do something a bit cleverer with the output.
Nagios's NRPE check can trigger this script. Define a command as follows:
And then fire it from the host configuration for one of your host machines with: