Compare commits

..

No commits in common. "master" and "v3.2" have entirely different histories.
master ... v3.2

27 changed files with 1392 additions and 2080 deletions

View file

@ -39,7 +39,7 @@ edit_cmd = sed \
$(PATHFILES): Makefile
@ rm -f $@ $@.tmp
$(AM_V_at) mkdir -p $$(dirname $@)
$(AM_V_at) mkdir -p $(dir $@)
$(AM_V_GEN) srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \
$(edit_cmd) $${srcdir}$@.in >$@.tmp

22
NEWS
View file

@ -7,28 +7,6 @@ Please send dhcpd-pools bug reports to kerolasa@iki.fi.
gpg: Signature is crated using RSA key ID 8ED396E37E38D471A00530D3A9553245FDE9B739.
Version 3.3
Belkacem Daheb (2):
add start, end and hostname printing support for xml and json
getdata output: add start, end and hostname printing support for xml and json
M. van Brummelen (1):
docs: fix manual page groff warning
Sami Kerola (9):
update project web page
website: use https
chore: update web links
getdata: only emit warning when config include file cannot be read
gnulib: update bootstrap and gitignore files
build-sys: quote subshell execution in the autotools file
build-sys: update bootstrap from gnulib
output: update html javascripts
release: 3.3
luisδμ (1):
fix: avoid generation of unvalid JSON in summary
Version 3.2
Jean Benoit (1):

4
README
View file

@ -28,7 +28,7 @@ Quick start.
Dependencies to other projects.
https://www.gnu.org/software/gnulib/
http://www.gnu.org/software/gnulib/
You can avoid repeated gnulib downloads by setting
GNULIB_SRCDIR environment variable. For example:
@ -39,7 +39,7 @@ Dependencies to other projects.
Assumign detached gnulib please remember to git pull the
latest updates before building dhcpd-pools.
https://troydhanson.github.io/uthash/
http://uthash.sourceforge.net/
See quick start.

3
THANKS
View file

@ -49,6 +49,3 @@ Mark Sangster
Brent Swingle
Mathieu Morier
Jean Benoit
Belkacem Daheb
Björn Lässig
Luisδμ

