Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
The point of the dhcp check is to determine if it can receive DHCP offers. It's common to only have 1 dhcp server in a subnet hence if that server stops then offers stop and the plugin returns a failure.
If you have multiple dhcp servers in the one subnet, then with the default plugin command it will not fail, as it will always be receiving an offer.
If you want to ensure that a specific DHCP server is working, you can target it.
It makes sense, and I thought I was targeting the server. When I manually run the command, I use:
/usr/local/nagios/libexec/check_dhcp -v -s <IP of server> -i <adaptor as name is not eth0> -u
That's where the issue comes in. I do have 2 dhcp servers on the same subnet, but when running the check, I am using the IP of the server I am running the test on.
I have tried disabling dhcpd on both servers at the same time, and the test still passes, when I target 1 server. Only time I have gotten it to fail is when I have disabled the adaptor. I have tried so many things that it's getting jumbled, but I think I even disabled the adaptor on 1 server, while disabling dhcpd on the other and running the test on that server, and it still passed.
We also have a couple windows servers, but those are on different subnets. I don't work with those, but from my understanding from a co-worker, they shouldn't be affecting this test.
It makes sense, and I thought I was targeting the server. When I manually run the command, I use:
/usr/local/nagios/libexec/check_dhcp -v -s <IP of server> -i <adaptor as name is not eth0> -u
That's where the issue comes in. I do have 2 dhcp servers on the same subnet, but when running the check, I am using the IP of the server I am running the test on.
I have tried disabling dhcpd on both servers at the same time, and the test still passes, when I target 1 server. Only time I have gotten it to fail is when I have disabled the adaptor. I have tried so many things that it's getting jumbled, but I think I even disabled the adaptor on 1 server, while disabling dhcpd on the other and running the test on that server, and it still passed.
We also have a couple windows servers, but those are on different subnets. I don't work with those, but from my understanding from a co-worker, they shouldn't be affecting this test.
What other possibilities are there?
Oh, and a different question.
Say I want to run that check_dhcp command from the nagios server, itself; would that work?
So, I am ssh'ed into my nagios server and I type:
check_config -v -s <dhcp server ip> -u
Would that resolve on the dhcp server?
A guy I am working with seems to think it should, but that I need to add a network segment for the nagios server, to the dhcpd.conf file. Which I have tried to do, but the dhcpd service refuses to restart.
Thoughts on that?
You need to do some network traffic sniffing to see what is going on. Disable all DHCP servers on the network and see what happens when you run the dhcp plugin.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.