Page 1 of 1
Check_DHCP
Posted: Thu Sep 11, 2014 7:15 pm
by mattyra
Hi All,
I am sure this has been asked thousands of times (in fact I know it has because I have read them all) but I am still unable to get this plugin to work.
Our current network has 2 sites that have a WAN link connecting the sites. I have 2 routers in the middle as you would expect. First off the box Nagios is installed on is also the DHCP server for one of the sites which returns "No DHCPOFFERs were received." This exact same message was given for when monitoring the second DHCP server which is on the other site. Because of this I decided to try and setup NRPE to monitor DHCP. I get exactly the same error.
just wondering what I am doing wrong. I have changed the permissions on the check_dhcp file (which is what a lot generally suggest), I have also turned off iptables to test but I am not having any luck.
Thanks,
Re: Check_DHCP
Posted: Fri Sep 12, 2014 10:14 am
by Box293
I think iptables is causing your issue.
In the Nagios host, the following iptables commands are required:
Code: Select all
iptables -I INPUT -i eth0 -p udp --dport 68 -j ACCEPT
service iptables save
When you execute the check_dhcp request, the Nagios host must be on the same physical network segment as the DHCP server.
Code: Select all
./check_dhcp
OK: Received 1 DHCPOFFER(s), max lease time = 600 sec.
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.
Re: Check_DHCP
Posted: Mon Sep 15, 2014 7:43 am
by mattyra
Thanks for the reply. I have tried to run without IPTables but it still doesn't work. I was thinking it could be that the Nagios box is also the DHCP server with a static IP Address so shouldn't receive an Offer. Could this be my issue?
Re: Check_DHCP
Posted: Mon Sep 15, 2014 8:45 am
by Box293
What happens when you run with vebosity?:
Also, do the DHCP server logs show anything?
Re: Check_DHCP
Posted: Mon Sep 15, 2014 8:15 pm
by mattyra
DHCP socket: 3
Hardware address: 00:25:90:e0:2d:86
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 486887484 (0x1D05503C)
DHCDISCOVER ciaddr: 0.0.0.0
DHCDISCOVER yiaddr: 0.0.0.0
DHCDISCOVER siaddr: 0.0.0.0
DHCDISCOVER giaddr: 0.0.0.0
send_dhcp_packet result: 548
No (more) data received (nfound: 0)
Result=ERROR
Total responses seen on the wire: 0
Valid responses for this machine: 0
CRITICAL: No DHCPOFFERs were received.
Re: Check_DHCP
Posted: Mon Sep 15, 2014 8:16 pm
by mattyra
Sorry, forgot to post that the DHCP server logs are not showing anything.
Thanks,
Re: Check_DHCP
Posted: Mon Sep 15, 2014 8:22 pm
by mattyra
I have just tried from another linux install (I built to test this) and it worked.
I am thinking that it has something to do with not being able to run the check_dhcp command from the server the DHCP server is run.
A bit of a bugger but possibly not the end of the world.
Thanks,
Re: Check_DHCP
Posted: Tue Sep 16, 2014 9:29 am
by abrist
mattyra wrote:
I am thinking that it has something to do with not being able to run the check_dhcp command from the server the DHCP server is run.
Possibly. check_dhcp connects to the sever and asks for a lease. There is a chance that the dhcp server was not configured to offer itself a lease.
Re: Check_DHCP
Posted: Wed Sep 17, 2014 12:11 am
by mattyra
Thanks Abrist. That was the conclusion I had come to. Was a little bit of a problem being that I don't have two Linux servers in the office. I have just finished a VM which I moved some conferencing software to which I was able to run the check_DHCP command from. No new hardware and no more costs keeps the bosses happy.
I also altered the check_nrpe command so that I was able to make the check appear as if it was from the server hosting DHCP on the web interface and email notifications. A bit of a long way around the issue but it works extremely well.
I will now have to move onto my next Nagios request. I will hopefully solve it on my own so I don't need to open more tickets but we will see.
Thanks Box293 for all of your help
