Check DHCP Relay

Nagios/Icinga script for checking DHCP-Servers

DHCP Server Checker

This python script checks whether it is able to acqiure an IP as a relay server.

It is written in pure python3 and has no external dependencies. It should therefore run on any system with python3 (untested).



Needs to be run as root


usage: check_dhcp_relay [-h] -H HOST -r RELAY -n NETWORK -m MASK [-t TIMEOUT]
                        [-l LISTEN] [-c MAC] [--no-release] [--verbose]


$ check_dhcp_relay -H -r -n -m
DHCP OK | responsetime=0.01ms

Nagios/Icinga 1.x config

# 'check_dhcp_relay' command definition
define command {
        command_name    check_dhcp_relay
        command_line    sudo /usr/lib/nagios/plugins/check_dhcp_relay -H '$HOSTADDRESS$' -r $ARG1$ -n $ARG2$ -m $ARG3$