<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transational//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
</HEAD>
<BODY>H<span style="font-family: arial,helvetica,sans-serif;">ello,</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">I try to check my DHCP server with Nagios 3.0.3 thanks to the check_dhcp plugins coming from the 1.4.13 plugin pack.</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">My approach is, my Nagios server is located in a network 192.168.90.X
and my DHCP server 192.168.105.X. And I try to check the correct work of DHCP
server with the following command :<br></span><div style="text-align: left; margin-left: 40px; font-family: arial,helvetica,sans-serif; color: rgb(0, 0, 204);"><font size="2"><span style="font-weight: bold;">./check_dhcp -v -u -s 192.168.105.Y -r 192.168.90.B -m 01:AB:23:CD:45:EF
</span><br>
Requested server address: 92.168.105.Y
<br>
Hardware address: 1:AB:23:CD:45:EF
<br>
DHCP socket: 3
<br>
Pretending to be relay client 192.168.90.B
<br>
DHCPDISCOVER to 192.168.X.Y port 67
<br>
DHCPDISCOVER XID: 164920453 (0x9D47C85)
<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.90.B
<br>
send_dhcp_packet result: 548
<br><br>
recv_result_1: 331
<br>
recv_result_2: 331
<br>
receive_dhcp_packet() result: 331
<br>
receive_dhcp_packet() source: 192.168.105.Y
<br>
<span style="font-weight: bold; color: rgb(51, 102, 0);">Result=OK
</span><br>
DHCPOFFER from IP address 192.168.X.Y via 192.168.105.Y
<br>
DHCPOFFER XID: 164920453 (0x9D47C85)
<br>
DHCPOFFER chaddr: 01AB23CD45EF
<br>
DHCPOFFER ciaddr: 0.0.0.0
<br>
DHCPOFFER yiaddr: 192.168.90.B<br>
DHCPOFFER siaddr: 0.0.0.0
<br>
DHCPOFFER giaddr: 192.168.90.B<br>
Option: 53 (0x01)
<br>
Option: 54 (0x04)
<br>
Option: 51 (0x04)
<br>
Option: 1 (0x04)
<br>
Option: 6 (0x08)
<br>
Option: 12 (0x12)
<br>
Option: 58 (0x04)
<br>
Option: 59 (0x04)
<br>
Lease Time: 604800 seconds
<br>
Renewal Time: 302400 seconds
<br>
Rebinding Time: 529200 seconds
<br>
Added offer from server @ 192.168.105.Y of IP address 192.168.90.B
<br><br>
No (more) data received (nfound: 0)
<br><span style="font-weight: bold; color: rgb(204, 51, 51);">Result=ERROR
</span><br>
Total responses seen on the wire: <span style="font-weight: bold;">1</span><br>
Valid responses for this machine: <span style="font-weight: bold;">1
</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">
DHCP Server Match: Offerer=192.168.105.Y Requested=192.168.105.Y
</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">
<span style="font-weight: bold; background-color: rgb(255, 255, 0);">OK: </span>Received 1 DHCPOFFER(s), 1 of 1 requested servers responded,
requested address (192.168.90.B was offered, max lease time = 604800 sec.
        

</span><span style="font-family: arial,helvetica,sans-serif;" class="postbody">
</span><br style="font-family: arial,helvetica,sans-serif;"></font>







</div><span style="font-family: arial,helvetica,sans-serif;"><br>I've make a reservation in my infoblox with this MAC address. I try to analyse the return code but I have nothing, </span><br style="font-family: arial,helvetica,sans-serif;"><div style="text-align: left; margin-left: 40px; font-family: arial,helvetica,sans-serif;"><span style="color: rgb(0, 51, 153);">echo $result ==> NOTHING</span><br></div><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">How I can verify, if the check works well, and In my web nagios interface toward the check_dhcp I have :</span><span style="font-weight: bold; font-family: arial,helvetica,sans-serif;"> (null)</span>.<br><img><br><br><span style="font-family: arial,helvetica,sans-serif; font-weight: bold; text-decoration: underline;">My declarations in the differents config files :</span><br style="font-family: arial,helvetica,sans-serif;"><div style="margin-left: 40px; color: rgb(0, 51, 255);"><font size="2"><span style="font-family: arial,helvetica,sans-serif;">Commands.cfg : </span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">------------------------</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">#'check_dhcp' command definition avec réservation adresse MAC</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define command{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_name     check_dhcp</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_line        sudo $USER1$/check_dhcp -u -s 192.168.105.X -r 192.168.90.Y -m 01:AB:23:CD:45:EF
</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">#'check_dhcp2' command definition avec réservation adresse MAC au travers de variable</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define command{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_name     check_dhcp2</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_line        sudo $USER1$/check_dhcp -v -u -s $ARG1$ -r $ARG2$ -m $ARG3$</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">#'check_dhcp3' command definition simple</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define command{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_name     check_dhcp3</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    command_line        sudo $USER1$/check_dhcp -u -s 192.168.105.X</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }</span><br style="font-family: arial,helvetica,sans-serif;"></font></div><font size="2"><br style="font-family: arial,helvetica,sans-serif;"></font><div style="margin-left: 40px; color: rgb(0, 51, 255);"><font size="2"><span style="font-family: arial,helvetica,sans-serif;">Switch.cfg :</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">-----------------</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">#Define a service to check the DHCP service    </span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define service{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    use                           generic-service</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    host_name                infoblox-forum</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    service_description    dhcp reservation MAC</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    check_command       check_dhcp</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }    </span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define service{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    use                              generic-service</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    host_name                   infoblox</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    service_description     dhcp2 reservation MAC avec ARG</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    check_command        check_dhcp2</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }    </span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">define service{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    use                           generic-service</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    host_name                infoblox</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    service_description    dhcp3 sans rien</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    check_command       check_dhcp3</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">    }</span></font><br style="font-family: arial,helvetica,sans-serif;"></div><br style="font-family: arial,helvetica,sans-serif;"><div style="text-align: left; font-family: arial,helvetica,sans-serif;" id="result_box" dir="ltr">How to solve problem with the server Infoblox? And how to test the return code of the plugins? <br><br> Thank you in advance, for your help.</div><div style="text-align: left;" id="result_box" dir="ltr"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Romain S.</span><br></div></BODY></HTML>