* Remove redundant new line in multi-line outputs
* check_load: Fix missing brace in output
* check_load: rename function to properly indicate purpose
* check_load: show the correct amount of procs
* check_load: allow execution without parameters
---------
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
net-snmp uses the same pre processor name "USE_OPENSSL" as we do.
To avoid the conflict, this commit renames it on our side to
"MOPL_USE_OPENSSL".
"MOPL" (better "MoPl"?) stands for Monitoring Plugins.
The new output functionality was discussed in the context of
check_by_ssh, where it mostly adds more stuff which was seen as
not inherently usefull as a succesful check_by_ssh check
might as well be transparent.
* Implement simple output shortcut for ranges
If ranges start with zero (e.g. 0:10), the zero and the colon
can be left out.
This patch implements this by default, since some systems (icinga2)
do not fully implement the whole range format and this reduces errors
in the common case of just an upper border.
* switch check_disk perfdata back to used space
On OpenBSD's "stdio.h", stdin, stdout, and stderr are not directly
FILE*, but #defines. Thus, naming the output struct fields stdout and
stderr resulted in compiler errors, after replacing the #define.
a762189c5e/include/stdio.h (L75-L77)
Previously there was a space missing between perfdata from differen sub subchecks which irritated my monitoring system and caused it to interpet two data points as one.
This puts the space back in there.
This commit implements replacement functions for the previous
exec functions.
The replacements are implemented in a more "pure" style, the do no
longer receive pointer arguments which they will write to, but create
the pointers themselves and should therefore be easier to use,
since it is more obvious what goes in and what comes out.
Also a essentialy unused variable was removed with this.
This commit moves the state retention logic to check_snmp as it is only
used there and I do not want it to be used at all, so it doesn't get a
place in the lib.
Otherwise this adapts tests and fixes the rate computing in the
refactored version of check_snmp.
Also fixes some bugs detected with the tests
Refactor check_icmp:
- Far less global variables
- Proper IPv6/legacy IP dual stack functionality (allowed mixed v4/v6 hosts)
- Improved readability/understandability
- General cleanup
This commit removes the format parameter from the mp_check
object and creates a module global variable instead.
This prevents thread safe usage of different mp_check objects
which should likely not present a big problem for now.
The reason for this change is effectively the very same,
the format was lost if an exit was triggered by a signal
handler (timeout in this example).