DHCP and BOOTP

Perl check dhcp

Description:

This simplified plugin tests the availability of a given DHCP server using unicast delivery.

Current Version

Last Release Date

June 23, 2009

Compatible With


Project Files
Project Notes
$ ./check_dhcp.pl -h Copyright (C) 2006 Carlos Vicente. University of Oregon. This plugin tests the availability of a given DHCP server using unicast delivery. This is necessary if the monitoring host is on a different subnet. Using broadcast and a DHCP relay would also prevent the check from probing individual servers. Usage: check_dhcp -H|--host -i|--interface --timeout -H, --host=ADDRESS IP address of DHCP server that we must hear from -i, --interface=STRING Interface to to use for listening (i.e. eth0) -t, --timeout=INTEGER Seconds to wait for DHCPOFFER before timeout occurs (default: 5) -h, --help Print detailed help screen Note: This plugin will need to run with root permissions in order to access priviledged ports 67 & 68. Since Nagios by default runs its plugins under unpriviledged user 'nagios', you will need to setuid root like: % chown root:root check_dhcp.pl % chmod 4755 check_dhcp.pl
Reviews (4) Add a Review
If you get " No response from server" make sure Nagios Server is in DHCP
by rob2791, August 31, 2021

If you get the error "No response from server", make sure your Nagios server is registered in DHCP (hopefully as a reservation). Even if your linux box is static, you still need to make a reservation for this plugin to work. Besides that, this plugin works good. You may only request 1 DHCP at a time, so you need to call this plugin multiple times, which means multiple services in Nagios. This is because this plugin uses perl module Net::DHCP::Watch. A limitation of this module is that the requesting mac address already be in the DHCP server. Module info: https://metacpan.org/pod/Net::DHCP::Watch



check_dhcp -u -s
by cayfer, November 30, 2012

Mmmm.. check_dhcp command didn't work for me. I specified a remote DHCP server ( a server sitting on a different subnet than my Nagios server) with the -s option and set the -u flag but couldn't get a response (offering).



Use the default Nagios plugin
by grittyminder, June 30, 2010

This plugin requires that IO::Interface (among other things) be installed. If you do not want to install a bunch of perl modules on your monitoring server then this could be problematic. The check_dhcp plugin that comes with Nagios Plugins package allows you to do unicast DHCP checking. Try the following: check_dhcp -u -s



Works
by behemju, May 31, 2010

Works great, even with DHCP servers on other networks thanks to unicast. But the timeout parameter seems to be ignored. Whatever the value is, the effective timeout is always less than 1 sec... Any idea ?



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.8 (4)
Favorites
0
Views
124,696