Page 2 of 2

Re: critical: No DHCPOFFERs were received

Posted: Tue Jan 28, 2020 7:53 pm
by Box293
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.

Code: Select all

./check_dhcp -s xxx.xxx.xxx.xxx
OK: Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max lease time = 600 sec.
Does this make sense?

Re: critical: No DHCPOFFERs were received

Posted: Thu Jan 30, 2020 8:28 am
by vinmansbrew
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?

Re: critical: No DHCPOFFERs were received

Posted: Thu Jan 30, 2020 8:28 am
by vinmansbrew
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?

Yeah I am tossing a lot out there, sorry!

Re: critical: No DHCPOFFERs were received

Posted: Thu Jan 30, 2020 5:10 pm
by Box293
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.