None of the Nagios DHCP check plugins can actually take an IP from the DHCP server as a real test. All they do is ask which IP it would give to a certain mac address.
Our DHCP server failed, where Nagios didn't alert, because it could pass the Nagios test, but not actually give the IP to clients.
Question
Is there a way for a script request an IP and have the DHCP server deliver it? The script would run every 5 minutes, so it would throw away the IP at every run.
Update
Ideally what the script should do is
# dhclient -r ; dhclient ; ip a|grep valid_lft
Killed old client process
valid_lft forever preferred_lft forever
valid_lft forever preferred_lft forever
valid_lft 86459sec preferred_lft 86459sec
valid_lft forever preferred_lft forever
and if preferred_lft
isn't renewed, then alert.
The problem which this method is requires a dedicated NIC for for this. So it would be really good, if this could be simulated somehow?