Page 1 of 1

DHCP Monitoring on Different Subnet or Network

Posted: Tue Jul 21, 2015 10:07 pm
by glenl
Hi Nagios Support,

I would like to consult if there is a way to monitor a DHCP server on different subnet.

We tried monitoring our DHCP server and we reserved a DHCP address to our Nagios server but the result was always 'CRITICAL: No DHCPOFFERs were received.'.

Please take note that the DHCP was on different network with our Nagios server and the Nagios server IP address or network was not included on any of the DHCP scopes on the server.

Here are the procedure that we conducted to monitor our DHCP server.
1. Add the Nagios server on any other scope on the DHCP server.
2. Run the "/usr/local/nagios/libexec/check_dhcp -s <DHCP_SERVER_IP_ADDRESS> -r <IP_ADDRESS_ASSIGNED_TO_NAGIOS> -m <NAGIOS_SERVER_MAC_ADDRESS> -t 7 -u" command.
3. Received a 'CRITICAL: No DHCPOFFERs were received.' result.

One more thing. If monitoring of DHCP server requires a plug-in on the DHCP server, what plug-ins are required and the procedure on setting up DHCP server monitoring?

Your response would be mostly appreciated.

Thank you and have a nice day.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Wed Jul 22, 2015 9:13 am
by jdalrymple
Can you monitor the DHCP server's logs to see if the Nagios DHCP request ever comes in? Also, how are you handling traversing "subnets" (I assume you really mean VLANs since until you get an IP there is no concept of a subnet?) with your DHCP request? Are you using something like Cisco helper IPs?

To eliminate the network confusion, the easiest workaround would be to put a host with network connectivity on the same VLAN as the DHCP server and execute the check using NRPE. That is a simple process, the only prerequisite being that server existing on the remote VLAN.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Wed Jul 22, 2015 11:16 am
by eloyd
As @jdalrymple wrote, "subnets" don't exist yet until after an IP address has been assigned, so you're talking aobut [potentially virtual] physical network segments. You need to be able to get your DHCP server and your Nagios server on the same [potentially virtual] wire so that they can see each other. The only way to do this is through switch/router magic if your network fabric can be programmed to do that, or by doing what was suggested:

Have a box on the DHCP server network that the Nagios server can access, and run NRPE or a passive check on the box that reports DHCP server status back to Nagios. SSH access would also work, as would any number of agents, but that's the basic idea.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Wed Jul 22, 2015 12:27 pm
by lmiltchev
glenl, did jdalrymple and eloyd answer your question?

Re: DHCP Monitoring on Different Subnet or Network

Posted: Wed Jul 22, 2015 11:21 pm
by Box293
Also, keep the local firewall in mind, here is a post that explains it:

https://support.nagios.com/forum/viewto ... cp#p109694

Even though this post is about checking a DHCP scope that the XI server is in, the same applies if the plugin is executed at a remote box.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Thu Jul 23, 2015 1:11 pm
by larrydhelms
You might want to look at this: https://exchange.nagios.org/directory/P ... ed/details

It works for us... but requires a couple of PERL modules be installed, as well as being executed BY ROOT. We call it, via NRPE, and added configuration settings in both the nape.cfg / common.cfg - depending on which you prefer, as well as an entry in the sudoers file.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Thu Jul 23, 2015 1:54 pm
by lmiltchev
@larrydhelms & Box293
Thanks for the help!
@glenl
Any updates?

Re: DHCP Monitoring on Different Subnet or Network

Posted: Fri Jul 24, 2015 1:20 am
by glenl
Hi Everyone,

Sorry for the late reponse and I greatly appreciate the feedbacks.

Well, I was trying to monitor the DHCP server in another country so it was on another VLAN, but the machine was accessible on our country.

I assumed that the DHCP in our remote site would not acknowlegde our DHCP request when we tried to request from our office where our Nagios server resides.

So the only option was to use a NRPE on the remote side where the DHCP server acknowlegde DHCP requests?

I'll look upon that option.

I'm not quite familiar with NRPE monitoring so could you enumerate the procedure to deploy a DHCP monitoring through NRPE?

I would really appreciate your feedback with regards to this.

Thank you.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Fri Jul 24, 2015 9:01 am
by tgriep
Since your DHCP server is in a remote location, your only choice is to setup a remote NRPE system on that network to check the DHCP server at that location.
Here is a guide for NRPE that has a link for installing NRPE on a linux system.
https://assets.nagios.com/downloads/nag ... g_NRPE.pdf
Take a look at it and post back any questions.

Re: DHCP Monitoring on Different Subnet or Network

Posted: Mon Jul 27, 2015 5:50 am
by glenl
Hi tgriep,

Thank for the guide.

I've tested deploying a Linux server with NRPE then tried configuring a check_dhcp monitoring on that NRPE agent then tried to connect it to our Nagios server. It was successful and was abled to monitor our DHCP server.

You can now close this thread.

Thank you everyone for assistance.