NAME

dhcpd-pool - Monitor and report ISC dhcpd pool usage


SYNOPSIS

dhcpd-pool [-c|--config <configfile>] [-l|--leases <leasefile>] [-m|--munin [-p|--pool <poolID>] [-a|--append <string>]] [-n|--nagios] [-v|--verbose] [-h|--help]


DESCRIPTION

This script will report pool usage on a ISC dhcpd server. Does also work on failover pairs, since each node will have identical config (when it comes to subnets and pools) and a complete leases file. Configuration is done in the DHCP config file, but the script will report usage on pools without configuration. Details below.

The script can operate as a Nagios plugin, reporting pool usage above the treshold configured by the user. It can also act as a Munin plugin, creating one graph per pool and/or one graph with all pools.

dhcpd-pool uses a cache file (via Berkeley DB) to speed up runtime and decrease load impact on the DHCP server. The cache is updated if it is more than 5 minutes old.


OPTIONS

-c, --config

The ISC dhcpd config file. Normally /etc/dhcpd.conf, which is the default.

-l, --leases

The ISC dhcpd leases file. Default is /var/db/dhcpd.leases

-n, --nagios

Act as a Nagios plugin. Notification limits for each pool, as well as which pools will be monitored, is configured in the DHCP config file. Details below.

-m, --munin

Act as a Munin plugin. One can create one graph per pool, or create one graph with all pools. In case of the latter percentage usage is graphed instead of absolute usage, since many different pools in one graph usually don't make sense and is pretty useless.

-p, --pool

Pool ID. This option is only used when acting as a Munin plugin. The pool ID has the form subnet_mask_X where X is the pool number as found in the DHCP config file. Pools declared with ``pool'' starts on 1, while anonymous pools (without pool declaration) has number 0. Example: 129.240.202.0_23_1

-a, --append

This is the regular Munin option, i.e. ``config''. Other possibilities are ``suggest'' and ``autoconf''. This option does only make sense when the script is used as a Munin plugin.

-v, --verbose

Be more verbose. This option has only effect when the script is used in its default form, i.e. not Nagios or Munin. When this option is given, the IP range for each pool is printed out.

--cache-period

The default timeout (or TTL) for the cache, given in minutes. The default cache period is 5 minutes. You may want to increase this if you're polling less frequently than the default, in which case the cache has no effect.

-h, --help

Short help text.

--man

Display the man page.

--version

Display version information


CONFIGURATION

Configuration is done in the DHCP config file. For each pool you want to monitor, include a statement like this in the beginning of each pool scope:

# monitor: <warning> <critical> <Y|N> [name]

Note the comment sign. The limits configuration is a comment in the DHCP config, and is only recognized by this script.

The Y or N is simply a yes or no to monitoring. If monitoring is set to N, the Nagios plugin will ignore the pool.

The name is optional, but it's encouraged to set a proper name for each pool.

The warning and critical limits can each be given in three different forms. In the examples, if the pool holds 200 leases total, the limits are effectively identical.

Percentage

When a percent sign (%) follows the number, the limit is given in percent. E.g. if the limit is 80% and the pool range contains 200 leases, a notification will occur if the number of active leases is more than or equal to 160.

Example: # monitor: 80% 90% Y My pool

Absolute

When the limit is given as a positive integer, a notification will occur when the number of active leases is greater than or equal to the limit.

Example: # monitor: 160 180 Y My pool

Leases left

If a minus sign (-) precedes the number, a notification will occur if the number of free (not active) leases is less than or equal to the limit.

Example: # monitor: -40 -20 Y My pool

The limit configuration can be set in both the subnet scope and the pool scope. If set in the pool scope, that takes precedence for that particular pool. Setting the limits configuration per pool is recommended.


FILES

Cache file: /var/cache/dhcpd-pool/cache.db

DHCP config: /etc/dhcpd.conf

DHCP leases: /var/db/dhcpd.leases


SEE ALSO

Complete documentation: http://folk.uio.no/trondham/software/dhcpd-pool.html


AUTHOR

Trond H. Amundsen <t.h.amundsen@usit.uio.no>


BUGS

Probably.