I have installed nagios and configured a lot of what I want to monitor. There is one thing I can’t figure out how to do though. Here is my scenario:
I have two virtual servers. Server A and Server B.
They are configured in a manual failover. They each have their own unique IP address. They also have an IP address that they share. Both servers have a NIC assigned to them with the same MAC address and the same IP address. We simply disable and enable the NIC to failover the services. I want to monitor which server the failover MAC/NIC/IP is enabled on. On both servers eth0 is their own interface. Eth2 is the identical/shared interface. Can you guys give me some tips on how to do this? I am new so can you be as descriptive as possible? Thanks!
I am not sure how you are using nagios, but a simple way would be to run a check on the fail-over boxes IP. I will use the check_nrpe command for this because its quite simple.
Lets say… the script is called check_failover:
BOX 1: /usr/local/nagios/libexec/check_failover
#!/bin/bash
echo "OK: I AM BOX 1"
exit 0
BOX 2: /usr/local/nagios/libexec/check_failover
#!/bin/bash
echo "OK: I AM BOX 2"
exit 0