aboutsummaryrefslogtreecommitdiff
path: root/plugins
AgeCommit message (Collapse)Author
2014-06-28Merge pull request #1263 from waja/coverity_fixesGravatar Sven Nierlein
Serveral coverity fixes from nagios-plugins
2014-06-28tests: added check_dns performance data testGravatar Sven Nierlein
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-06-28check_dns.c Added a bit more logic to thresholdsGravatar abrist
Added two if elses to cover when only one threshold is set.
2014-06-28check_dns: add warning and critical thresholds to perfdataGravatar Jean-Claude Computing
2014-06-28plugins/negate.c - Function should not return.Gravatar Spenser Reinhardt
Coverity 66479 - validate_arguments has no need to return anything, as it dies on error, yet was set to return an int. Set to void to resolve warning.
2014-06-28plugins/negate.c - Reorder if statement, aiobGravatar Spenser Reinhardt
Coverity 66480 - Potential array index out of bounds, since result was not verified to be positive prior to using as an index for state[]. Simply reording the if statement should resolve the issue. - SR
2014-06-28plugins/check_http.c - leakage fixGravatar Spenser Reinhardt
Coverity 66514 - Possible leakage and overflow with addr in redirect functionality. Not confirmed as null terminated, and externally gathered. Restrict string comparisons and duplications by size. - SR
2014-06-28plugins/check_ntp.c - Verify struct from responseGravatar Spenser Reinhardt
Coverity 66524 - req.data is not neccessarily null terminated but still feed to printf statements. This both does that, and verifies the struct more so than before. - SR
2014-06-28plugins/check_real.c - recv string null terminateGravatar Spenser Reinhardt
Recv into buffer is not properly null terminated prior to strstr and possible other string functions expecting a null termination. Simply take bytes received and use as an index to append \0 after. We are creating buffer[] with size of MAX_INPUT_BUFFER and recv with MAX_INPUT_BUFFER-1 so this should never overflow.
2014-06-28plugins/check_apt.c - Print uninitialized eregGravatar Spenser Reinhardt
Coverity 66531 - ereg.buffer can be printed without being initialized if do_include and do_exclude are null and critical is an invalid regex. While minor this may leak memory and cause undefined behavior.
2014-06-24tests: always build and test on travisGravatar Sven Nierlein
also make test is now working on travis-ci Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-06-23check_ide_smart: Fixing spelling bugGravatar Jan Wagner
2014-06-23check_mrtg: Fixing spelling bugGravatar Jan Wagner
2014-06-23check_ups/check_dbi: Fixing spelling bugGravatar Jan Wagner
2014-06-22check_radius.c: Add newline to die() callsGravatar Holger Weiss
Our die() function doesn't append a newline character to the message.
2014-06-22check_radius: Support FreeRADIUS Client libraryGravatar Holger Weiss
Allow for using the FreeRADIUS Client library instead of radiusclient or radiusclient-ng. The latter two projects are dead. Closes #1231.
2014-06-18plugins/runcmd.c: Remove superfluous newlineGravatar Holger Weiss
The puts(3) function already appends a newline character to the string.
2014-06-13tests: freebsds snmpd does not use quotesGravatar Sven Nierlein
when returning syscontact. So make them optional since we want to test check_snmp and not the snmpd. Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13tests: check_proc tests fail if uid -2 does not map to nobodyGravatar Sven Nierlein
so make sure our tests only run if -2 maps to nobody Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13tests: fping checks require being root or setuid rootGravatar Sven Nierlein
on the fping binary. Check this before running the test. Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13require at least HTTP::Daemon 6.01Gravatar Sven Nierlein
since the test uses send_header from HTTP::Daemon::ClientConn which has been introduced in HTTP::Daemon 6.01
2014-06-12tests: testCmd has own timeout which overwrites local oneGravatar Sven Nierlein
so add configurable/optional timeout to testCmd. Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-12tests: parts of the check_procs test only work when uid -2 existsGravatar Sven Nierlein
skip those tests if the uid does not exist Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-12Fix compilation with GnuTLSGravatar Holger Weiss
GnuTLS doesn't provide a SSL_CTX_check_private_key() function. Closes #1254.
2014-04-27Make check_disk work on Windows.Gravatar Gunnar Beutner
2014-04-27Make check_users work on Windows.Gravatar Gunnar Beutner
2014-04-27Make check_ping work on Windows.Gravatar Gunnar Beutner
2014-04-24check_snmp: Handle SNMPv3 noAuthNoPriv properlyGravatar Anton Lofgren
The SNMPv3 noAuthNoPriv security level, somewhat unintuitively, requires a security name to be passed along together with the request. Check_snmp previously did not do this, causing snmpget to throw an error: "External command error: No log handling enabled - turning on stderr logging snmpget: No securityName specified" This patch fixes the issue by always providing the security name when noAuthNoPriv is specified. See also: https:://bugs.op5.com/view.php?id=8385. Signed-off-by: Anton Lofgren <alofgren@op5.com>
2014-04-04Remove the suggestion to run check_apt with --verbose since it doesn't do ↵Gravatar Sam Kottler
anything
2014-04-04check_nt: add UPTIME to perfdata [sf#3434647]Gravatar Jan Wagner
2014-04-03Fix check_mysql.c client options from fileGravatar awiddersheim
If you don't specify a group or a file to read data from the plugin tries to read from several files that don't exist and no groups.
2014-03-13check_pgsql: Add missing newline to --help outputGravatar Holger Weiss
2014-03-09build - avoid deprecated INCLUDESGravatar Davide Madrisan
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-02-20check_swap: Fix the plugin name that appears in the commentGravatar Davide Madrisan
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-02-18check_procs test fails if there is no user with uid 501Gravatar Sven Nierlein
thats because check_procs verifys there is a user for a given uid filter. So even we use sample data for this test, we still need a real user. Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-02-17check_ssh: Reverting a387120Gravatar Jan Wagner
This seems to result into more problems in the wild then before 'fixing' it Closes Debian #739254 Reopen Debian #734811
2014-02-07Merge pull request #1234 from skottler/plugin_makefile_whitespaceGravatar Thomas Guyot-Sionnest
Remove unnecessary whitespace in Makefile.am
2014-02-07Remove unnecessary whitespace in Makefile.amGravatar Sam Kottler
2014-01-31Add perfdata in check_proc output testsGravatar Thomas Guyot-Sionnest
2014-01-31Fix snmpd testsGravatar Thomas Guyot-Sionnest
2014-01-31Enable tests in tests/ subdirsGravatar Thomas Guyot-Sionnest
2014-01-31Handle negative values properly with check_snmpGravatar Stephane Lapie
check_snmp becomes capable of evaluating negative values properly, but it might be returning CRITICALs where it used to return OK and was ignored, if a negative value turns out to actually be a valid value. If negative values are valid, this can be worked around, by adding "~:" to the warning/critical threshold : 100 -> ~:100
2014-01-31Add tests for negative thresholds in check_snmpGravatar Thomas Guyot-Sionnest
Next commit will work on fixing these!
2014-01-30check_dig: Declare variable at the topGravatar Holger Weiss
C89 doesn't allow variable declarations to be intermingled with code.
2014-01-30check_dig: stick with integer devisionGravatar Jan Wagner
This change saves us from having to link check_dig against "libm"
2014-01-30check_dig: timeout_interval is a global variableGravatar Jan Wagner
which is already set to 10 seconds
2014-01-30check_dig: patch to make dig honor -t optionGravatar Jan Wagner
When a timeout value is specified with the -t option, dig will sometimes timeout before the timer is actually reached. The problem occurs because the check_dig plugin does not pass the specified timeout value to dig, leaving dig to timeout with it's default value which seems to be around 10-15seconds. To reproduce: time ./check_dig -H 127.0.0.2 -l www.google.com -t 30 It will not run for 30secs, which is the expected behaviour. The following will work, because the timeout is less than the default dig timeout, so the plugin cancels the dig command: time ./check_dig -H 127.0.0.2 -l www.google.com -t 2 This fix passes the timeout value to dig, and sets the number of retries which tends to vary from system to system by default. Closes #1168
2014-01-29Update check_swap usageGravatar Thomas Guyot-Sionnest
2014-01-29check_swap: add supports for a configurable state when there is no swapGravatar Thomas Guyot-Sionnest
Check_swap used to allow no swap when thresholds were only specified in percent. This is no longer the case and the state now must be specified explicitly. The default is to always return CRITICAL when the swap is absent regardless of thresholds.
2014-01-29Move negate' translate_state() to utils_base.h mp_translate_state()Gravatar Thomas Guyot-Sionnest
Also use strcasecmp imported from gnulib for simplicity