Discussion:
[Nagios-users] check_dhcp seems not working
Christian Iñiguez
2009-01-15 18:46:46 UTC
Permalink
Hi Everyone

I have a linux server as dhcp server and it's working very well, and I'd like to monitoring it with nrpe plugin and check_dhcp.

The problem here is the outcome of check_dhcp is always: CRITICAL: No DHCPOFFERs were received. But the server is working alright.

The command line is: check_dhcp -s serverip -t 30

What am I doing wrong? Any suggest?

Thanks in advance!

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/
j***@corp.xanadoo.com
2009-01-15 19:06:21 UTC
Permalink
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
like to monitoring it with nrpe plugin and check_dhcp.>
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself. The DHCP server will see an incoming requeset from itself and
probably block it. Therefore, using the nrpe method of doing these checks
is a moot point.

If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box. If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
probably have to do several things:

1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address

There are probably other methods as well.

James
Christian Iñiguez
2009-01-15 19:18:41 UTC
Permalink
In deed both servers (the dhcp server and nagios server) are in the same subnet and there is no firewall between them.
Kevin Keane
2009-01-15 19:39:47 UTC
Permalink
Post by j***@corp.xanadoo.com
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
like to monitoring it with nrpe plugin and check_dhcp.>
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself. The DHCP server will see an incoming requeset from itself and
probably block it. Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box. If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.

check_dhcp -v prints this:

DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.
Christian Iñiguez
2009-01-15 19:54:36 UTC
Permalink
Exactly Kevin, you are right



----- Mensaje original ----
De: Kevin Keane <***@kkeane.com>
CC: nagios-***@lists.sourceforge.net
Enviado: jueves, 15 de enero, 2009 13:39:47
Asunto: Re: [Nagios-users] check_dhcp seems not working
Post by j***@corp.xanadoo.com
 
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
   
like to monitoring it with nrpe plugin and check_dhcp.>
 
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
   
DHCPOFFERs were received. But the server is working alright.
 
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
   
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself.  The DHCP server will see an incoming requeset from itself and
probably block it.  Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box.  If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.

check_dhcp -v prints this:

DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/
Kevin Keane
2009-01-15 20:02:29 UTC
Permalink
Christian, actually, your question prompted me to try it again. Turned
out that it was the firewall software on my Nagios box that blocked the
DHCP request. As soon as I turned it off, check_dhcp worked. I'm not yet
sure which ports to open to make it work with the firewall on. So far, I
tried ports 67 and 68 for both TCP and UDP, but that seems not to be enough.
Post by Christian Iñiguez
Exactly Kevin, you are right
----- Mensaje original ----
Enviado: jueves, 15 de enero, 2009 13:39:47
Asunto: Re: [Nagios-users] check_dhcp seems not working
Post by j***@corp.xanadoo.com
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
like to monitoring it with nrpe plugin and check_dhcp.>
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself. The DHCP server will see an incoming requeset from itself and
probably block it. Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box. If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.
DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.
James Miller
2009-01-15 20:12:48 UTC
Permalink
Sorry for the top post

1. Lease Request - The client sends a broadcast requesting an IP address
2. Lease Offer - The server sends the above information and marks the
offered address as unavailable. The message sent is a DHCPOFFER
broadcast message.
3. Lease Acceptance - The first offer received by the client is
accepted. The acceptance is sent from the client as a broadcast
(DHCPREQUEST message) including the IP address of the DNS server
that sent the accepted offer. Other DHCP servers retract their
offers and mark the offered address as available and the accepted
address as unavailable.
4. Server lease acknowledgement - The server sends a DHCPACK or a
DHCPNACK if an unavailable address was requested.

All DHCP packets travel as UDP datagrams; all client-sent packets have
source port 68 and destination port 67; all server-sent packets have
source port 67 and destination port 68. For example, a server-side
firewall should allow the following types of packets:

* Incoming packets from 0.0.0.0 or dhcp-pool to dhcp-ip
* Incoming packets from any address to 255.255.255.255
* Outgoing packets from dhcp-ip to dhcp-pool or 255.255.255.255

