Large quantity of data will be missing when snmptest.pl is used. The reason
is a sort in lexicographic order:
$ snmpwalk -v2c -c public localhost .1.3.6.1.4.1.2021.250.255 |head
iso.3.6.1.4.1.2021.250.255.2.1 = STRING: "10.4.52.1"
iso.3.6.1.4.1.2021.250.255.2.10 = STRING: "192.168.35.64"
iso.3.6.1.4.1.2021.250.255.2.100 = STRING: "192.168.196.1"
iso.3.6.1.4.1.2021.250.255.2.101 = STRING: "192.168.198.1"
iso.3.6.1.4.1.2021.250.255.2.102 = STRING: "192.168.209.225"
iso.3.6.1.4.1.2021.250.255.2.103 = STRING: "192.168.209.241"
SNMPGetNext after "root.2.1" should give "root.2.2". Thus, lots of
variables are missing.
The function is now dependant on a CPAN module NetSNMP::OID, (debian/ubuntu
package is called libsnmp-perl). This is probably not the most efficient
way to do it: walking the whole tree will be much slower.
Signed-off-by: Jean Benoit <jean@unistra.fr>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>