1621
bootstrap

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
# Bootstrap configuration. -*- sh -*-
# Bootstrap configuration.
# Copyright (C) 2006-2025 Free Software Foundation, Inc.
# Copyright (C) 2006-2022 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -6,7 +6,7 @@ AC_CONFIG_MACRO_DIRS([m4])
AC_INIT([dhcpd-pools],
[m4_esyscmd([build-aux/git-version-gen .tarball-version])],
[kerolasa@iki.fi],[],
[https://dhcpd-pools.sourceforge.net/])
[http://dhcpd-pools.sourceforge.net/])
PACKAGE_MAINTAINER="Sami Kerola"
AC_SUBST([PACKAGE_MAINTAINER])
AC_CONFIG_AUX_DIR([build-aux])

View file

@ -7,7 +7,7 @@ pkgver=0
pkgrel=1
pkgdesc="ISC dhcpd lease status utility"
arch=('i686' 'x86_64')
url=https://dhcpd-pools.sourceforge.net/
url=http://dhcpd-pools.sourceforge.net/
license=('BSD')
depends=('pacman')
makedepends=('uthash' 'git')

102
lib/.gitignore vendored
View file

@ -1,15 +1,11 @@
/alloca.h
/alloca.in.h
/arg-nonnull.h
/arpa/
/arpa_inet.c
/arpa/inet.h
/arpa_inet.in.h
/assert.in.h
/attribute.h
/basename-lgpl.c
/basename-lgpl.h
/c32is-impl.h
/c32isprint.c
/calloc.c
/c-ctype.c
/c-ctype.h
@ -26,11 +22,13 @@
/c-strcaseeq.h
/c-strcase.h
/c-strncasecmp.c
/dirname.h
/dirname-lgpl.c
/dosname.h
/dup2.c
/errno.in.h
/error.c
/error.h
/error.in.h
/exitfail.c
/exitfail.h
/fclose.c
@ -45,7 +43,6 @@
/flexmember.h
/float.c
/float+.h
/float.h
/float.in.h
/fopen.c
/fpending.c
@ -60,8 +57,6 @@
/ftell.c
/ftello.c
/getdtablesize.c
/getlocalename_l-unsafe.c
/getlocalename_l-unsafe.h
/getopt1.c
/getopt.c
/getopt-cdefs.in.h
@ -74,6 +69,8 @@
/getprogname.c
/getprogname.h
/gettext.h
/.gitignore~
/glthread/*
/hard-locale.c
/hard-locale.h
/ialloc.c
@ -81,7 +78,6 @@
/idx.h
/inet_pton.c
/intprops.h
/intprops-internal.h
/inttypes.h
/inttypes.in.h
/isnan.c
@ -93,60 +89,16 @@
/lc-charset-dispatch.h
/libc-config.h
/libdhcpd_pools.la
/libdhcpd_pools_la-arpa_inet.lo
/libdhcpd_pools_la-basename-lgpl.lo
/libdhcpd_pools_la-c32isprint.lo
/libdhcpd_pools_la-c-ctype.lo
/libdhcpd_pools_la-cloexec.lo
/libdhcpd_pools_la-closeout.lo
/libdhcpd_pools_la-close-stream.lo
/libdhcpd_pools_la-c-strcasecmp.lo
/libdhcpd_pools_la-exitfail.lo
/libdhcpd_pools_la-fclose.lo
/libdhcpd_pools_la-fcntl.lo
/libdhcpd_pools_la-fd-hook.lo
/libdhcpd_pools_la-fflush.lo
/libdhcpd_pools_la-float.lo
/libdhcpd_pools_la-fopen.lo
/libdhcpd_pools_la-fpurge.lo
/libdhcpd_pools_la-freading.lo
/libdhcpd_pools_la-fseek.lo
/libdhcpd_pools_la-fseeko.lo
/libdhcpd_pools_la-getprogname.lo
/libdhcpd_pools_la-hard-locale.lo
/libdhcpd_pools_la-ialloc.lo
/libdhcpd_pools_la-localcharset.lo
/libdhcpd_pools_la-malloca.lo
/libdhcpd_pools_la-math.lo
/libdhcpd_pools_la-mbrtoc32.lo
/libdhcpd_pools_la-mbrtowc.lo
/libdhcpd_pools_la-mbszero.lo
/libdhcpd_pools_la-mktime.lo
/libdhcpd_pools_la-nstrftime.lo
/libdhcpd_pools_la-progname.lo
/libdhcpd_pools_la-quotearg.lo
/libdhcpd_pools_la-reallocarray.lo
/libdhcpd_pools_la-realloc.lo
/libdhcpd_pools_la-setlocale_null.lo
/libdhcpd_pools_la-setlocale_null-unlocked.lo
/libdhcpd_pools_la-stat-time.lo
/libdhcpd_pools_la-stdlib.lo
/libdhcpd_pools_la-sys_socket.lo
/libdhcpd_pools_la-timegm.lo
/libdhcpd_pools_la-time_rz.lo
/libdhcpd_pools_la-unistd.lo
/libdhcpd_pools_la-wctype-h.lo
/libdhcpd_pools_la-xalloc-die.lo
/libdhcpd_pools_la-xmalloc.lo
/.libs/
/limits.h
/limits.in.h
/*.lo
/localcharset.c
/localcharset.h
/locale.h
/locale.in.h
/localename.h
/localename-unsafe.c
/localtime-buffer.c
/localtime-buffer.h
/lseek.c
/Makefile.am
/malloca.c
@ -155,12 +107,10 @@
/math.c
/math.h
/math.in.h
/mbrtoc32.c
/mbrtowc.c
/mbrtowc-impl.h
/mbrtowc-impl-utf8.h
/mbsinit.c
/mbszero.c
/mbtowc-lock.c
/mbtowc-lock.h
/memchr.c
@ -188,15 +138,13 @@
/setlocale-lock.c
/setlocale_null.c
/setlocale_null.h
/setlocale_null-unlocked.c
/stat.c
/stat-time.c
/stat-time.h
/stat-w32.c
/stat-w32.h
/stdckdint.h
/stdckdint.in.h
/stddef.h
/stdalign.in.h
/stdbool.in.h
/stddef.in.h
/stdint.in.h
/stdio.h
@ -204,7 +152,6 @@
/stdio.in.h
/stdio-read.c
/stdio-write.c
/stdlib.c
/stdlib.h
/stdlib.in.h
/stpncpy.c
@ -213,18 +160,21 @@
/strerror.c
/strerror-override.c
/strerror-override.h
/strftime.c
/strftime.h
/string.h
/string.in.h
/stripslash.c
/strstr.c
/strtod.c
/str-two-way.h
/sys/
/sys_socket.c
/sys/socket.h
/sys_socket.in.h
/sys/stat.h
/sys_stat.in.h
/sys/types.h
/sys_types.in.h
/sys/uio.h
/sys_uio.in.h
/timegm.c
/time.h
@ -233,21 +183,11 @@
/time_r.c
/time_rz.c
/tzset.c
/uchar.h
/uchar.in.h
/unictype/
/unictype/bitmap.h
/unictype/ctype_print.c
/unictype/ctype_print.h
/unictype/.gitignore
/unictype.h
/unictype.in.h
/unistd.c
/unistd.h
/unistd.in.h
/unitypes.h
/unitypes.in.h
/unsetenv.c
/unused-parameter.h
/verify.h
/warn-on-use.h
/wchar.h
@ -256,6 +196,14 @@
/wctype-h.c
/wctype.in.h
/windows-initguard.h
/windows-mutex.c
/windows-mutex.h
/windows-once.c
/windows-once.h
/windows-recmutex.c
/windows-recmutex.h
/windows-rwlock.c
/windows-rwlock.h
/xalloc-die.c
/xalloc.h
/xalloc-oversized.h

View file

@ -1,5 +1,4 @@
'\" t
.TH DHCPD-POOLS "1" "2024-08-09" "@VERSION@" "User Commands"
.TH DHCPD-POOLS "1" "2017-11-15" "@VERSION@" "User Commands"
.SH NAME
dhcpd-pools \- ISC dhcpd pools usage analysis
.SH SYNOPSIS

View file

@ -3,9 +3,9 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<Project rdf:about="https://dhcpd-pools.sourceforge.net/">
<Project rdf:about="http://dhcpd-pools.sourceforge.net/">
<name>dhcpd-pools</name>
<homepage rdf:resource="https://dhcpd-pools.sourceforge.net/" />
<homepage rdf:resource="http://dhcpd-pools.sourceforge.net/" />
<shortdesc>This is dhcpd-pools ISC dhcp shared network and pool
range usage analysis tool.</shortdesc>
<description>Purpose of command is to count usage ratio of each

View file

@ -102,9 +102,6 @@ enum prefix_t {
PREFIX_BINDING_STATE_ACTIVE,
PREFIX_BINDING_STATE_BACKUP,
PREFIX_HARDWARE_ETHERNET,
PREFIX_STARTS,
PREFIX_ENDS,
PREFIX_HOSTNAME,
NUM_OF_PREFIX
};
@ -183,9 +180,6 @@ struct leases_t {
char *ethernet;
UT_hash_handle hh;
enum ltype type;
char *ends;
char *starts;
char *hostname;
};
/*! \enum limbits

View file

@ -83,7 +83,7 @@ enum isc_conf_parser {
int parse_leases(struct conf_t *state)
{
FILE *dhcpd_leases;
char *line, *ipstring, macstring[20], *stop, endsstr[30], startsstr[30], hostnamestr[MAXLEN];
char *line, *ipstring, macstring[20], *stop;
union ipaddr_t addr;
struct leases_t *lease;
@ -100,9 +100,6 @@ int parse_leases(struct conf_t *state)
line[0] = '\0';
ipstring = xmalloc(sizeof(char) * MAXLEN);
ipstring[0] = '\0';
endsstr[0] = '\0';
startsstr[0] = '\0';
hostnamestr[0] = '\0';
while (!feof(dhcpd_leases)) {
if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases))
error(EXIT_FAILURE, errno, "parse_leases: %s", state->dhcpdlease_file);
@ -145,35 +142,8 @@ int parse_leases(struct conf_t *state)
break;
memcpy(macstring, line + 20, 17);
macstring[17] = '\0';
if ((lease = find_lease(state, &addr)) != NULL) {
if ((lease = find_lease(state, &addr)) != NULL)
lease->ethernet = xstrdup(macstring);
lease->starts = xstrdup(startsstr);
startsstr[0] = '\0';
lease->ends = xstrdup(endsstr);
endsstr[0] = '\0';
}
break;
case PREFIX_ENDS:
if (state->print_mac_addreses == 0)
break;
strncpy(endsstr, line + 7, sizeof(endsstr)-1);
endsstr[strlen(endsstr)-2] = '\0';
break;
case PREFIX_STARTS:
if (state->print_mac_addreses == 0)
break;
strncpy(startsstr, line + 9, sizeof(startsstr)-1);
startsstr[strlen(startsstr)-2] = '\0';
break;
case PREFIX_HOSTNAME:
if (state->print_mac_addreses == 0)
break;
strncpy(hostnamestr, line + 19, sizeof(hostnamestr)-1);
hostnamestr[strlen(hostnamestr)-3] = '\0';
if ((lease = find_lease(state, &addr)) != NULL) {
lease->hostname = xstrdup(hostnamestr);
}
hostnamestr[0] = '\0';
break;
default:
/* do nothing */ ;
@ -241,14 +211,8 @@ void parse_config(struct conf_t *state, const int is_include, const char *restri
shared_p->name = state->shared_net_root->name;
/* Open configuration file */
dhcpd_config = fopen(config_file, "r");
if (dhcpd_config == NULL) {
if (is_include) {
error(0, errno, "cannot open inlude: %s", config_file);
return;
}
/* config if from command line, just exit with error */
if (dhcpd_config == NULL)
error(EXIT_FAILURE, errno, "parse_config: %s", config_file);
}
#ifdef HAVE_POSIX_FADVISE
# ifdef POSIX_FADV_SEQUENTIAL
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0)

View file

@ -66,9 +66,6 @@ void add_lease_v4(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
l->type = type;
HASH_ADD_INT(state->leases, ip.v4, l);
l->ethernet = NULL;
l->ends = NULL;
l->starts = NULL;
l->hostname = NULL;
}
void add_lease_v6(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
@ -80,9 +77,6 @@ void add_lease_v6(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
l->type = type;
HASH_ADD_V6(state->leases, ip.v6, l);
l->ethernet = NULL;
l->ends = NULL;
l->starts = NULL;
l->hostname = NULL;
}
/*! \brief Find pointer to lease from hash array.
@ -116,9 +110,6 @@ struct leases_t *find_lease_v6(struct conf_t *state, union ipaddr_t *addr)
void delete_lease(struct conf_t *state, struct leases_t *lease)
{
free(lease->ethernet);
free(lease->ends);
free(lease->starts);
free(lease->hostname);
HASH_DEL(state->leases, lease);
free(lease);
}
@ -131,9 +122,6 @@ void delete_all_leases(struct conf_t *state)
HASH_ITER(hh, state->leases, l, tmp) {
free(l->ethernet);
free(l->ends);
free(l->starts);
free(l->hostname);
HASH_DEL(state->leases, l);
free(l);
}
@ -146,9 +134,6 @@ void delete_all_leases(struct conf_t *state)
l = state->leases;
free(l->ethernet);
free(l->ends);
free(l->starts);
free(l->hostname);
HASH_DEL(state->leases, l); /* leases advances to next on delete */
free(l);
}

View file

@ -8,7 +8,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@ -19,8 +19,6 @@
#define _GNU_SOURCE
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View file

@ -8,7 +8,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,

View file

@ -417,12 +417,6 @@ int
}
if (!memcmp("lease ", str, 6))
return PREFIX_LEASE;
else if (!memcmp(" starts ", str, 9))
return PREFIX_STARTS;
else if (!memcmp(" ends ", str, 7))
return PREFIX_ENDS;
else if (!memcmp(" client-hostname ", str, 18))
return PREFIX_HOSTNAME;
return NUM_OF_PREFIX;
}
@ -478,12 +472,6 @@ int
}
if (!memcmp(" iaaddr ", str, 9))
return PREFIX_LEASE;
else if (!memcmp(" starts ", str, 9))
return PREFIX_STARTS;
else if (!memcmp(" ends ", str, 7))
return PREFIX_ENDS;
else if (!memcmp(" client-hostname ", str, 18))
return PREFIX_HOSTNAME;
return NUM_OF_PREFIX;
}

