Page 1 of 2

DHCP Monitoring

Posted: Tue Feb 28, 2017 9:42 am
by CJIndustries
Hello,

I've been trying to get nagios to monitor my windows 2008 dhcp service with so success. Both servers are on the same network and there are no firewall issue between them. I even setup a new nic on the vm and had it dhcp it's address with success. Every time I try to setup the dhcp monitoring service, I get "No DHCPOFFERs were received".

I've searched the forums and tried everything I could think of. Any help would be awesome. Thanks in advanced.

Mike

Re: DHCP Monitoring

Posted: Tue Feb 28, 2017 12:38 pm
by avandemore
Can you show the full Run Check Command output for this service?

Re: DHCP Monitoring

Posted: Tue Feb 28, 2017 12:58 pm
by CJIndustries
I'm sorry, I don't understand what "full Run Check Command output" means. If there is a specific command you would like me to run, let me know. The most I get out of the notifications and manually running the command on the server is "No DHCPOFFERs were received".

Re: DHCP Monitoring

Posted: Tue Feb 28, 2017 1:49 pm
by dwhitfield
Are you using the DHCP Wizard to set things up? If not, what plugin are you using? Please give us a link to the plugin on exchange.na0gios.com or otherwise, not just the name.

To see specifically the Run Check Command, you'll need to go to the service in the CCM (Core Config Manager) under Configure, and then go to the service.

Re: DHCP Monitoring

Posted: Tue Feb 28, 2017 2:11 pm
by CJIndustries
I just used the wizard to add the service and linked it to the dhcp(domain) controller. The command is "check_dhcp" and the command is "$USER1$/check_dhcp $ARG1$".

Re: DHCP Monitoring

Posted: Tue Feb 28, 2017 5:12 pm
by lmiltchev
Can you run the following commands from the command line on the Nagios XI server, and show the output?

Code: Select all

iptables -nL | grep '161\|162'
nmap -sU <windows server's ip address> -p 161-162
/usr/local/nagios/libexec/check_dhcp <windows server's ip address> -v
Note: if your interface's name is not "eth0" you will need to pass it in your command:

Code: Select all

/usr/local/nagios/libexec/check_dhcp -i <interface> <windows server's ip address> -v
Example:

Code: Select all

[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_dhcp -i ens32 x.x.x.x -v
OK: Received 1 DHCPOFFER(s), max lease time = 28800 sec.

Re: DHCP Monitoring

Posted: Wed Mar 01, 2017 7:28 am
by CJIndustries
[root@NAGIOS ~]# iptables -nL | grep '161\|162'
[root@NAGIOS ~]# nmap -sU 10.1.1.100 -p 161-162

Starting Nmap 6.47 ( http://nmap.org ) at 2017-03-01 07:22 EST
Nmap scan report for 10.1.1.100
Host is up (0.00043s latency).
PORT STATE SERVICE
161/udp open|filtered snmp
162/udp open|filtered snmptrap
MAC Address: 34:E6:D7:1B:B2:B1 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 1.26 seconds
[root@NAGIOS ~]# /usr/local/nagios/libexec/check_dhcp 10.1.1.100 -v
DHCP socket: 3
Hardware address: 00:50:56:88:4c:5c
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 196385898 (0xBB45882)
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.
[root@NAGIOS ~]#

Re: DHCP Monitoring

Posted: Wed Mar 01, 2017 1:17 pm
by lmiltchev
I asked you to run a command with wrong ports - my bad. I am sorry about it! Can you run the correct command and show the output?

Code: Select all

nmap -sU <windows server's ip address> -p 67-68
Do you get even more verbose output if you use more than one "v"?

Code: Select all

/usr/local/nagios/libexec/check_dhcp 10.1.1.100 -vvv
What is the plugin's version?

Code: Select all

/usr/local/nagios/libexec/check_dhcp -V
Are your Nagios XI and the DHCP server on the same subnet?

Re: DHCP Monitoring

Posted: Wed Mar 01, 2017 1:28 pm
by CJIndustries
[root@NAGIOS ~]# iptables -nL | grep '67\|68'
[root@NAGIOS ~]# nmap -sU 10.1.1.100 -p 67-68

Starting Nmap 6.47 ( http://nmap.org ) at 2017-03-01 13:24 EST
Nmap scan report for 10.1.1.100
Host is up (0.00042s latency).
PORT STATE SERVICE
67/udp open|filtered dhcps
68/udp open|filtered dhcpc
MAC Address: 34:E6:D7:1B:B2:B1 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 1.27 seconds
[root@NAGIOS ~]# /usr/local/nagios/libexec/check_dhcp 10.1.1.100 -vvv
DHCP socket: 3
Hardware address: 00:50:56:89:4a:5a
DHCPDISCOVER to 255.255.255.255 port 67
DHCPDISCOVER XID: 37105692 (0x2353404)
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.
[root@NAGIOS ~]# /usr/local/nagios/libexec/check_dhcp -V
check_dhcp v2.0.3 (nagios-plugins 2.0.3)
[root@NAGIOS ~]#

Re: DHCP Monitoring

Posted: Wed Mar 01, 2017 3:05 pm
by tgriep
One thing to try is if you left both Ethernet interfaces enabled on the XI server, you would probably have to specify the the interface by using the -i option in your command.
Another thing to try is to specify the DHCP servers IP address in the command so the plugin checks the correct server. Try running the following example and see if that works for you.

Code: Select all

/usr/local/nagios/libexec/check_dhcp -i eth0 -s 10.1.1.100
Change the eth0 in the above to the correct name of the ethernet adaptor on your system.
You can run the following command to get the names of them.

Code: Select all

ip addr