Commit graph

424 commits

Author SHA1 Message Date
Sami Kerola
45f7fc1514
release: 3.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-31 20:20:10 +01:00
Sami Kerola
ec613f762d
output: update javascripts
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-31 20:17:08 +01:00
Sami Kerola
e48768b041
build-sys: update bootstrap from gnulib
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-31 20:14:34 +01:00
Sami Kerola
544e7ec0a5
output: add ethernet address priting support to --mustach
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-10-26 22:23:19 +01:00
Sami Kerola
b96c6c14d2
misc: fix spelling issues
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-09-12 22:29:44 +01:00
Sami Kerola
21194d2e4a
samples: make prometheus template less klunky
This should work nicer when displaying various statistics from prometheus
with grafana.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-27 22:53:42 +01:00
Sami Kerola
fb518b7a19
output: add warning and critical threshold counts to mustach
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-27 22:20:44 +01:00
Sami Kerola
707eafa670
build-sys: update .gitignore files
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-07-27 21:17:45 +01:00
Mark Sangster
07b4eaa480
output: fix warn and crit counts on shared networks
The crit/warn_count is tested against used rather than free.  It is only for
shared networks, the range correctly subtracts count from size to get its
free.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-04-15 19:34:28 +01:00
Sami Kerola
17d68b7e3e
various: tidy up variable scopes, and one name mismatch
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-03-26 21:26:51 +00:00
Sami Kerola
4f64902a9e
mustach: sync with most recent mustach upstream changes
Git: https://gitlab.com/jobol/mustach.git
Commit: 3a694bdc6cdd374358a30949206e315ed3428cf9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-03-26 21:00:40 +00:00
Sami Kerola
008e9f17c1
other: use IP string lengths from netinet/in.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-03-23 22:19:13 +00:00
Sami Kerola
71714a0993
warnings: ensure optimal packing in structures
Add padding where needed and order structure when it makes alignment fall
naturally to better order, with a single padding at the end of structure.

Reference: http://www.catb.org/esr/structure-packing/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-02-17 11:43:02 +00:00
Sami Kerola
6f6369f517
various: fix few warnings
-Wmissing-variable-declarations -Wunreachable-code-break and -Wshadow.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-02-09 17:43:16 +00:00
Sami Kerola
8731c6a11f
fix typos
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-01-14 22:59:13 +00:00
Sami Kerola
d29b498cae
lib: update .gitignore
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-01-04 22:44:11 +00:00
Sami Kerola
48e46e8698
other: use strftime() to generate date-time string
It is better to use library function to create date-time string than sprintf
various struct tm members.  In same go retire time() call that is obsoleted
by clock_gettime().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-01-04 22:44:07 +00:00
Sami Kerola
4befdeeb47
getdata: remote dead code
These few lines has been part of code without any point in releases 2.17 to
3.0 and six and half years.  Oops.

Reference: ae7747db87
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-10-26 22:01:26 +01:00
Sami Kerola
9727bb28b9
drop images, java scripts, and such from web sitemap file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-08-26 09:32:15 +01:00
Sami Kerola
5027b50ade
sort: ensure NaN will not trip over comp_double()
In unlikely event of NaN being compared avoid exception.  If NaN appears in
input data it will be evaluated as equal with any value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-07-23 21:41:59 +01:00
Sami Kerola
27c70a0efe
fix switch missing default case warnings
src/other.c:387:3: warning: switch missing default case [-Wswitch-default]