View file

@ -387,19 +387,7 @@ static int output_xml(struct conf_t *state)
if (l->ethernet != NULL) {
fputs(l->ethernet, outfile);
}
fputs("</macaddress>\n\t<starts>", outfile);
if (l->starts != NULL) {
fputs(l->starts, outfile);
}
fputs("</starts>\n\t<ends>", outfile);
if (l->ends != NULL) {
fputs(l->ends, outfile);
}
fputs("</ends>\n\t<hostname>", outfile);
if (l->hostname != NULL) {
fputs(l->hostname, outfile);
}
fputs("</hostname>\n</active_lease>\n", outfile);
fputs("</macaddress>\n</active_lease>\n", outfile);
}
}
}
@ -493,18 +481,6 @@ static int output_json(struct conf_t *state)
if (l->ethernet != NULL) {
fputs(l->ethernet, outfile);
}
fputs("\", \"starts\":\"", outfile);
if (l->starts != NULL) {
fputs(l->starts, outfile);
}
fputs("\", \"ends\":\"", outfile);
if (l->ends != NULL) {
fputs(l->ends, outfile);
}
fputs("\", \"hostname\":\"", outfile);
if (l->hostname != NULL) {
fputs(l->hostname, outfile);
}
fputs("\" }", outfile);
}
}
@ -611,14 +587,8 @@ static int output_json(struct conf_t *state)
fprintf(outfile, " \"touched\":%g,\n", state->shared_net_root->touched);
fprintf(outfile, " \"free\":%g,\n",
state->shared_net_root->available - state->shared_net_root->used);
if (fpclassify(state->shared_net_root->available) == FP_ZERO)
fprintf(outfile, " \"percent\":\"%g\",\n", oh.percent);
else
fprintf(outfile, " \"percent\":%g,\n", oh.percent);
fprintf(outfile, " \"touch_count\":%g,\n", oh.tc);
if (fpclassify(state->shared_net_root->available) == FP_ZERO)
fprintf(outfile, " \"touch_percent\":\"%g\",\n", oh.tcp);
else
fprintf(outfile, " \"touch_percent\":%g,\n", oh.tcp);
if (state->backups_found == 1) {
fprintf(outfile, " \"backup_count\":%g,\n",
@ -658,8 +628,8 @@ static void html_header(struct conf_t *state, FILE *restrict f)
fprintf(f, "<meta charset=\"utf-8\">\n");
fprintf(f, "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n");
fprintf(f, "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
fprintf(f, "<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\" type=\"text/css\">\n");
fprintf(f, "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css\">\n");
fprintf(f, "<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css\" type=\"text/css\">\n");
fprintf(f, "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css\">\n");
fprintf(f, "<style type=\"text/css\">\n");
fprintf(f, "table.dhcpd-pools th { text-transform: capitalize }\n");
fprintf(f, "</style>\n");
@ -682,8 +652,8 @@ static void html_footer(FILE *restrict f)
fprintf(f, "<small>Generated using %s<br />\n", PACKAGE_STRING);
fprintf(f, "More info at <a href=\"%s\">%s</a>\n", PACKAGE_URL, PACKAGE_URL);
fprintf(f, "</small></div></div>\n");
fprintf(f, "<script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" src=\"https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js\"></script>\n");
fprintf(f, "<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" src=\"https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" class=\"init\">$(document).ready(function() { $('#s').DataTable({ \"iDisplayLength\": 50, \"lengthMenu\": [ [25, 50, 100, -1], [25, 50, 100, \"All\"] ], \"order\": [[ 4, \"desc\" ]] } ); } );</script>\n");
fprintf(f, "<script type=\"text/javascript\" class=\"init\">$(document).ready(function() { $('#r').DataTable({ \"iDisplayLength\": 100, \"lengthMenu\": [ [25, 50, 100, -1], [25, 50, 100, \"All\"] ], \"order\": [[ 6, \"desc\" ]] } ); } );</script>\n");
fprintf(f, "</body></html>\n");

View file

@ -7,16 +7,7 @@ dhcpd-pools: unknown color mode: 'sometimes'
=== IPv5
dhcpd-pools: unknown --ip-version argument: 5
=== missing conf
dhcpd-pools: cannot open inlude: ./tests/confs/complete_NXFILE: No such file or directory
Ranges:
shared net name first ip last ip max cur percent touch t+c t+c perc
Shared networks:
name max cur percent touch t+c t+c perc
Sum of all ranges:
name max cur percent touch t+c t+c perc
All networks 0 0 nan 0 0 nan
dhcpd-pools: parse_config: ./tests/confs/complete_NXFILE: No such file or directory
=== missing leases
dhcpd-pools: parse_leases: ./tests/leases/complete_NXFILE: No such file or directory
=== html table

View file

@ -23,8 +23,8 @@ All networks 100 43 43.000 0 43 43.000
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">
<style type="text/css">
table.dhcpd-pools th { text-transform: capitalize }
</style>
@ -176,10 +176,10 @@ table.dhcpd-pools th { text-transform: capitalize }
</tbody>
</table>
<br /><div class="well well-lg">
More info at <a href="https://dhcpd-pools.sourceforge.net/">https://dhcpd-pools.sourceforge.net/</a>
More info at <a href="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
</small></div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js"></script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#s').DataTable({ "iDisplayLength": 50, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 4, "desc" ]] } ); } );</script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#r').DataTable({ "iDisplayLength": 100, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 6, "desc" ]] } ); } );</script>
</body></html>

View file

@ -1,6 +1,6 @@
{
"active_leases": [
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00", "starts":"", "ends":"", "hostname":"" }
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00" }
],
"subnets": [
{ "location":"All networks", "range":"10.0.0.1 - 10.0.0.10", "first_ip":"10.0.0.1", "last_ip":"10.0.0.10", "defined":10, "used":1, "touched":0, "free":9, "percent":10, "touch_count":1, "touch_percent":10, "status":0 }

View file

@ -2,9 +2,6 @@
<active_lease>
<ip>10.0.0.5</ip>
<macaddress>00:00:00:00:00:00</macaddress>
<starts></starts>
<ends></ends>
<hostname></hostname>
</active_lease>
<subnet>
<location>All networks</location>

View file

@ -4,11 +4,12 @@
# analysis algorithm is sane. This script is no longer
# maintained, and can be considered as historic reference.
#
# Licensed under the Open Software License version 1.0
# https://opensource.org/license/osl-1-0/
# Licensed under the Open Software License version 1.1
# http://opensource.org/licenses/osl.php
#
# Sami Kerola <sami.kerola@teliasonera.com>
#
# Latest version is available from http://www.iki.fi/kerolasa/dhcp/
# This is version 1.4
BEGIN {

View file

@ -30,7 +30,7 @@ font-variant: normal;
</style>
</head>
<body>
<div itemscope itemtype="https://schema.org/SoftwareApplication">
<div itemscope itemtype="http://schema.org/SoftwareApplication">
<h1>ISC dhcpd lease analysis and reporting</h1>
<p>This is <span itemprop="name">dhcpd-pools</span>
<a href="https://www.isc.org/software/dhcp" itemprop="applicationSuite">ISC dhcp</a>
@ -49,18 +49,9 @@ any significant difference in getting analysis done.</p>
prompt&gt; ./dhcpd-pools --config=/etc/dhcpd.conf
--leases=/var/lib/dhcp/dhcpd.leases --format=H
--color=always --warning=40 --critical=50 --output=<a
href="https://dhcpd-pools.sourceforge.net/sampleoutput.html">sampleoutput.html</a>
href="http://dhcpd-pools.sourceforge.net/sampleoutput.html">sampleoutput.html</a>
</div>
<hr />
<h3>Is dhcpd-pools still developed?</h3>
<p>In short no, it is not.</p>
<p>
<a href="https://www.isc.org/blogs/isc-dhcp-eol/">ISC DHCPD has reached
EOL</a>. Users are Kea DHCP server instead. Kea has <a
href="https://kea.readthedocs.io/en/kea-2.2.0/arm/stats.html">native
statistics</a>, so it does not require this tool and therefore the
dhcpd-pools is obsolte.
</p>
<h3>Where I can get dhcpd-pools?</h3>
<p>Download
<a href="https://sourceforge.net/projects/dhcpd-pools/files/" itemprop="downloadUrl">release package</a>
@ -70,11 +61,11 @@ file.
<br /></p>
<div class="tt">git clone git://git.code.sf.net/p/dhcpd-pools/code dhcpd-pools</div>
<p>See also
<a href="https://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
<a href="http://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
<h3>Documentation</h3>
<p>The dhcpd-pools
<a href="https://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
<a href="https://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
<a href="http://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
<a href="http://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
reference documentation are available online.</p>
<h3>Getting the output you need</h3>
<ol>
@ -89,8 +80,8 @@ try:<br />
<li>Start filtering output. Options to try:<br />
<span style="font-family:monospace">--skip --limit</span></li>
<li>Change <span style="font-family:monospace">--format</span>
option to what you need, and maybe include <span style="font-family:monospace">
--perfdata</span> if you want nagios alarm
option to what you need, and maybe include <span style=
"font-family:monospace">--perfdata</span> if you want nagios alarm
format.</li>
<li>Done.</li>
</ol>
@ -99,33 +90,33 @@ format.</li>
<script type='text/javascript' src='https://www.openhub.net/p/dhcpd-pools/widgets/project_factoids_stats?format=js'></script>
</p>
<p>The program was written because
<a href="https://dhcpstatus.sourceforge.net/">DHCPStatus</a>,
<a href="https://freshmeat.net/projects/dhcpusestats/">DHCP Usage Statistics</a>,
<a href="https://www.omar.org/opensource/reportdhcp/">reportdhcp.pl</a>,
<a href="https://www.ofb.net/%7Ejheiss/lease_analyzer">lease_analyzer</a> and
<a href="https://www.net-track.ch/opensource/dhcpd-snmp/">dhcpd-snmp</a>
<a href="http://dhcpstatus.sourceforge.net/">DHCPStatus</a>,
<a href="http://freshmeat.net/projects/dhcpusestats/">DHCP Usage Statistics</a>,
<a href="http://www.omar.org/opensource/reportdhcp/">reportdhcp.pl</a>,
<a href="http://www.ofb.net/%7Ejheiss/lease_analyzer">lease_analyzer</a> and
<a href="http://www.net-track.ch/opensource/dhcpd-snmp/">dhcpd-snmp</a>
where too slow to handle huge number of leases. There is also difference in
printed details. The dhcpd-pools does not print quite as much information as
some other tools.</p>
<p>Notice that this utility is not the same as
<a href="https://folk.uio.no/trondham/software/dhcpd-pool.html">dhcpd-pool</a>
<a href="http://folk.uio.no/trondham/software/dhcpd-pool.html">dhcpd-pool</a>
that is maintained by Trond Hasle Amundsen.</p>
<p>Just for laugh, obsolete awk proof of concept (version 1.4)
<a href="https://dhcpd-pools.sourceforge.net/dhcpd-pools.awk">dhcpd-pools.awk</a></p>
<a href="http://dhcpd-pools.sourceforge.net/dhcpd-pools.awk">dhcpd-pools.awk</a></p>
<h3>Where to send questions, bug reports, code contributions...</h3>
<p><a href="https://kerolasa.iki.fi/" itemprop="copyrightHolder">Sami Kerola</a>
<p><a href="http://www.iki.fi/kerolasa/" itemprop="copyrightHolder">Sami Kerola</a>
&lt;<a href="mailto:kerolasa@iki.fi">kerolasa@iki.fi</a>&gt;</p>
<div style="visibility:hidden">
<span itemprop="datePublished" datetime="2006-03-13T00:00:00+0000">Mon Mar 13 00:00:00 GMT 2006</span>
<span itemprop="dateModified" datetime="2022-11-26T09:58:28+0000">Sat Nov 26 09:58:28 GMT 2022</span>
<span itemprop="dateModified" datetime="2017-11-15T12:47:30+0000">Wed Nov 15 12:47:30 GMT 2017</span>
<span itemprop="version">3.0</span>
<span itemprop="license">FreeBSD License</span>
<a href="https://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
<a href="http://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">0</span>
<meta itemprop="priceCurrency" content="EUR" />
</div>
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">5</span> (
<span itemprop="ratingCount">2</span> ratings )
</div>

View file

@ -1,3 +1,3 @@
Sitemap: https://dhcpd-pools.sourceforge.net/sitemap.txt
Sitemap: http://dhcpd-pools.sourceforge.net/sitemap.txt
User-agent: *
Disallow:

View file

@ -5,8 +5,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.css">
<style type="text/css">
table.dhcpd-pools th { text-transform: capitalize }
</style>
@ -14,7 +14,7 @@ table.dhcpd-pools th { text-transform: capitalize }
<body>
<div class="container">
<h2>ISC DHCPD status</h2>
<small>File tests/leases/formats was last modified at 2025-04-15T14:32:48+0100</small><hr />
<small>File samples/dhcpd.leases was last modified at 2017-11-11T23:59:04+0000</small><hr />
<h3>Sum of all</h3>
<table id="a" class="dhcpd-pools order-column table table-hover" summary="all">
<thead>
@ -27,6 +27,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -39,6 +41,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>43</td>
<td>43.000</td>
<td>2</td>
<td>43.000</td>
</tr>
</tbody>
</table>
@ -54,6 +58,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -66,6 +72,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>21</td>
<td>52.500</td>
<td>1</td>
<td>2.500</td>
</tr>
<tr>
<td>example2</td>
@ -76,6 +84,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>17</td>
<td>42.500</td>
<td>0</td>
<td>0.000</td>
</tr>
</tbody>
</table>
@ -93,6 +103,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -107,6 +119,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>11</td>
<td>55.000</td>
<td>1</td>
<td>5.000</td>
</tr>
<tr>
<td>example1</td>
@ -119,6 +133,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>10</td>
<td>50.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>example2</td>
@ -131,6 +147,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>8</td>
<td>40.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>example2</td>
@ -143,6 +161,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>9</td>
<td>45.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>All networks</td>
@ -155,15 +175,17 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>5</td>
<td>25.000</td>
<td>1</td>
<td>5.000</td>
</tr>
</tbody>
</table>
<br /><div class="well well-lg">
<small>Generated using dhcpd-pools 3.3<br />
More info at <a href="https://dhcpd-pools.sourceforge.net/">https://dhcpd-pools.sourceforge.net/</a>
<small>Generated using dhcpd-pools 3.0<br />
More info at <a href="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
</small></div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js"></script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#s').DataTable({ "iDisplayLength": 50, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 4, "desc" ]] } ); } );</script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#r').DataTable({ "iDisplayLength": 100, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 6, "desc" ]] } ); } );</script>
</body></html>

File diff suppressed because it is too large Load diff