where dhcp-ip represents any address configured on a DHCP server host
and dhcp-pool stands for the pool from which a DHCP server assigns
addresses to clients


Jim
Post by Kevin Keane
Christian, actually, your question prompted me to try it again. Turned
out that it was the firewall software on my Nagios box that blocked the
DHCP request. As soon as I turned it off, check_dhcp worked. I'm not yet
sure which ports to open to make it work with the firewall on. So far, I
tried ports 67 and 68 for both TCP and UDP, but that seems not to be enough.
Post by Christian Iñiguez
Exactly Kevin, you are right
----- Mensaje original ----
Enviado: jueves, 15 de enero, 2009 13:39:47
Asunto: Re: [Nagios-users] check_dhcp seems not working
Post by j***@corp.xanadoo.com
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
like to monitoring it with nrpe plugin and check_dhcp.>
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself. The DHCP server will see an incoming requeset from itself and
probably block it. Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box. If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.
DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
Holger Weiss
2009-01-15 20:32:42 UTC
Permalink
If you're running Nagios on a different network than the DHCP server and
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
For such a setup, step (2) isn't necessary, as check_dhcp will mimic a
DHCP relay if the "--unicast" option is specified.

Holger
Kevin Keane
2009-01-16 03:55:07 UTC
Permalink
Thank you!

In my case, the server-side firewall works without a problem. The server
does hand out DHCP addresses all the time.

It was the client-side firewall (i.e., the one on the Nagios server)
that blocked the DHCP request, even though I opened both ports 67 and 68
for both TCP and UDP. It happened both with broadcast DHCP requests and
with directed ones (using the -s <serverip> arg).

Oddly enough, I didn't see anything at all in the firewall log that
would indicate what was blocked.
Post by James Miller
Sorry for the top post
1. Lease Request - The client sends a broadcast requesting an IP
address
2. Lease Offer - The server sends the above information and marks
the offered address as unavailable. The message sent is a
DHCPOFFER broadcast message.
3. Lease Acceptance - The first offer received by the client is
accepted. The acceptance is sent from the client as a broadcast
(DHCPREQUEST message) including the IP address of the DNS server
that sent the accepted offer. Other DHCP servers retract their
offers and mark the offered address as available and the
accepted address as unavailable.
4. Server lease acknowledgement - The server sends a DHCPACK or a
DHCPNACK if an unavailable address was requested.
All DHCP packets travel as UDP datagrams; all client-sent packets have
source port 68 and destination port 67; all server-sent packets have
source port 67 and destination port 68. For example, a server-side
* Incoming packets from 0.0.0.0 or dhcp-pool to dhcp-ip
* Incoming packets from any address to 255.255.255.255
* Outgoing packets from dhcp-ip to dhcp-pool or 255.255.255.255
where dhcp-ip represents any address configured on a DHCP server host
and dhcp-pool stands for the pool from which a DHCP server assigns
addresses to clients
Jim
Post by Kevin Keane
Christian, actually, your question prompted me to try it again. Turned
out that it was the firewall software on my Nagios box that blocked the
DHCP request. As soon as I turned it off, check_dhcp worked. I'm not yet
sure which ports to open to make it work with the firewall on. So far, I
tried ports 67 and 68 for both TCP and UDP, but that seems not to be enough.
Post by Christian Iñiguez
Exactly Kevin, you are right
----- Mensaje original ----
Enviado: jueves, 15 de enero, 2009 13:39:47
Asunto: Re: [Nagios-users] check_dhcp seems not working
Post by j***@corp.xanadoo.com
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
like to monitoring it with nrpe plugin and check_dhcp.>
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself. The DHCP server will see an incoming requeset from itself and
probably block it. Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box. If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.
DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.
Christian Iñiguez
2009-01-16 14:18:13 UTC
Permalink
Thank you.

But I have neither firewall nor SELinux enabled. In deed for a moment worked, but a couple of hours later it didn't work again.

It's really weird.



