Commit graph

31 commits

Author SHA1 Message Date
Sami Kerola
0fe89808ee
docs: fix peoples name in THANKS file to have correct characters
Unicode fixes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-01-14 18:35:15 +00:00
Sami Kerola
eabaa8adc2
thanks: add Troy D. Hanson to credits about uthash
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 11:53:21 +00:00
Sami Kerola
54cedc1001
output: include stdlib.h to avoid compilation error
The stdlib.h has EXIT_FAILURE and free(3).

Reported-by: Sebastián Cramatte <scramatte@nixus.es>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-11 14:29:00 +00:00
Sami Kerola
7d9a5b5561
output: add mustach templating support
Based on José Bollo's mustache C implementation.  This adaptation uses
project specific data structures to avoid overhead with json parsing.

Reference: https://gitlab.com/jobol/mustach.git
Commit: d84608a69033d38c81b8fcff0cb272e225dd5428
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-09 19:49:13 +00:00
Sami Kerola
bb0fa9adae
getdata: add cidr range support
This makes 'range6 123::/45' style cidr notation to be understood as address
range.  Earlier ranges that used cidr failed to parse completely.

Reported-by: Jeff Bailey <jeffrey.bailey@bt.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-09-17 00:03:06 +01:00
Boris Lytochkin
b9cff0d814
introduce -A arg: treat single subnets as shared-network with CIDR as their name
Current output makes some false-positives for situations when multiple
ranges are specified inside single network, for example:

subnet 10.0.0.0 netmask 255.255.254.0 {
	...
	range 10.0.0.1 10.0.0.254;
	range 10.0.1.1 10.0.1.253;
	...
}

An alert for range 10.0.0.1 - 10.0.0.254 will be raised even in situations
when range 10.0.1.1 - 10.0.1.253 is completely empty.  To cope with this
issue, an -A option is added to treat all single networks as shared-network.
This option changes output for both range and shared networks output if
specified.  Frankly saying, using network CIDR as network name is much more
sane for me than 'All Networks'.

Signed-off-by: Boris Lytochkin <lytboris@yandex-team.ru>
2017-07-15 17:26:15 +01:00
Sami Kerola
e9223a852c
contrib: Klaus Slott told about opensuse package
Add opensuse rpm as an example how to build one.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-10 13:12:34 +01:00
Manuel Hachtkemper
32e2d399a0
alarming: add additional performance data
Options -p or --perfdata (in alarming mode) now enable the output of
additional performance data, i.e.  used, touched and backup addresses per
subnet.

Signed-off-by: Manuel Hachtkemper <hacman@math.uni-bonn.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-31 22:34:27 +01:00
Sami Kerola
10b06d88f0
getdata: flip ranges if they are in greater smaller order
Apparently ISC dhcpd allows marking ranges in order from greater IP to
smaller.  In these cases first and last IPs are fliped, so that the rest of
the processing can be done without alterations.

Reported-by: Ivanov Ivan <mgfnv9@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-02-18 22:35:56 +00:00
Sami Kerola
c7917152d3
improve README file instructions
Proposed-by: Derrick Lin <d.lin@garvan.org.au>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 11:22:28 +00:00
Sami Kerola
535dfc4fc2
portability: Solaris 10 does not have err.h
Use error(3) function, that has gnulib portability fixes, instead of err(3)
and warn(3) family.

Reported-by: Anton Tkachev <antont@bk.ru>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-26 22:29:32 +00:00
Sami Kerola
d8aef85d01 man: fix character class change
Debian package lint found going back to roman mode was broken.

Reported-by: Martijn van Brummelen <martijn@brumit.nl>
Signed-off-by: Sami Kerola <kerolasa@cloudflare.com>
2015-09-05 13:15:19 +01:00
Sami Kerola
cf26e17fe7 add hint about configure options to README
Proposed-by: Tim Cantin <tcantin@wellesley.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-29 09:18:08 +01:00
Sami Kerola
0d6c61d437 add touched addresses counts to xml and json reports
For some reason missing information has been overlooked for years.
Perhaps there is aren't that many users who are interested of the touched
addresses.

Proposed-by: Aaron Paetznick <aaronp@critd.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-02 18:48:52 +01:00
Wolfgang Steudel
5519763ba9 alarming: include last shared network in alarming [off by one]
We have defined some shared networks with a couple of address ranges
and wanted to monitor the availability of free IP addresses in the
shared networks.  We were wondering why in some cases there was no
warning, although one shared network's usage was above the threshold.

