Sven Nierlein
32ec6265a4
unified nc syntax
...
older netcats do not understand -p, they expect host and port as additional argument.
This is backwards compatibel to newer clients. Also support netcat instead of nc.
2013-09-13 23:08:07 +02:00
Sven Nierlein
8b1c574298
fping: some fping versions set loss to 0% by mistake
...
fping v2.4b2 returns
10.99.0.1 : xmt/rcv/%loss = 0/0/0%
for a failed host, so we assume the host is down if xmt is zero
2013-09-13 17:14:33 +02:00
Sven Nierlein
4933146e00
check_snmp: add timeout handler befor running snmpget
2013-09-12 23:39:32 +02:00
Sven Nierlein
c0926c2b1e
check_tcp: only test ipv6 if ping6 works
2013-09-12 23:39:31 +02:00
Holger Weiss
ffad261eab
check_tcp: Fix checks without --expect string
...
Commit e8044713d4 broke check_tcp checks
without --expect string, this commit fixes that regression.
2013-09-12 22:36:35 +02:00
Holger Weiss
e8044713d4
check_tcp: Properly deal will partial recv(3)s
...
The np_expect_match() function now returns one of three possible states
instead of just TRUE or FALSE:
- NP_MATCH_SUCCESS
- NP_MATCH_FAILURE
- NP_MATCH_RETRY
The NP_MATCH_RETRY state indicates that matching might succeed if
np_expect_match() is called with a longer input string. This allows
check_tcp to decide whether it makes sense to wait for additional data
from the server.
2013-09-12 21:37:20 +02:00
Holger Weiss
662997251d
Improve interface of np_expect_match() function
...
Replace the three boolean parameters of lib/utils_tcp.c's
np_expect_match() function with a single "flags" parameter.
2013-09-12 17:42:10 +02:00
Holger Weiss
ca9ce71576
Don't mark SSL_METHOD variable as "const"
...
The SSL_CTX_new(3) function expects a non-"const" SSL_METHOD value.
2013-09-10 22:49:03 +02:00
Holger Weiss
5b0e00782d
Move global variables from .h to .c files
...
Simplify things by moving the definition of global variables into .c
files, where they belong.
2013-09-10 22:45:45 +02:00
Holger Weiss
b48cb1f130
Fix GCC's -Wimplicit-function-declaration warnings
...
Fix the issues found by GCC when the -Wimplicit-function-declaration
flag is specified.
2013-09-10 22:29:46 +02:00
Holger Weiss
d4a781817c
Fix GCC's -Wuninitialized warnings
...
Fix the issues found by GCC when the -Wuninitialized flag is specified.
2013-09-10 20:52:13 +02:00
juliopedreira
cfb50add53
check_tcp: Don't close connection too early
...
Closing the connection because the bytes received are less than the
buffer size assumes that all the bytes will be received in one go. This
is not always true!
2013-09-10 12:16:46 +02:00
Holger Weiss
5bfca4b34d
s/--proxy_authorization/--proxy-authorization/
...
The check_http option "--proxy_authorization" is now called
"--proxy-authorization" instead. It was always documented this way, and
we don't usually use underscores in option names.
2013-09-10 00:46:06 +02:00
Holger Weiss
e8594f461d
check_snmp: Initialize size_t value to 0, not NULL
2013-09-05 00:19:36 +02:00
Holger Weiss
92fdab87b2
Partially revert "check_snmp: Close potential for using uninitialized memory"
...
This reverts the changes to plugins/common.h applied by commit
a20611d435 .
- Clang defines __GNUC__.
- The new name of the __attribute__ parameter was misleading.
2013-08-27 18:32:38 +02:00
Holger Weiss
1cbc73bc8b
check_snmp: Fix --help segfault
2013-08-27 16:08:49 +02:00
Holger Weiss
e9ede0f8e3
Merge branch 'master' of https://github.com/ozamosi/nagios-plugins
...
* 'master' of https://github.com/ozamosi/nagios-plugins :
check_snmp: Close potential for using uninitialized memory
check_snmp: Dynamically grow all data structures
Conflicts:
plugins/check_snmp.c
2013-08-27 14:37:13 +02:00
Holger Weiss
efa9b0fc08
Merge branch 'master' of https://github.com/bugness-chl/nagios-plugins
...
* 'master' of https://github.com/bugness-chl/nagios-plugins :
check_disk: option to ignore reserved space
Conflicts:
plugins/check_disk.c
2013-08-26 23:23:55 +02:00
Sven Nierlein
817ea52cc0
fixed check_tcp test
...
A check with thresholds 9000,1 must exit with warning if the certificate expires in less
than 9000 but more than one day.
2013-08-21 17:48:14 +02:00
Sven Nierlein
d57941c4d2
check_snmp: added threshold tests
2013-08-21 15:59:56 +02:00
Holger Weiss
461cea4261
check_snmp: Fix support for inverse thresholds
...
Commit bd78299056 reintroduced support for
inverse threshold ranges such as "2:1", but it broke standard thresholds
such as "1:2" (by converting this range into "1") or "1:" (by converting
this range into "@:2"). This commit fixes those two bugs, plus an
off-by-one error while computing the number of bytes to allocate when
handling inverse thresholds (two additional bytes were allocated where
three were required to hold '@' and ':' and '\0'). While at it, we also
check whether malloc(3) succeeded.
2013-08-21 15:00:27 +02:00
Holger Weiss
f4b90cabc0
Set SSL_MODE_AUTO_RETRY flag
...
We use OpenSSL (or GnuTLS) with blocking semantics, and we don't want
SSL_read(3) or SSL_write(3) calls to return SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE (see #3614716 ).
2013-08-20 23:17:23 +02:00
Holger Weiss
92849a1a87
check_users: Use utmpx(5) only if available
...
For systems that don't provide an utmpx(5) interface, restore the code
that was replaced in commit 3e622f3a47 .
2013-08-20 21:13:25 +02:00
Sven Nierlein
4083622f86
added missing header to fix build on freebsd
2013-08-20 17:02:02 +02:00
Holger Weiss
8135f66739
check_ide_smart: "__linux__" instead of "linux"
...
C compilers in standards compliance mode will not define "linux", as it
doesn't begin with an underscore.
2013-08-20 00:55:43 +02:00
Holger Weiss
36a9b52cae
check_ide_smart: Add support for NetBSD
...
Thanks to Emmanuel Dreyfus for providing the patch.
2013-08-20 00:41:16 +02:00
Holger Weiss
5f79e3e9f6
Clean up check for _SC_NPROCESSORS_ONLN
...
Closes #62 .
2013-08-19 22:47:36 +02:00
Holger Weiss
a064001173
Merge branch 'master' of https://github.com/bbense/nagios-plugins
...
* 'master' of https://github.com/bbense/nagios-plugins :
Bug fix for ncpus if hyperthreading turned off in linux
2013-08-19 22:47:00 +02:00
Booker C. Bense
f12edfd073
Bug fix for ncpus if hyperthreading turned off in linux
2013-08-19 11:14:05 -07:00
Holger Weiss
30aa7a63f1
check_http: Document the new -E option
...
Mention the -E/--extended-perfdata flag in the --help output.
2013-08-18 23:18:18 +02:00
Holger Weiss
64b4d1fb66
Abbreviate function name
...
Make a very long function name at least a little bit shorter.
2013-08-18 23:11:11 +02:00
Holger Weiss
8e444095e8
Merge branch 'master' of https://github.com/cern-mig/nagios-plugins
...
* 'master' of https://github.com/cern-mig/nagios-plugins :
added support for client authentication via SSL
Conflicts:
plugins/check_http.c
2013-08-18 23:10:31 +02:00
Holger Weiss
b5ac0d16b2
check_mysql: Don't accept new positional arguments
...
Do not also accept the new -f/--file and -g/--group options as
positional arguments (especially not prior to "db_pass" and "db", as
that would break backward compatibility).
2013-08-18 22:30:30 +02:00
Holger Weiss
779b91e48f
check_mysql: Use xasprintf instead of asprintf
2013-08-18 22:29:31 +02:00
Holger Weiss
584555098d
check_mysql: Fix copy'n'pasted comments
2013-08-18 22:28:18 +02:00
Holger Weiss
14bc7af323
Merge branch 'master' of https://github.com/jonmilby/nagios-plugins
...
* 'master' of https://github.com/jonmilby/nagios-plugins :
Updated check_mysql.c to take client options file and group parameters
Conflicts:
plugins/check_mysql.c
2013-08-18 22:25:08 +02:00
Holger Weiss
6d6f090eaa
Merge branch 'fping' of https://github.com/lairsdragon/nagios-plugins
...
* 'fping' of https://github.com/lairsdragon/nagios-plugins :
check_fping error handling enhanced, generates UNKNOWN on fping parameter error (i.e. wrong interface, missing perms ..)
Closes #61 .
2013-08-18 20:36:42 +02:00
Steve Weinreich
96ec686004
check_fping error handling enhanced, generates UNKNOWN on
...
fping parameter error (i.e. wrong interface, missing perms ..)
2013-08-18 19:43:39 +02:00
Holger Weiss
c7c1102fcb
NEWS: Mention the new "check_snmp --offset" option
...
... and apply two small cosmetic changes to check_snmp.c.
Closes #59 .
2013-08-18 19:38:57 +02:00
Simon Kainz
dc1d1c46d6
added --offset option to allow adjustment of sensor data
2013-08-18 19:35:18 +02:00
Holger Weiss
22519bced6
check_http: Use xasprintf instead of asprintf
2013-08-18 19:16:00 +02:00
Holger Weiss
ebb5572af3
check_http: s/--header_string/--header-string/
...
The name of the new option is "--header-string".
2013-08-18 19:14:22 +02:00
Holger Weiss
e6bcf11653
check_snmp: Allocate space for the new -Le option
...
Closes #41 .
2013-08-18 19:08:04 +02:00
Mark Keisler
37cf5e3cd5
Add -Le option to snmpcmd to avoid error message of 'No Log Handling Enabled...'
2013-08-18 19:07:24 +02:00
Tim Laszlo
b2568b85af
check_mysql: Connections should have been defined as a counter
2013-08-18 18:38:10 +02:00
Tim Laszlo
7bbd155a72
Counter increments were incorrect; remove the leading space from perfdata
2013-08-18 18:38:10 +02:00
Tim Laszlo
c8d8b58447
check_mysql: add perfromance metrics for all checks
2013-08-18 18:38:10 +02:00
Tim Laszlo
1627cdb46a
check_mysql: when checking slave thread add performance data for seconds behind master
2013-08-18 18:38:10 +02:00
Holger Weiss
717b0e8d9c
Fix the "check_http -d" tests
2013-08-18 18:31:59 +02:00
linkslice
2a8eab6b31
added ability to check regex against http headers. booyah!
2013-08-18 18:23:11 +02:00