----- Mensaje original ----
De: Kevin Keane <***@kkeane.com>
CC: nagios-***@lists.sourceforge.net
Enviado: jueves, 15 de enero, 2009 21:55:07
Asunto: Re: [Nagios-users] check_dhcp seems not working

Thank you!

In my case, the server-side firewall works without a problem. The server
does hand out DHCP addresses all the time.

It was the client-side firewall (i.e., the one on the Nagios server)
that blocked the DHCP request, even though I opened both ports 67 and 68
for both TCP and UDP. It happened both with broadcast DHCP requests and
with directed ones (using the -s <serverip> arg).

Oddly enough, I didn't see anything at all in the firewall log that
would indicate what was blocked.
Post by James Miller
Sorry for the top post
    1. Lease Request - The client sends a broadcast requesting an IP
      address
    2. Lease Offer - The server sends the above information and marks
      the offered address as unavailable. The message sent is a
      DHCPOFFER broadcast message.
    3. Lease Acceptance - The first offer received by the client is
      accepted. The acceptance is sent from the client as a broadcast
      (DHCPREQUEST message) including the IP address of the DNS server
      that sent the accepted offer. Other DHCP servers retract their
      offers and mark the offered address as available and the
      accepted address as unavailable.
    4. Server lease acknowledgement - The server sends a DHCPACK or a
      DHCPNACK if an unavailable address was requested.
All DHCP packets travel as UDP datagrams; all client-sent packets have
source port 68 and destination port 67; all server-sent packets have
source port 67 and destination port 68. For example, a server-side
    * Incoming packets from 0.0.0.0 or dhcp-pool to dhcp-ip
    * Incoming packets from any address to 255.255.255.255
    * Outgoing packets from dhcp-ip to dhcp-pool or 255.255.255.255
where dhcp-ip represents any address configured on a DHCP server host
and dhcp-pool stands for the pool from which a DHCP server assigns
addresses to clients
Jim
 
Post by Kevin Keane
Christian, actually, your question prompted me to try it again. Turned
out that it was the firewall software on my Nagios box that blocked the
DHCP request. As soon as I turned it off, check_dhcp worked. I'm not yet
sure which ports to open to make it work with the firewall on. So far, I
tried ports 67 and 68 for both TCP and UDP, but that seems not to be enough.
 
Post by Christian Iñiguez
Exactly Kevin, you are right
----- Mensaje original ----
Enviado: jueves, 15 de enero, 2009 13:39:47
Asunto: Re: [Nagios-users] check_dhcp seems not working
 
   
Post by j***@corp.xanadoo.com
 
   
     
Post by Christian Iñiguez
Hi Everyone
I have a linux server as dhcp server and it's working very well, and I'd
   
     
       
like to monitoring it with nrpe plugin and check_dhcp.>
 
   
     
Post by Christian Iñiguez
The problem here is the outcome of check_dhcp is always: CRITICAL: No
   
     
       
DHCPOFFERs were received. But the server is working alright.
 
   
     
Post by Christian Iñiguez
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
Thanks in advance!
   
     
       
