How to query for available / used ip

Simon Hobson dhcp1 at thehobsons.co.uk
Sat Jun 20 12:07:09 UTC 2015


Leandro <ingrogger at gmail.com> wrote:

> Hello Guys , I would like to plot the function of my dhcpd server on cacti graph.
> I want to know ir is there any recommended way to ask a running dhcp server how many ips were granted and how many are available ?

Check out dhcp-pool
As well as a command line tool, it has a munin plugin component. In principle it shouldn't be too hard to get it to update an RRD but I haven't got that far yet. As a command line tool it will give you information like this :

Subnet 192.168.7.0/24
--------------------------------------------------

  1. Pool "WiFi":

     Monitoring:      ON
     Warning limit:   75%
     Critical limit:  90%
     Active leases:   22/91 (24.2%)

While the Munin plugin will give you output like this :

$ dhcpd-munin_192.168.7.0_24_1
active.value 22
warning.value 68.2
critical.value 81.9
max.value 91

I figure the latter should be parseable into something that can be fed into Nagios and Cacti



More information about the dhcp-users mailing list