<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All,<br>
I now this is an old post, but i have a problem in monitoring a dhcp
server. Nagios is installed on a machine that is not on the same lan as
the dhcp server. After reading the help, i tried something like this:<br>
<br>
cosmin@cacti-1:/usr/local/nagios/libexec> <b>./check_dhcp -v -u -s
10.0.0.2 -i eth1</b><br>
Requested server address: 10.0.0.2<br>
DHCP socket: 3<br>
Hardware address: 00:50:56:a1:4f:bf<br>
Pretending to be relay client 192.168.53.250<br>
DHCPDISCOVER to 10.0.0.2 port 67<br>
DHCPDISCOVER XID: 96024288 (0x5B936E0)<br>
DHCDISCOVER ciaddr:  0.0.0.0<br>
DHCDISCOVER yiaddr:  0.0.0.0<br>
DHCDISCOVER siaddr:  0.0.0.0<br>
DHCDISCOVER giaddr:  192.168.53.250<br>
send_dhcp_packet result: 548<br>
<br>
<br>
No (more) data received (nfound: 0)<br>
Result=ERROR<br>
Total responses seen on the wire: 0<br>
Valid responses for this machine: 0<br>
CRITICAL: No DHCPOFFERs were received.<br>
<br>
This CRITICAL answer is given even if i can see the server giving an ip
address from the same class as nagios ip (192.168.53.250). I even see
dhcp binding on the server:<br>
R1#sh ip dhcp binding<br>
Bindings from all pools not associated with VRF:<br>
IP address          Client-ID/              Lease expiration        Type<br>
                    Hardware address/<br>
                    User name<br>
192.168.53.1        0050.56a1.4fbf          Jul 08 2010 09:44 AM   
Automatic<br>
<br>
<br>
<br>
Now, the problem is that the dhcp server is giving up addreses not in
the same subnet as nagios ip address.<br>
So if i try something like this:<br>
cosmin@cacti-1:/usr/local/nagios/libexec> <b>./check_dhcp -v -u -s
10.0.0.2 -r 1.0.0.8 -i eth1</b><br>
Requested server address: 10.0.0.2<br>
DHCP socket: 3<br>
Hardware address: 00:50:56:a1:4f:bf<br>
Pretending to be relay client 192.168.53.250<br>
DHCPDISCOVER to 10.0.0.2 port 67<br>
DHCPDISCOVER XID: 1649874259 (0x62571553)<br>
DHCDISCOVER ciaddr:  0.0.0.0<br>
DHCDISCOVER yiaddr:  0.0.0.0<br>
DHCDISCOVER siaddr:  0.0.0.0<br>
DHCDISCOVER giaddr:  192.168.53.250<br>
send_dhcp_packet result: 548<br>
<br>
No (more) data received (nfound: 0)<br>
Result=ERROR<br>
Total responses seen on the wire: 0<br>
Valid responses for this machine: 0<br>
CRITICAL: No DHCPOFFERs were received.<br>
<br>
<br>
<br>
where 10.0.0.2 is the ip of dhcp server and 1.0.0.8 an address from a
pool configured on the server, i receive no reply. The server respond
like:<br>
*Jul  8 10:04:15.783: DHCPD: there is no address pool for
192.168.53.250  //this is the ip address of nagios.<br>
<br>
<br>
<br>
So from what i see on the server:<br>
DHCPD: DHCPDISCOVER received from client 0050.56a1.4fbf through relay
192.168.53.250<br>
DHCPD: Seeing if there is an internally specified pool class<br>
DHCPD: there is no address pool for 192.168.53.250<br>
<br>
I thing that nagios sets the relay agent ip address in dhcp header to
be the ip address of the interface from where the dhcpdiscover is sent.
Is there any posibilities to control this, i mean to put in that header
whatever ip address i want for dhcp relay agent?<br>
<br>
Otherwise, i thing nagios cand only monitor dhcp servers on the same
lan/subnet. and i realy need a remote solution for monitoring.<br>
<br>
Thx for help.<br>
<br>
<br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72"> Cosmin Neagu
 NOC Team Leader
 Str. I. G. Duca nr 36
 Otopeni, Judetul Ilfov, 075100 Romania
 Tel: 021 303 3159 / 0732 669 193
 <a class="moz-txt-link-abbreviated" href="http://www.omnilogic.ro">www.omnilogic.ro</a>
</pre>
<br>
<br>
Marc Powell wrote:
<blockquote cite="mid:96D3C579-A4A8-4C58-9D8A-44AF19191993@ena.com"
 type="cite">
  <pre wrap="">On Jan 14, 2010, at 7:33 AM, Eduardo Barreto wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi All,

Does anybody knows or have a clue on how to check a dhcp server, I've tried direct no success and then I'm trying to monitor it through nrpe.
I'll appreciate any help
    </pre>
  </blockquote>
  <pre wrap=""><!---->
There's a check_dhcp plugin in the standard plugins to verify that a DHCP server his handing out leases. You need to run it from a host on the LAN that your DHCP server answers on. In most cases you cannot run this plugin on the DHCP server itself as they are most often configured *not* to give answers to themselves. If you're limited to running something on the DHCP server itself, you'll likely only be able to look to see if the DHCP process/service is running. How that's done depends on the OS of the server and how you can get to it from the Nagios machine.

--
Marc


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/rsaconf-dev2dev">http://p.sf.net/sfu/rsaconf-dev2dev</a>
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
  </pre>
</blockquote>
</body>
</html>