I have no idea which flavor of DHCP you are running (probably ISC's), but I
don't think you are going to be able to run check_dhcp from the DHCP server
itself.  The DHCP server will see an incoming requeset from itself and
probably block it.  Therefore, using the nrpe method of doing these checks
is a moot point.
If your Nagios server is on the same network as the DHCP server, just run
check_dhcp from the Nagios box.  If you're running Nagios on a different
network than the DHCP server and there is a firewall in between, you'll
1. Open up a hole in the firewall to allow the Nagios server to request a
DHCP address from the DHCP server
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
3. Setup a small DHCP subnet on the DHCP server in the same IP range as the
Nagios server so it can offer a valid IP address
   
     
I actually have the same problem as Christian, and it does NOT work even
though Nagios is running on a different box on the same network as the
DHCP server. In fact, the Nagios box actually gets its IP address from
the same DHCP server that I would like to monitor (ISC DHCP server 3.0.6
on a SuSE 10.3). I've seen the same problem before against a Windows
DHCP server, too, never been able to make check_dhcp work.
DHCP socket: 3
Hardware address: 00:0c:29:0e:28:4f
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 2138668641 (0x7F797E61)
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.
 
   
 
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Nagios-users mailing list
Nagios-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/
Morris, Patrick
2009-01-15 19:18:08 UTC
Permalink
Post by Christian Iñiguez
I have a linux server as dhcp server and it's working very well, and
I'd like to monitoring it with nrpe plugin and check_dhcp.
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
This one's come up a billion times or so on the list, but the most likely cause of your problem is that the plugin needs to be setuid root.
Christian Iñiguez
2009-01-15 19:24:54 UTC
Permalink
Thanks but actually the plugin is setuid root, and as user root and user nagios the outcome is the same =(



----- Mensaje original ----
De: "Morris, Patrick" <***@hp.com>
Para: Christian Iñiguez <***@yahoo.com.mx>; "nagios-***@lists.sourceforge.net" <nagios-***@lists.sourceforge.net>
Enviado: jueves, 15 de enero, 2009 13:18:08
Asunto: RE: [Nagios-users] check_dhcp seems not working
Post by Christian Iñiguez
I have a linux server as dhcp server and it's working very well, and
I'd like to monitoring it with nrpe plugin and check_dhcp.
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
The command line is: check_dhcp -s serverip -t 30
What am I doing wrong? Any suggest?
This one's come up a billion times or so on the list, but the most likely cause of your problem is that the plugin needs to be setuid root.


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/
j***@corp.xanadoo.com
2009-01-15 19:25:24 UTC
Permalink
James Moseley
Post by Christian Iñiguez
In deed both servers (the dhcp server and nagios server) are in the same
subnet and there is no firewall between them.
Christian Iñiguez
2009-01-15 19:53:03 UTC
Permalink
I'm sorry, I already understood. But well, I did it like you told me, and I got the same outcome

Running the check_dhcp on the nagios server.



----- Mensaje original ----
De: "***@corp.xanadoo.com" <***@corp.xanadoo.com>
Para: Christian Iñiguez <***@yahoo.com.mx>
CC: nagios-***@lists.sourceforge.net
Enviado: jueves, 15 de enero, 2009 13:25:24
Asunto: Re: [Nagios-users] check_dhcp seems not working



James Moseley
Post by Christian Iñiguez
In deed both servers (the dhcp server and nagios server) are in the same
subnet and there is no firewall between them.
j***@corp.xanadoo.com
2009-01-15 19:58:08 UTC
Permalink
Christian Iñiguez
<challenger_josep
***@yahoo.com.mx> To
"Morris, Patrick"
01/15/2009 01:24 <***@hp.com>,
PM nagios-***@lists.sourceforge.net
cc

Subject
Re: [Nagios-users] check_dhcp seems
not working
Post by Christian Iñiguez
Thanks but actually the plugin is setuid root, and as user root and user
nagios the outcome is the same =(

Christian, Patrick is correct, and something I forgot about. The
check_dhcp plugin needs to be setuid, which you've indicated it is.

Can you try running check_dhcp directly from the Nagios server though?
With your setup, it doesn't make sense to use check_nrpe when you can query
the DHCP server directly. And as I've said, I'm not sure you are going to
be able to run check_dhcp from the DHCP server itself, unless you have
multiple interfaces.
Post by Christian Iñiguez
Post by Morris, Patrick
This one's come up a billion times or so on the list, but the most likely
cause of your problem is that the plugin needs to be setuid root.



James
j***@corp.xanadoo.com
2009-01-15 20:16:43 UTC
Permalink
Post by Kevin Keane
Christian, actually, your question prompted me to try it again. Turned
out that it was the firewall software on my Nagios box that blocked the
DHCP request. As soon as I turned it off, check_dhcp worked. I'm not yet
sure which ports to open to make it work with the firewall on. So far, I
tried ports 67 and 68 for both TCP and UDP, but that seems not to be
enough.

Kevin, that's a really good point. Christian, do you have iptables running
on either the nagios or DHCP server boxes?

James
Holger Weiss
2009-01-15 20:37:22 UTC
Permalink
Post by Christian Iñiguez
I have a linux server as dhcp server and it's working very well, and
I'd like to monitoring it with nrpe plugin and check_dhcp.
The problem here is the outcome of check_dhcp is always: CRITICAL: No
DHCPOFFERs were received. But the server is working alright.
Do you see the request and a reply in the DHCP server's logs? If so,
could you verify that the server's reply reaches the host running
check_dhcp using tcpdump(8) (e.g., "tcpdump -vv port bootps")?

Holger
j***@corp.xanadoo.com
2009-01-15 20:59:59 UTC
Permalink
Post by Holger Weiss
Post by j***@corp.xanadoo.com
2. Have a DHCP relay statement on the router's interface your Nagios
server
Post by Holger Weiss
Post by j***@corp.xanadoo.com
connects to so it knows to which server to relay the DHCP request to
For such a setup, step (2) isn't necessary, as check_dhcp will mimic a
DHCP relay if the "--unicast" option is specified.
What I meant was you'd have to have an ip helper-address configured.

James
Holger Weiss
2009-01-15 21:19:29 UTC
Permalink
Post by j***@corp.xanadoo.com
Post by Holger Weiss
Post by j***@corp.xanadoo.com
2. Have a DHCP relay statement on the router's interface your Nagios server
connects to so it knows to which server to relay the DHCP request to
For such a setup, step (2) isn't necessary, as check_dhcp will mimic a
DHCP relay if the "--unicast" option is specified.
What I meant was you'd have to have an ip helper-address configured.
But that's precisely what you don't need if you use check_dhcp's
"--unicast" option :-) If you configure an "ip helper-address" (as
Cisco calls it), the router will relay local DHCP broadcast packets to
the specified remote DHCP server. "check_dhcp --unicast" creates the
same sort of unicast packets such a relay would generate.

Holger
j***@corp.xanadoo.com
2009-01-15 21:44:47 UTC
Permalink
Post by Holger Weiss
Post by j***@corp.xanadoo.com
Post by Holger Weiss
Post by j***@corp.xanadoo.com
2. Have a DHCP relay statement on the router's interface your Nagios
server
Post by Holger Weiss
Post by j***@corp.xanadoo.com
Post by Holger Weiss
Post by j***@corp.xanadoo.com
connects to so it knows to which server to relay the DHCP request to
For such a setup, step (2) isn't necessary, as check_dhcp will mimic a
DHCP relay if the "--unicast" option is specified.
What I meant was you'd have to have an ip helper-address configured.
But that's precisely what you don't need if you use check_dhcp's
"--unicast" option :-) If you configure an "ip helper-address" (as
Cisco calls it), the router will relay local DHCP broadcast packets to
the specified remote DHCP server. "check_dhcp --unicast" creates the
same sort of unicast packets such a relay would generate.
OK, I've got you now.

Back to the orginal topic. Christian, another thing to check on the Nagios
server is if you have SELinux enabled. That could definitely cause
problems with plugins that are SUID root. If SELinux is enabled, disable
it and try the check_dhcp plugin again.

James
j***@corp.xanadoo.com
2009-01-16 14:41:07 UTC
Permalink
Post by Christian Iñiguez
Thank you.
But I have neither firewall nor SELinux enabled. In deed for a moment
worked, but a couple of hours later it didn't work again.
Post by Christian Iñiguez
It's really weird.
Have you checked your DHCP logs? Do you have enough leases available in
the subnet you would expect the Nagios server to be offered an address
from? If your DHCP server doesn't hand out DHCP addresses to other
machines on that network (the same your Nagios server is on), for the ISC
DHCP daemon to even work, you still must define a subnet on that local
network in the DHCP config, even if you only have one DHCP address
available.

This isn't really a Nagios problem, but a problem with check_dhcp. It
sounds like the plugin is setup with the appropriate permissions (owned by
root, setuid root, etc) and that there are no inbound/outbound firewalls or
SELinux issues to deal with.

Honestly, unless there is a configuration problem with DHCP, I can't think
of anything else.

James

Continue reading on narkive:
Loading...