We found the reason.  In output_alarming() the code was not skipping
"All networks", but missing the last shared network in the list.
Moving "shared_p++" to the beginning of the loop seems to solve the
bug.

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Wolfgang Steudel <wolfgang.steudel@tu-ilmenau.de>
2014-11-14 19:41:21 +00:00
Sami Kerola
affb3d70a3 thanks: add Fredrik Lysén & Conor McCarthy
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-11-08 21:01:21 +00:00
Sami Kerola
d70b08244f thanks: Dan Pritts
For good ideas how to improve alarming.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-12 20:01:20 +01:00
Sami Kerola
8dba1c749d gnulib: add gnulib modules
Some systems, such as freebsd, does not have program_invocation_short_name
available.  There are also problems finding AF_INET{,6} definitions.

CC: Peter Fraser <p_fraser@hotmail.com>
Reported-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-05-11 17:09:25 +01:00
Sami Kerola
805d353584 getdata: certain input files caused SIGSEGV
When dhcpd.conf file got to be parsed such way that IP version could not
be determined the dhcpd.lease file parsing resulted to SIGSEGV.

Reported-by: Joey D. <jobewan@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-21 14:30:21 +01:00
Sami Kerola
5ee1aca2b9 build-sys: add git-version-gen and test.sh to release package
Without this patch autoreconf, when done with release tarball, fails like
this:

$ autoreconf -f -i
sh: 1: build-aux/git-version-gen: not found
configure.ac:12: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.11/init.m4:26: AM_INIT_AUTOMAKE is expanded from...
configure.ac:12: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: /usr/bin/autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

Further down the road tests start to fail after autoreconf.

make[4]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[3]: *** No rule to make target `../tests/test.sh', needed by `check-local'.  Stop.
make[3]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian'

Which is a symptom of not having test.sh in distribution.

Reported-by: Helmut Grohne <h.grohne@cygnusnetworks.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 21:04:19 +01:00
Gilles Bouthenot
a302bc6829 output: add json format support
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Gilles Bouthenot <gilles.bouthenot@univ-fcomte.fr>
2012-12-04 21:30:09 +00:00
Sami Kerola
3e0faec144 release: 2.20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-25 18:25:56 +00:00
Sami Kerola
5a307703c9 Prepare release v2.18
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-13 22:51:22 +02:00
Enno Grper
ae7747db87 analyse: critical bug in the counting code
The problem is, that you simply count all lease occurrences in
dhcpd.leases, but only the last ones for each ip address are
valid.  The lease file is more like a logfile of what has been
done, than a real database.  To fix the counting issue, I'm using
a single hash (from uthash.h [1]) for the counting.  This way
only the last lease entry for each IP gets into my counting
structure.

When you remove the duplicates in prepare_data(), you don't have
the information anymore, if the active lease entry or the free
lease entry came last.  Simply deleting each ip from the touches
array, that is already in the leases array, gives you a big
chance to count wrong.  Another way of fixing this would be to
not only store the ips in your arrays, but a structure containing
the ip and a global lease entry counter.  Then you could delete
all entries except for the latest.

[1] http://uthash.sourceforge.net/

Reported-by: Huangy
Signed-off-by: Enno Grper <groepeen@cms.hu-berlin.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-02 19:57:45 +02:00
Sami Kerola
c5b12e4368 getdata: fix configuration parser bug
When { is wrote together with a word, such as

pool{
        range 10.0.0.100 100.0.0.200;
        range ..

the parser ignored first range, resulting it to disappear from analysis.

Reported-by: Robert Viou <robert.viou@ndsu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-02 10:13:33 +01:00
Sami Kerola
91f303055c docs: update thanks
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-14 09:51:45 +01:00
Sami Kerola
f2d86d9a83 dhcpd-pools.h: move string.h to include
Version 2.16 needs the patche to compile correctly and without
warnings (tested on NetBSD, Mac OS X and Debian/Ubuntu).

Signed-off-by: Adam Ciarcinski <adam@netbsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 09:21:47 +02:00
Sami Kerola
68c2d7b8cc THANKS: add Ahmed AL Dakhil
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 20:04:17 +02:00
Sami Kerola
441431eae8 thanks: list update
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 19:43:59 +02:00
Sami Kerola
eaa3ae9be3 README and THANKS files to support git
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-21 18:51:27 +01:00
Sami Kerola
74aef1c34e Import from release candidate 2.13.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-21 18:15:50 +01:00