Page 1 of 2

Monitoring DHCP Server in Nagios XI

Posted: Thu May 23, 2019 6:05 am
by vinish098
Hello team,

We are monitoring DHCP Server with Nagios XI.

While running check_dhcp plugin getting one error is below attachment.

Please do needful for DHCP monitoring with Nagios XI.

Re: Monitoring DHCP Server in Nagios XI

Posted: Thu May 23, 2019 9:52 am
by scottwilkerson
If the interface on your system is named something other than eth0 you need to pass the -i argument

from the plugin help

Code: Select all

 -i, --interface=STRING
    Interface to to use for listening (i.e. eth0)
For example

Code: Select all

/usr/local/nagios/libexec/check_dhcp -i ens160

Re: Monitoring DHCP Server in Nagios XI

Posted: Fri May 24, 2019 1:00 am
by vinish098
Hello team,

Thanks for your reply.

I was trying to run below.

# cd /usr/local/nagios/libexec/
# ./check_dhcp -v -u -s <server ip> -i <interface>

Error is attached screenshot.

Re: Monitoring DHCP Server in Nagios XI

Posted: Fri May 24, 2019 6:59 am
by scottwilkerson
Are you sure there is a dhcp server responding on that interface?

Re: Monitoring DHCP Server in Nagios XI

Posted: Fri May 24, 2019 8:22 am
by vinish098
Thanks for reply.

Yes, it's responding interface from dhcp server.

Re: Monitoring DHCP Server in Nagios XI

Posted: Fri May 24, 2019 8:55 am
by scottwilkerson
A typical verbose response looks like this

Code: Select all

/usr/local/nagios/libexec/check_dhcp -v -i eth0
DHCP socket: 3
Hardware address: 00:50:56:83:b1:b7
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 914314809 (0x367F5639)
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




recv_result_1: 300
recv_result_2: 300
receive_dhcp_packet() result: 300
receive_dhcp_packet() source: 192.168.5.80
Result=OK
DHCPOFFER from IP address 192.168.5.80 via 192.168.5.80
DHCPOFFER XID: 914314809 (0x367F5639)
DHCPOFFER chaddr: 00505683B1B7
DHCPOFFER ciaddr: 0.0.0.0
DHCPOFFER yiaddr: 192.168.5.182
DHCPOFFER siaddr: 192.168.5.80
DHCPOFFER giaddr: 0.0.0.0
Option: 53 (0x01)
Option: 1 (0x04)
Option: 58 (0x04)
Option: 59 (0x04)
Option: 51 (0x04)
Option: 54 (0x04)
Lease Time: 86400 seconds
Renewal Time: 43200 seconds
Rebinding Time: 75600 seconds
Added offer from server @ 192.168.5.80 of IP address 192.168.5.182


recv_result_1: 300
recv_result_2: 300
receive_dhcp_packet() result: 300
receive_dhcp_packet() source: 192.168.5.80
Result=OK
DHCPOFFER from IP address 192.168.5.80 via 192.168.5.80
DHCPOFFER XID: 1049859531 (0x3E9395CB)
DHCPOFFER XID (1049859531) did not match DHCPDISCOVER XID (914314809) - ignoring packet
Total responses seen on the wire: 2
Valid responses for this machine: 1
OK: Received 1 DHCPOFFER(s), max lease time = 86400 sec.
Can you try without specifying the -s flag

Re: Monitoring DHCP Server in Nagios XI

Posted: Mon May 27, 2019 7:05 am
by vinish098
Hello team,

Thanks for your reply.

Can we get any document for DHCP monitoring in Nagios XI.

I tried many ways, may be i due to some issue with check_dhcp plugin or some other issues i am not able to complete this DHCP server adding in Nagios XI.

Could you please help me with document.

Thanks.

Re: Monitoring DHCP Server in Nagios XI

Posted: Mon May 27, 2019 1:12 pm
by dwhitfield
Can you upload the check_dhcp you are using? Plugins can be named anything, so support will need to see the actual code to know for sure they are giving you the proper documentation, should documentation exist. Did you try a -h flag on the plugin to see if it had help?

Re: Monitoring DHCP Server in Nagios XI

Posted: Tue May 28, 2019 6:54 am
by scottwilkerson
Can you try without specifying the -s flag and show the output?

Re: Monitoring DHCP Server in Nagios XI

Posted: Wed May 29, 2019 5:49 pm
by vinish098
Hi Scot,

We are trying to monitor DHCP server which is running on a windows server, not on Linux.