| •1 |
'\" t |
| 2 |
.TH DHCPD-POOLS "1" "2017-11-15" "@VERSION@" "User Commands" |
| 3 |
.SH NAME |
| 4 |
dhcpd-pools \- ISC dhcpd pools usage analysis |
| 5 |
.SH SYNOPSIS |
| 6 |
.SY dhcpd-pools |
| 7 |
.OP \-\-config file |
| 8 |
.OP \-\-leases file |
| 9 |
.OP \-\-sort nimcptTe |
| 10 |
.OP \-\-reverse |
| 11 |
.OP \-\-format tHcxXjJ |
| 12 |
.OP \-\-mustach template |
| 13 |
.OP \-\-output file |
| 14 |
.OP \-\-limit nr |
| 15 |
.OP \-\-color when |
| 16 |
.OP \-\-warning percent |
| 17 |
.OP \-\-critical percent |
| 18 |
.OP \-\-warn\-count number |
| 19 |
.OP \-\-crit\-count number |
| 20 |
.OP \-\-snet\-alarms |
| 21 |
.OP \-\-minsize size |
| 22 |
.OP \-\-perfdata |
| 23 |
.OP \-\-version |
| 24 |
.OP \-\-help |
| 25 |
.YS |
| 26 |
.SH DESCRIPTION |
| 27 |
The program analyses ISC dhcpd shared network and pool usage and outputs the |
| 28 |
results in a format selected by user. |
| 29 |
.SH OUTPUT FIELDS |
| 30 |
.TP |
| 31 |
.I "shared net name" |
| 32 |
Name of the shared-network for the range. |
| 33 |
.TP |
| 34 |
.I "first ip" |
| 35 |
First IP in lease pool range. |
| 36 |
.TP |
| 37 |
.I "last ip" |
| 38 |
Last IP in lease pool range. |
| 39 |
.TP |
| 40 |
.I "max" |
| 41 |
Number of IPs which exist in a pool, shared network or all together. |
| 42 |
.TP |
| 43 |
.I "cur" |
| 44 |
Number of leases currently in use. |
| 45 |
.TP |
| 46 |
.I "percent" |
| 47 |
Percent of IPs currently in use compared to max. |
| 48 |
.TP |
| 49 |
.I "touch" |
| 50 |
Number of IP's which appear in the lease file, but who's leases have expired. |
| 51 |
A touched IP is either expired or abandoned. The touched IP count is |
| 52 |
somewhat misleading when you try to determine if an IP pool is big enough; it |
| 53 |
is a better indicator of whether a pool is too large. |
| 54 |
.TP |
| 55 |
.I "t+c" |
| 56 |
The sum of Touched and Currently in-use leases. |
| 57 |
.TP |
| 58 |
.I "t+c perc" |
| 59 |
Percent of IPs either touched or currently in use, compared to max. |
| 60 |
.TP |
| 61 |
.I "bu" |
| 62 |
Failover pair can allocate these addresses. The count appears only if there |
| 63 |
is failover configuration. |
| 64 |
.TP |
| 65 |
.I "bu perc" |
| 66 |
Percent of addresses that failover pair can allocate. The percent appears |
| 67 |
only if there is failover configuration. |
| 68 |
.SH OPTIONS |
| 69 |
.TP |
| 70 |
\fB\-c\fR, \fB\-\-config\fR=\fIFILE\fR |
| 71 |
Path to the dhcpd.conf file. If the dhcpd.conf has include files they |
| 72 |
can be analysed separately, that can be useful when trying to understand |
| 73 |
or monitor subset of data. |
| 74 |
.TP |
| 75 |
\fB\-l\fR, \fB\-\-leases\fR=\fIFILE\fR |
| 76 |
Path to the dhcpd.leases file. |
| 77 |
.TP |
| 78 |
\fB\-s\fR, \fB\-\-sort\fR=\fI[nimcptTe]\fR |
| 79 |
Sort ranges by chosen fields as a sorting keys. Keys weight from left to |
| 80 |
right, i.e., if more weighting keys are equal next one is used. The IP |
| 81 |
field is default sort key. |
| 82 |
.TP |
| 83 |
\fB\-r\fR, \fB\-\-reverse\fR |
| 84 |
Sort results in reverse order. |
| 85 |
.TP |
| 86 |
\fB\-f\fR, \fB\-\-format\fR=\fI[tHcxXjJ]\fR |
| 87 |
Output format. |
| 88 |
Text |
| 89 |
.RI ( t ). |
| 90 |
Full-html |
| 91 |
.RI ( H ) |
| 92 |
page output. In html page critical and warning thresholds can be visualized |
| 93 |
with \-\-color=always option. The |
| 94 |
.RI ( c ) |
| 95 |
stands for comma-separated values. Output format xml |
| 96 |
.RI ( x ) |
| 97 |
is similar to the dhcpstatus Perl module output. The extended xml |
| 98 |
.RI ( X ) |
| 99 |
format will print ethernet address details. The |
| 100 |
.RI ( j ) |
| 101 |
will output in json format, which can be extended with |
| 102 |
.RI ( J ) |
| 103 |
to include ethernet address. |
| 104 |
.IP |
| 105 |
The default format is |
| 106 |
.IR @OUTPUT_FORMAT@ . |
| 107 |
.TP |
| 108 |
\fB\-\-mustach\fR=\fITEMPLATE\fR |
| 109 |
Output using mustach |
| 110 |
.I template |
| 111 |
file. This is useful when the native output formats controlled with |
| 112 |
.B \-\-format |
| 113 |
option do not provide what you need. See below example mustach template |
| 114 |
that is using all available {{tags}} to demonstrate what can be displayed |
| 115 |
and how. |
| 116 |
.IP |
| 117 |
@bindir@/dhcpd-pools --config @docdir@/dhcpd.conf --leases |
| 118 |
@docdir@/dhcpd.leases --mustach @docdir@/mustach.template |
| 119 |
.TP |
| 120 |
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR |
| 121 |
.I File |
| 122 |
where output is written. Default is stdout. |
| 123 |
.TP |
| 124 |
\fB\-L\fR, \fB\-\-limit\fR=\fINR\fR |
| 125 |
The |
| 126 |
.I NR |
| 127 |
will limit what will be printed. Syntax is similar to |
| 128 |
.IR chmod (1) |
| 129 |
permission string. The |
| 130 |
.I NR |
| 131 |
limit string uses two digits which vary between |
| 132 |
.IR 0 \ to \ 7 . |
| 133 |
The first digit determines which headers to display, and the second digit |
| 134 |
determines which numeric analysis tables to include in the output. The |
| 135 |
following values are "OR'd" together to create the desired output. The |
| 136 |
default is |
| 137 |
.IR @OUTPUT_LIMIT@ . |
| 138 |
.IP |
| 139 |
.TS |
| 140 |
tab(:); |
| 141 |
ll. |
| 142 |
0\fI1\fR:Print ranges |
| 143 |
0\fI2\fR:Print shared networks |
| 144 |
0\fI4\fR:Print total summary |
| 145 |
\fI1\fR0:Print range header |
| 146 |
\fI2\fR0:Print shared network header |
| 147 |
\fI4\fR0:Print total summary header |
| 148 |
.TE |
| 149 |
.IP |
| 150 |
The output limit for total summary has special meaning in |
| 151 |
.B \-\-warning |
| 152 |
and |
| 153 |
.B \-\-critical |
| 154 |
alarming context. When the alarming is in use, and total is not wanted |
| 155 |
to be seen then in the case of alarming returning success nothing is |
| 156 |
printed. |
| 157 |
.TP |
| 158 |
\fB\-\-color\fR=\fIwhen\fR |
| 159 |
Use yellow for warning, red for critical, green for suppressed by \-\-minsize |
| 160 |
and blue when \-\-snet\-alarms is the cause of suppression or shared network |
| 161 |
does not have any ranges. The |
| 162 |
.I when |
| 163 |
string can be |
| 164 |
.BR always , |
| 165 |
.BR never , |
| 166 |
or |
| 167 |
.BR auto . |
| 168 |
Default is auto, that uses colors when command is running in interactive |
| 169 |
terminal. With use of |
| 170 |
.B \-\-warning |
| 171 |
or |
| 172 |
.B \-\-critical |
| 173 |
coloring thresholds can be changed, but one must also use |
| 174 |
.B \-\-format=text |
| 175 |
to avoid turning on alarting mode. |
| 176 |
.TP |
| 177 |
\fB\-\-skip\fR=\fIwhen\fR |
| 178 |
The |
| 179 |
.I when |
| 180 |
can be one of the following: |
| 181 |
.IR ok , |
| 182 |
.IR warning , |
| 183 |
.IR critical , |
| 184 |
.IR minsize , |
| 185 |
or |
| 186 |
.IR suppressed . |
| 187 |
The skipping criteria is exact match with colors in \-\-color option. |
| 188 |
.TP |
| 189 |
\fB\-\-warning\fR=\fIpercent\fR |
| 190 |
Turn on alarm output format, and specify percentage number which will |
| 191 |
cause an alarm. If either a range or shared network will exceed |
| 192 |
warning level return value of the command is |
| 193 |
.BR 1 . |
| 194 |
If only range monitoring is needed one can use limit option for scoping, |
| 195 |
for example |
| 196 |
.IR \-L10 . |
| 197 |
To monitor shared network only the limit would be |
| 198 |
.IR \-L20 . |
| 199 |
If warning percentage is not specified it defaults to |
| 200 |
.BR @ALARM_WARN@ . |
| 201 |
The |
| 202 |
.I percent |
| 203 |
argument allows fractions, e.g., 88.8, to be used. |
| 204 |
.TP |
| 205 |
\fB\-\-critical\fR=\fIpercent\fR |
| 206 |
The option is similar to warning, with exception of return value which |
| 207 |
is |
| 208 |
.BR 2 . |
| 209 |
If critical percentage is not specified it defaults to |
| 210 |
.BR @ALARM_CRIT@ . |
| 211 |
.TP |
| 212 |
\fB\-\-warn\-count\fR=\fInumber\fR |
| 213 |
A |
| 214 |
.I number |
| 215 |
of free leases before alarm is raised. When specified both \-\-warning |
| 216 |
.I percent |
| 217 |
and count |
| 218 |
.I number |
| 219 |
are required to be exceeded in order to alarm criteria being fulfilled. |
| 220 |
.IP |
| 221 |
This option is intended to be used in setup where very large and small |
| 222 |
shared-networks and ranges co-exists. In such environments percent based |
| 223 |
alarming can lead to either flood of alarms about small ranges, or way too |
| 224 |
great overhead of free addresses in large shared-networks. Suggested usage |
| 225 |
is to set percentage to a level that makes small ranges to ring, and set the |
| 226 |
count to match level when an enormous shared-network is too few free leases. |
| 227 |
.IP |
| 228 |
Defaults to 2^32, that is size of entire IPv4 address space. |
| 229 |
.TP |
| 230 |
\fB\-\-crit\-count\fR=\fInumber\fR |
| 231 |
Same as \-\-warn\-count, but for critical alarms. |
| 232 |
.TP |
| 233 |
\fB\-\-snet\-alarms |
| 234 |
Suppress range alarms that are part of shared networks. Use of this option |
| 235 |
will keep alarm criteria applied to ranges that are not part of shared-net |
| 236 |
along with shared-net alarms. This option may help reducing alarm noise for |
| 237 |
configurations that has lots of small ranges in big shared-networks. |
| 238 |
.TP |
| 239 |
\fB\-\-minsize\fR=\fIsize\fR |
| 240 |
Ignore ranges and shared networks that are smaller or equal to the |
| 241 |
defined size. This option is meaningful only in context of alarming, and |
| 242 |
will intended to suppress for example single host ranges. By default this |
| 243 |
option is not in use. |
| 244 |
.TP |
| 245 |
\fB\-p\fR, \fB\-\-perfdata\fR |
| 246 |
Print additional performance data, like lease count, touched leases and |
| 247 |
backup leases. This option is meaningful only in context of alarming and |
| 248 |
will print lots of data, if there are many networks. By default this option |
| 249 |
is not in use. |
| 250 |
.TP |
| 251 |
\fB\-A\fR, \fB\-\-all\-as\-shared\fR |
| 252 |
Treat all stand-alone subnets as shared-network with named formed from it's |
| 253 |
CIDR. By default this option is not in use for backwards compatibility. |
| 254 |
.TP |
| 255 |
\fB\-\-ip\-version\fR=\fI4|6\fR |
| 256 |
Force command to read configuration and leases files in IPv4 or IPv6 mode. |
| 257 |
Notice that when inputs do not match with what is forced analysis output is |
| 258 |
garbage. This option should not be necessary to use, and exists only to |
| 259 |
allow debugging. |
| 260 |
.TP |
| 261 |
\fB\-v\fR, \fB\-\-version\fR |
| 262 |
Print version information to standard output and exit successfully. |
| 263 |
.TP |
| 264 |
\fB\-h\fR, \fB\-\-help\fR |
| 265 |
Print help to standard output and exit successfully. |
| 266 |
.SH EXAMPLES |
| 267 |
.TP |
| 268 |
Print ranges header, and analysis. |
| 269 |
$ dhcpd-pools \-L 11 \-c dhcpd.conf \-l dhcpd.leases |
| 270 |
.br |
| 271 |
Ranges: |
| 272 |
.br |
| 273 |
shared net name [...] |
| 274 |
.TP |
| 275 |
Print shared networks and totals, both headers and results |
| 276 |
$ dhcpd-pools \-L 66 \-c dhcpd.conf \-l dhcpd.leases shared net name |
| 277 |
.br |
| 278 |
[...] |
| 279 |
.TP |
| 280 |
Alarming |
| 281 |
$ dhcpd-pools \-c dhcpd.conf \-l dhcpd.leases \-\-critical 80.1 \-\-warning 75 |
| 282 |
.br |
| 283 |
CRITICAL: dhcpd-pools: Ranges; crit: 14 warn: 22 ok: 220 Shared nets; crit: 1 warn: 0 ok: 4 |
| 284 |
.IP |
| 285 |
$ dhcpd-pools \-c dhcpd.conf \-l dhcpd.leases \-L 22 \-\-critical 70 \-\-warning 50 |
| 286 |
.br |
| 287 |
[no-output] |
| 288 |
.br |
| 289 |
Suppress printing OK, and make alarm only to go off if shared networks |
| 290 |
exceed critial or warning levels. |
| 291 |
.SH FILES |
| 292 |
.TP |
| 293 |
@DHCPDCONF_FILE@ |
| 294 |
ISC dhcpd configuration file. |
| 295 |
.TP |
| 296 |
@DHCPDLEASE_FILE@ |
| 297 |
ISC dhcpd lease file. |
| 298 |
.TP |
| 299 |
@docdir@/prometheus.template |
| 300 |
Prometheus text file collector mustach template. |
| 301 |
.SH AUTHORS |
| 302 |
Original design by Sami Kerola. |
| 303 |
.br |
| 304 |
uthash by Troy D. Hanson. |
| 305 |
.br |
| 306 |
XML support by Dominic Germain, Sogetel inc. |
| 307 |
.br |
| 308 |
IPv6 support by Cheer Xiao. |
| 309 |
.br |
| 310 |
Mustache templating support by José Bollo. |
| 311 |
.SH LICENSE |
| 312 |
The dhcpd-pools uses FreeBSD License, uthash uses BSD license, the mustache |
| 313 |
uses Apache License, and the gnulib modules are mostly, but not entirely, |
| 314 |
GPL. |
| 315 |
.SH "REPORTING BUGS" |
| 316 |
Report bugs to |
| 317 |
.MT @PACKAGE_BUGREPORT@ |
| 318 |
@PACKAGE_MAINTAINER@ |
| 319 |
.ME |
| 320 |
.br |
| 321 |
.UR @PACKAGE_URL@ |
| 322 |
Home page |
| 323 |
.UE |
| 324 |
.SH "SEE ALSO" |
| 325 |
.BR dhcpd.leases (5), |
| 326 |
.BR dhcpd.conf (5), |
| 327 |
.BR chmod (1), |
| 328 |
.UR https://mustache.github.io/ |
| 329 |
.UE |