The one in do_counting() should be unreachable, so add abort() call to it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-07-23 21:33:45 +01:00
Sami Kerola
7fe686b417
webpages: use html sample output
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-20 15:54:58 +01:00
Sami Kerola
3f85360c64
main: move output_format to state, and rename color_format
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-20 12:03:07 +01:00
Sami Kerola
e8e9d49ebb
main: move print_mac_addreses to state structure
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-20 11:47:30 +01:00
Sami Kerola
4e7ab66fd4
fix typo
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-15 21:31:52 +01:00
Sami Kerola
b568725e7d
main: simplify option parsing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-15 21:16:38 +01:00
Sami Kerola
a192f51545
output: fix implicit conversion
src/output.c:731:38: warning: implicit conversion from ‘float’ to ‘double’
when passing argument to function [-Wdouble-promotion]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-04 22:22:02 +01:00
Sami Kerola
679d63dd9f
add .mailmap
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-02-24 11:48:02 +00:00
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
447241e6c3
tests: improve coverage
Add error condition checks.  Add lease file binding states.  Check all
output formats.  Check leases file that is in mad order, cse all sorting
methods when checking this.  Use json output to check status classfications.
Add cidr range checks.  Add conf include and comment parsing input checks.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-26 15:14:49 +00:00
Sami Kerola
2849dde21b
build-sys: add coverage files to .gitignore
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-26 13:59:17 +00:00
Sami Kerola
813e320b68
webpage: add instructions how to get output you need
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-15 20:09:52 +00:00
Sami Kerola
e6e90b4d62
release: 3.0
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-15 13:29:46 +00:00
Sami Kerola
a1d2bd2cf7
usage: --skip=ignored is actually 'suppressed'
When making --skip to take arguments ignored was for moment a work name for
'suppressed' state, and that was accidentally left to usage() output.

Reference: 3369278fc0
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 22:30:07 +00:00
Sami Kerola
46ec42182b
output: add some trivia data to json output
These are software version, dhcpd conf and leases paths and mtime epoch
timestamps.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 20:24:15 +00:00
Sami Kerola
444815f964
orther: fix xstrstr_init() memcmp() return value usage
This is a bug.  The xstrstr_init initialized wrong IP version functions when
this function was the first to run and set function pointers.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 18:58:11 +00:00
Sami Kerola
6d737a7607
output: unify time stamp creations
Use iso time stamp in both mustach and html outputs.  Effectively this is a
removal of libc langinfo D_T_FMT format, that pulled a lot of gnulib stuff
to project almost unnecessarily.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 11:08:46 +00:00
Sami Kerola
ff3d9523e6
output: add more items to mustach tags
Base level printing; localstime, number of ranges and shared networks,
project version, and file paths and time stamps.

Also print error and stop template processing when unknown tag is
encountered.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 10:48:52 +00:00
Sami Kerola
d24313d25a
output: remove unused variable attribute
The closure is used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 00:17:56 +00:00
Sami Kerola
c687f38ed6
docs: improve doxygen documentation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-14 00:11:46 +00:00
Sami Kerola
887845df2a
misc: move couple enums from global scope to file scope
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 21:55:14 +00:00
Sami Kerola
74b697321f
misc: move command line option parsing to separate function
Earlier main() had lots of temporary variables related to command line
parsing.  By moving these to separate function runtime can forget these
variables when moving on.  If nothing else this makes running gdb nicer when
debugging crashes, but as said stack memory should also be spared for better
purpose.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 21:52:03 +00:00
Sami Kerola
3369278fc0
output: make --skip to take arguments what will be skipped
Accidental typo in usage() caused realisation making skipping to fully
controllable is good idea.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 20:23:12 +00:00
Sami Kerola
e4f7259cf6
samples: add prometheus text file collector mustach template
Because prometheus needs timestamp information add that to mustach, and
update manual page what tags are available.

Reference: https://prometheus.io/docs/instrumenting/exposition_formats/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 14:18:05 +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
8fba5c5e6b
clean up: fix couple compiler warnings
src/sort.c:255:5: warning: no previous prototype for 'merge'
src/sort.c:290:2: warning: ISO C90 forbids mixed declarations and code
src/mustach-dhcpd-pools.c:67:5: warning: no previous prototype for 'must_put_err'
src/output.c:109:26: warning: comparing floating point with == or != is unsafe (x5)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 11:37:18 +00:00
Sami Kerola
88a3f1eb53
hash: include stdlib.h to avoid implicit declarations
Reported-by: Frank Bulk <fbulk@mypremieronline.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 11:37:15 +00:00
Sami Kerola
8ae5fbf489
output: improve html table
Update DataTables and Bootstrap versions.  Add free IP counts to table.
Replace yellow as warning with magenta that is easier to read from white
background.  Use italic and bold to emphasis warning and critical.  Remove
strips.  Use ascent percent sort by default.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 10:16:34 +00:00
Sami Kerola
b2c764924b
output: shared net can be in suppressed state
Avoid calling abort() when this very unlikely situation happens.

Reference: 48962004b8
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-13 09:57:22 +00:00
Sami Kerola
242c58f45e
output: display more entries in html table by default
And add 'All' to 'Show number of entries' menu.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-12 23:14:23 +00:00