mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
Compare commits
21 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1722d54103 | ||
|
|
1c413b0653 | ||
|
|
d020e4d09f | ||
|
|
f917d5b223 | ||
|
|
5b7ab28314 | ||
|
|
dc649e27cd | ||
|
|
7fc13c60e0 | ||
|
|
5ed6e7688f | ||
|
|
9c6336e5b6 | ||
|
|
d94654e100 | ||
|
|
dc1f0b9b76 | ||
|
|
3d37ac0a2d | ||
|
|
102d017ed5 | ||
|
|
501bc15b43 | ||
|
|
0c5b8301dd | ||
|
|
1d20604519 | ||
|
|
5126e63665 | ||
|
|
c7e0058994 | ||
|
|
2ecfc86a06 | ||
|
|
0f19d44c1d | ||
|
|
b005ce9a25 |
31 changed files with 2053 additions and 1281 deletions
|
|
@ -1,7 +1,6 @@
|
|||
## Makefile.am -- Process this file with automake to produce Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = gnu
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = \
|
||||
.version \
|
||||
|
|
@ -40,7 +39,7 @@ edit_cmd = sed \
|
|||
|
||||
$(PATHFILES): Makefile
|
||||
@ rm -f $@ $@.tmp
|
||||
$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
|
||||
$(AM_V_at) mkdir -p $$(dirname $@)
|
||||
$(AM_V_GEN) srcdir=''; \
|
||||
test -f ./$@.in || srcdir=$(srcdir)/; \
|
||||
$(edit_cmd) $${srcdir}$@.in >$@.tmp
|
||||
|
|
|
|||
34
NEWS
34
NEWS
|
|
@ -7,6 +7,40 @@ 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):
|
||||
contrib: snmptest.pl SNMPwalk can't access to all variables/wrong sort
|
||||
|
||||
Sami Kerola (5):
|
||||
contrib: point out where one can find zabbix template
|
||||
build-sys: update .gitignore files
|
||||
config: remove unnecessary padding
|
||||
build-sys: autotools and gnulib related updates
|
||||
build-sys: routine update
|
||||
release: 3.2
|
||||
|
||||
Version 3.1
|
||||
Mark Sangster (1):
|
||||
|
|
|
|||
4
README
4
README
|
|
@ -28,7 +28,7 @@ Quick start.
|
|||
|
||||
Dependencies to other projects.
|
||||
|
||||
http://www.gnu.org/software/gnulib/
|
||||
https://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.
|
||||
|
||||
http://uthash.sourceforge.net/
|
||||
https://troydhanson.github.io/uthash/
|
||||
|
||||
See quick start.
|
||||
|
||||
|
|
|
|||
5
THANKS
5
THANKS
|
|
@ -47,3 +47,8 @@ José Bollo
|
|||
Sebastián Cramatte
|
||||
Mark Sangster
|
||||
Brent Swingle
|
||||
Mathieu Morier
|
||||
Jean Benoit
|
||||
Belkacem Daheb
|
||||
Björn Lässig
|
||||
Luisδμ
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# Bootstrap configuration.
|
||||
# Bootstrap configuration. -*- sh -*-
|
||||
|
||||
# Copyright (C) 2006-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2025 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
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
|
|
@ -64,7 +64,7 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
|||
gettext_external=0
|
||||
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
|
||||
grep '^[ ]*AM_GNU_GETTEXT(\[external]' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
|
||||
if test $gettext_external = 1; then
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2012-12-31.23; # UTC
|
||||
scriptversion=2022-01-27.18; # UTC
|
||||
|
||||
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-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
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
|
|
@ -15,9 +15,9 @@ scriptversion=2012-12-31.23; # UTC
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
|
||||
# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
|
||||
# It may be run two ways:
|
||||
# - from a git repository in which the "git describe" command below
|
||||
# produces useful output (thus requiring at least one signed tag)
|
||||
|
|
@ -65,19 +65,21 @@ scriptversion=2012-12-31.23; # UTC
|
|||
# EXTRA_DIST = $(top_srcdir)/.version
|
||||
# BUILT_SOURCES = $(top_srcdir)/.version
|
||||
# $(top_srcdir)/.version:
|
||||
# echo $(VERSION) > $@-t && mv $@-t $@
|
||||
# echo '$(VERSION)' > $@-t
|
||||
# mv $@-t $@
|
||||
# dist-hook:
|
||||
# echo $(VERSION) > $(distdir)/.tarball-version
|
||||
# echo '$(VERSION)' > $(distdir)/.tarball-version
|
||||
|
||||
|
||||
me=$0
|
||||
|
||||
year=`expr "$scriptversion" : '\([^-]*\)'`
|
||||
version="git-version-gen $scriptversion
|
||||
|
||||
Copyright 2011 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING."
|
||||
Copyright (C) ${year} Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
usage="\
|
||||
Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
|
||||
|
|
@ -85,8 +87,9 @@ Print a version string.
|
|||
|
||||
Options:
|
||||
|
||||
--prefix prefix of git tags (default 'v')
|
||||
--fallback fallback version to use if \"git --version\" fails
|
||||
--prefix PREFIX prefix of git tags (default 'v')
|
||||
--fallback VERSION
|
||||
fallback version to use if \"git --version\" fails
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
|
@ -100,8 +103,8 @@ while test $# -gt 0; do
|
|||
case $1 in
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
--prefix) shift; prefix="$1";;
|
||||
--fallback) shift; fallback="$1";;
|
||||
--prefix) shift; prefix=${1?};;
|
||||
--fallback) shift; fallback=${1?};;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1'." >&2
|
||||
echo "$0: Try '--help' for more information." >&2
|
||||
|
|
@ -140,11 +143,9 @@ then
|
|||
v=`cat $tarball_version_file` || v=
|
||||
case $v in
|
||||
*$nl*) v= ;; # reject multi-line output
|
||||
[0-9]*) ;;
|
||||
*) v= ;;
|
||||
esac
|
||||
test "x$v" = x \
|
||||
&& echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
|
||||
&& echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
|
||||
fi
|
||||
|
||||
if test "x$v" != x
|
||||
|
|
@ -166,9 +167,10 @@ then
|
|||
# tag or the previous older version that did not?
|
||||
# Newer: v6.10-77-g0f8faeb
|
||||
# Older: v6.10-g0f8faeb
|
||||
case $v in
|
||||
*-*-*) : git describe is okay three part flavor ;;
|
||||
*-*)
|
||||
vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
|
||||
case $vprefix in
|
||||
*-*) : git describe is probably okay three part flavor ;;
|
||||
*)
|
||||
: git describe is older two part flavor
|
||||
# Recreate the number of commits and rewrite such that the
|
||||
# result is the same as if we were using the newer version
|
||||
|
|
@ -183,9 +185,9 @@ then
|
|||
;;
|
||||
esac
|
||||
|
||||
# Change the first '-' to a '.', so version-comparing tools work properly.
|
||||
# Remove the "g" in git describe's output string, to save a byte.
|
||||
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
|
||||
# Change the penultimate "-" to ".", for version-comparing tools.
|
||||
# Remove the "g" to save a byte.
|
||||
v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
|
||||
v_from_git=1
|
||||
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
|
||||
v=UNKNOWN
|
||||
|
|
@ -199,7 +201,7 @@ v=`echo "$v" |sed "s/^$prefix//"`
|
|||
# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
|
||||
# or if it came from .tarball-version.
|
||||
if test "x$v_from_git" != x; then
|
||||
# Don't declare a version "dirty" merely because a time stamp has changed.
|
||||
# Don't declare a version "dirty" merely because a timestamp has changed.
|
||||
git update-index --refresh > /dev/null 2>&1
|
||||
|
||||
dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
|
||||
|
|
@ -214,12 +216,12 @@ if test "x$v_from_git" != x; then
|
|||
fi
|
||||
|
||||
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
||||
echo "$v" | tr -d "$nl"
|
||||
printf %s "$v"
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
AC_INIT([dhcpd-pools],
|
||||
[m4_esyscmd([build-aux/git-version-gen .tarball-version])],
|
||||
[kerolasa@iki.fi],[],
|
||||
[http://dhcpd-pools.sourceforge.net/])
|
||||
[https://dhcpd-pools.sourceforge.net/])
|
||||
PACKAGE_MAINTAINER="Sami Kerola"
|
||||
AC_SUBST([PACKAGE_MAINTAINER])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ pkgver=0
|
|||
pkgrel=1
|
||||
pkgdesc="ISC dhcpd lease status utility"
|
||||
arch=('i686' 'x86_64')
|
||||
url=http://dhcpd-pools.sourceforge.net/
|
||||
url=https://dhcpd-pools.sourceforge.net/
|
||||
license=('BSD')
|
||||
depends=('pacman')
|
||||
makedepends=('uthash' 'git')
|
||||
|
|
|
|||
|
|
@ -23,9 +23,10 @@
|
|||
# you set $dbg to 1 then output will be generated in /tmp.
|
||||
|
||||
use strict;
|
||||
use NetSNMP::OID;
|
||||
|
||||
# Version info:
|
||||
my $SNMPver = "snmp1.0";
|
||||
my $SNMPver = "snmp1.1";
|
||||
my $DHCPver = "dhcp1.0";
|
||||
my $VERSION = "$SNMPver/$DHCPver";
|
||||
#
|
||||
|
|
@ -193,7 +194,7 @@ sub ParseDataFile () {
|
|||
}
|
||||
close IN;
|
||||
if ($dbg) {
|
||||
foreach (sort @validoidlist) { print DBG "ValidOID: $_\n"; }
|
||||
foreach (sort Oidcmp @validoidlist) { print DBG "ValidOID: $_\n"; }
|
||||
}
|
||||
|
||||
if ($dbg) {
|
||||
|
|
@ -370,7 +371,7 @@ sub GetData ($) {
|
|||
|
||||
@userquery = split (/\./, $userqueryoid);
|
||||
my $found = 0;
|
||||
foreach (sort @validoidlist) {
|
||||
foreach (sort Oidcmp @validoidlist) {
|
||||
$next = $_;
|
||||
print DBG "Comparing $userqueryoid vs. $_\n" if $dbg;
|
||||
@validoid = split (/\./, $_);
|
||||
|
|
@ -432,6 +433,12 @@ sub Pong {
|
|||
$line = 0;
|
||||
}
|
||||
|
||||
sub Oidcmp {
|
||||
my $oida = new NetSNMP::OID($a);
|
||||
my $oidb = new NetSNMP::OID($b);
|
||||
snmp_oid_compare($oida, $oidb);
|
||||
}
|
||||
|
||||
################################## START ##################################
|
||||
#
|
||||
# Main
|
||||
|
|
|
|||
4
contrib/zabbix.txt
Normal file
4
contrib/zabbix.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Zabbix 5 template, and instructions how to use it, can be found from
|
||||
Mathieu's repository.
|
||||
|
||||
https://github.com/mmorier86/dhcpd-pools-zabbix-template
|
||||
117
lib/.gitignore
vendored
117
lib/.gitignore
vendored
|
|
@ -1,13 +1,22 @@
|
|||
/alloca.h
|
||||
/alloca.in.h
|
||||
/arg-nonnull.h
|
||||
/arpa/inet.h
|
||||
/arpa/
|
||||
/arpa_inet.c
|
||||
/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
|
||||
/c++defs.h
|
||||
/cdefs.h
|
||||
/cloexec.c
|
||||
/cloexec.h
|
||||
/close.c
|
||||
/closeout.c
|
||||
/closeout.h
|
||||
|
|
@ -17,15 +26,15 @@
|
|||
/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
|
||||
/fcntl.c
|
||||
/fcntl.h
|
||||
/fcntl.in.h
|
||||
/fd-hook.c
|
||||
|
|
@ -36,6 +45,7 @@
|
|||
/flexmember.h
|
||||
/float.c
|
||||
/float+.h
|
||||
/float.h
|
||||
/float.in.h
|
||||
/fopen.c
|
||||
/fpending.c
|
||||
|
|
@ -43,11 +53,15 @@
|
|||
/fpurge.c
|
||||
/freading.c
|
||||
/freading.h
|
||||
/free.c
|
||||
/fseek.c
|
||||
/fseeko.c
|
||||
/fstat.c
|
||||
/ftell.c
|
||||
/ftello.c
|
||||
/getdtablesize.c
|
||||
/getlocalename_l-unsafe.c
|
||||
/getlocalename_l-unsafe.h
|
||||
/getopt1.c
|
||||
/getopt.c
|
||||
/getopt-cdefs.in.h
|
||||
|
|
@ -60,11 +74,14 @@
|
|||
/getprogname.c
|
||||
/getprogname.h
|
||||
/gettext.h
|
||||
/glthread/*
|
||||
/hard-locale.c
|
||||
/hard-locale.h
|
||||
/ialloc.c
|
||||
/ialloc.h
|
||||
/idx.h
|
||||
/inet_pton.c
|
||||
/intprops.h
|
||||
/intprops-internal.h
|
||||
/inttypes.h
|
||||
/inttypes.in.h
|
||||
/isnan.c
|
||||
|
|
@ -76,16 +93,60 @@
|
|||
/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
|
||||
/localtime-buffer.c
|
||||
/localtime-buffer.h
|
||||
/localename.h
|
||||
/localename-unsafe.c
|
||||
/lseek.c
|
||||
/Makefile.am
|
||||
/malloca.c
|
||||
|
|
@ -94,10 +155,12 @@
|
|||
/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
|
||||
|
|
@ -112,29 +175,36 @@
|
|||
/netinet_in.in.h
|
||||
/_Noreturn.h
|
||||
/nstrftime.c
|
||||
/open.c
|
||||
/pathmax.h
|
||||
/progname.c
|
||||
/progname.h
|
||||
/quotearg.c
|
||||
/quotearg.h
|
||||
/quote.h
|
||||
/reallocarray.c
|
||||
/realloc.c
|
||||
/setenv.c
|
||||
/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
|
||||
/stdalign.in.h
|
||||
/stdbool.in.h
|
||||
/stdckdint.h
|
||||
/stdckdint.in.h
|
||||
/stddef.h
|
||||
/stddef.in.h
|
||||
/stdint.in.h
|
||||
/stdio.h
|
||||
/stdio-impl.h
|
||||
/stdio.in.h
|
||||
/stdio-read.c
|
||||
/stdio-write.c
|
||||
/stdlib.c
|
||||
/stdlib.h
|
||||
/stdlib.in.h
|
||||
/stpncpy.c
|
||||
|
|
@ -143,21 +213,18 @@
|
|||
/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
|
||||
|
|
@ -166,11 +233,21 @@
|
|||
/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
|
||||
|
|
@ -179,14 +256,6 @@
|
|||
/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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
.TH DHCPD-POOLS "1" "2017-11-15" "@VERSION@" "User Commands"
|
||||
'\" t
|
||||
.TH DHCPD-POOLS "1" "2024-08-09" "@VERSION@" "User Commands"
|
||||
.SH NAME
|
||||
dhcpd-pools \- ISC dhcpd pools usage analysis
|
||||
.SH SYNOPSIS
|
||||
|
|
|
|||
|
|
@ -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="http://dhcpd-pools.sourceforge.net/">
|
||||
<Project rdf:about="https://dhcpd-pools.sourceforge.net/">
|
||||
<name>dhcpd-pools</name>
|
||||
<homepage rdf:resource="http://dhcpd-pools.sourceforge.net/" />
|
||||
<homepage rdf:resource="https://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
|
||||
|
|
|
|||
|
|
@ -343,8 +343,7 @@ int main(int argc, char **argv)
|
|||
.header_limit = 8,
|
||||
.ranges_size = 64,
|
||||
.ip_version = IPvUNKNOWN,
|
||||
.color_mode = color_auto,
|
||||
0
|
||||
.color_mode = color_auto
|
||||
};
|
||||
int ret_val;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,9 @@ enum prefix_t {
|
|||
PREFIX_BINDING_STATE_ACTIVE,
|
||||
PREFIX_BINDING_STATE_BACKUP,
|
||||
PREFIX_HARDWARE_ETHERNET,
|
||||
PREFIX_STARTS,
|
||||
PREFIX_ENDS,
|
||||
PREFIX_HOSTNAME,
|
||||
NUM_OF_PREFIX
|
||||
};
|
||||
|
||||
|
|
@ -127,7 +130,6 @@ struct shared_network_t {
|
|||
double backups;
|
||||
struct shared_network_t *next;
|
||||
int netmask;
|
||||
uint32_t pad;
|
||||
};
|
||||
|
||||
/*! \struct range_t
|
||||
|
|
@ -152,7 +154,6 @@ struct output_helper_t {
|
|||
double tcp;
|
||||
double bup;
|
||||
int status;
|
||||
uint32_t pad;
|
||||
};
|
||||
|
||||
/*! \struct status_counts_t
|
||||
|
|
@ -182,7 +183,9 @@ struct leases_t {
|
|||
char *ethernet;
|
||||
UT_hash_handle hh;
|
||||
enum ltype type;
|
||||
uint32_t pad;
|
||||
char *ends;
|
||||
char *starts;
|
||||
char *hostname;
|
||||
};
|
||||
|
||||
/*! \enum limbits
|
||||
|
|
@ -251,8 +254,7 @@ struct conf_t {
|
|||
skip_critical:1, /*!< Skip critical values from output. */
|
||||
skip_minsize:1, /*!< Skip alarming values that are below minsize from output. */
|
||||
skip_suppressed:1, /*!< Skip alarming values that are suppressed with --snet-alarms option, or they are shared networks without IP availability. */
|
||||
color_mode:2, /*!< Indicator if colors should be used in output. */
|
||||
pad_bits:4;
|
||||
color_mode:2; /*!< Indicator if colors should be used in output. */
|
||||
};
|
||||
|
||||
/* Function prototypes */
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ enum isc_conf_parser {
|
|||
int parse_leases(struct conf_t *state)
|
||||
{
|
||||
FILE *dhcpd_leases;
|
||||
char *line, *ipstring, macstring[20], *stop;
|
||||
char *line, *ipstring, macstring[20], *stop, endsstr[30], startsstr[30], hostnamestr[MAXLEN];
|
||||
union ipaddr_t addr;
|
||||
struct leases_t *lease;
|
||||
|
||||
|
|
@ -100,6 +100,9 @@ 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);
|
||||
|
|
@ -142,8 +145,35 @@ 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 */ ;
|
||||
|
|
@ -211,8 +241,14 @@ 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 (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 */
|
||||
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)
|
||||
|
|
|
|||
15
src/hash.c
15
src/hash.c
|
|
@ -66,6 +66,9 @@ 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)
|
||||
|
|
@ -77,6 +80,9 @@ 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.
|
||||
|
|
@ -110,6 +116,9 @@ 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);
|
||||
}
|
||||
|
|
@ -122,6 +131,9 @@ 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);
|
||||
}
|
||||
|
|
@ -134,6 +146,9 @@ 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
https://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,6 +19,8 @@
|
|||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
https://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,
|
||||
|
|
|
|||
12
src/other.c
12
src/other.c
|
|
@ -417,6 +417,12 @@ 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;
|
||||
}
|
||||
|
||||
|
|
@ -472,6 +478,12 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
40
src/output.c
40
src/output.c
|
|
@ -387,7 +387,19 @@ static int output_xml(struct conf_t *state)
|
|||
if (l->ethernet != NULL) {
|
||||
fputs(l->ethernet, outfile);
|
||||
}
|
||||
fputs("</macaddress>\n</active_lease>\n", 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -481,6 +493,18 @@ 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -587,8 +611,14 @@ 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",
|
||||
|
|
@ -628,8 +658,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://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\" type=\"text/css\">\n");
|
||||
fprintf(f, "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css\">\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, "<style type=\"text/css\">\n");
|
||||
fprintf(f, "table.dhcpd-pools th { text-transform: capitalize }\n");
|
||||
fprintf(f, "</style>\n");
|
||||
|
|
@ -652,8 +682,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://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 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 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");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,16 @@ dhcpd-pools: unknown color mode: 'sometimes'
|
|||
=== IPv5
|
||||
dhcpd-pools: unknown --ip-version argument: 5
|
||||
=== missing conf
|
||||
dhcpd-pools: parse_config: ./tests/confs/complete_NXFILE: No such file or directory
|
||||
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
|
||||
[1;34mAll networks 0 0 nan 0 0 nan[0m
|
||||
=== missing leases
|
||||
dhcpd-pools: parse_leases: ./tests/leases/complete_NXFILE: No such file or directory
|
||||
=== html table
|
||||
|
|
|
|||
|
|
@ -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://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
|
||||
<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">
|
||||
<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="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
|
||||
More info at <a href="https://dhcpd-pools.sourceforge.net/">https://dhcpd-pools.sourceforge.net/</a>
|
||||
</small></div></div>
|
||||
<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 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 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>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"active_leases": [
|
||||
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00" }
|
||||
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00", "starts":"", "ends":"", "hostname":"" }
|
||||
],
|
||||
"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 }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
<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>
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
# 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.1
|
||||
# http://opensource.org/licenses/osl.php
|
||||
# Licensed under the Open Software License version 1.0
|
||||
# https://opensource.org/license/osl-1-0/
|
||||
#
|
||||
# Sami Kerola <sami.kerola@teliasonera.com>
|
||||
#
|
||||
# Latest version is available from http://www.iki.fi/kerolasa/dhcp/
|
||||
# This is version 1.4
|
||||
|
||||
BEGIN {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ font-variant: normal;
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div itemscope itemtype="http://schema.org/SoftwareApplication">
|
||||
<div itemscope itemtype="https://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,9 +49,18 @@ any significant difference in getting analysis done.</p>
|
|||
prompt> ./dhcpd-pools --config=/etc/dhcpd.conf
|
||||
--leases=/var/lib/dhcp/dhcpd.leases --format=H
|
||||
--color=always --warning=40 --critical=50 --output=<a
|
||||
href="http://dhcpd-pools.sourceforge.net/sampleoutput.html">sampleoutput.html</a>
|
||||
href="https://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>
|
||||
|
|
@ -61,11 +70,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="http://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
|
||||
<a href="https://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
|
||||
<h3>Documentation</h3>
|
||||
<p>The dhcpd-pools
|
||||
<a href="http://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
|
||||
<a href="http://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
|
||||
<a href="https://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
|
||||
<a href="https://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
|
||||
reference documentation are available online.</p>
|
||||
<h3>Getting the output you need</h3>
|
||||
<ol>
|
||||
|
|
@ -80,8 +89,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>
|
||||
|
|
@ -90,33 +99,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="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>
|
||||
<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>
|
||||
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="http://folk.uio.no/trondham/software/dhcpd-pool.html">dhcpd-pool</a>
|
||||
<a href="https://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="http://dhcpd-pools.sourceforge.net/dhcpd-pools.awk">dhcpd-pools.awk</a></p>
|
||||
<a href="https://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="http://www.iki.fi/kerolasa/" itemprop="copyrightHolder">Sami Kerola</a>
|
||||
<p><a href="https://kerolasa.iki.fi/" itemprop="copyrightHolder">Sami Kerola</a>
|
||||
<<a href="mailto:kerolasa@iki.fi">kerolasa@iki.fi</a>></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="2017-11-15T12:47:30+0000">Wed Nov 15 12:47:30 GMT 2017</span>
|
||||
<span itemprop="dateModified" datetime="2022-11-26T09:58:28+0000">Sat Nov 26 09:58:28 GMT 2022</span>
|
||||
<span itemprop="version">3.0</span>
|
||||
<span itemprop="license">FreeBSD License</span>
|
||||
<a href="http://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
|
||||
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||
<a href="https://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
|
||||
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
|
||||
<span itemprop="price">0</span>
|
||||
<meta itemprop="priceCurrency" content="EUR" />
|
||||
</div>
|
||||
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
|
||||
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
|
||||
<span itemprop="ratingValue">5</span> (
|
||||
<span itemprop="ratingCount">2</span> ratings )
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Sitemap: http://dhcpd-pools.sourceforge.net/sitemap.txt
|
||||
Sitemap: https://dhcpd-pools.sourceforge.net/sitemap.txt
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
|
|||
|
|
@ -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://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">
|
||||
<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">
|
||||
<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 samples/dhcpd.leases was last modified at 2017-11-11T23:59:04+0000</small><hr />
|
||||
<small>File tests/leases/formats was last modified at 2025-04-15T14:32:48+0100</small><hr />
|
||||
<h3>Sum of all</h3>
|
||||
<table id="a" class="dhcpd-pools order-column table table-hover" summary="all">
|
||||
<thead>
|
||||
|
|
@ -27,8 +27,6 @@ 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>
|
||||
|
|
@ -41,8 +39,6 @@ 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>
|
||||
|
|
@ -58,8 +54,6 @@ 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>
|
||||
|
|
@ -72,8 +66,6 @@ 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>
|
||||
|
|
@ -84,8 +76,6 @@ 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>
|
||||
|
|
@ -103,8 +93,6 @@ 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>
|
||||
|
|
@ -119,8 +107,6 @@ 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>
|
||||
|
|
@ -133,8 +119,6 @@ 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>
|
||||
|
|
@ -147,8 +131,6 @@ 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>
|
||||
|
|
@ -161,8 +143,6 @@ 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>
|
||||
|
|
@ -175,17 +155,15 @@ 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.0<br />
|
||||
More info at <a href="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
|
||||
<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></div></div>
|
||||
<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 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 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>
|
||||
|
|
|
|||
1092
webpages/sitemap.txt
1092
webpages/sitemap.txt
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue