From 8a932865eb6082a66d2ceb73354bd6bb5a2b90ab Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 20 Jun 2014 12:35:22 +0200 Subject: NEWS: s/MP_STATE_DIRECTORY/MP_STATE_PATH/ NAGIOS_PLUGIN_STATE_DIRECTORY was renamed to MP_STATE_PATH, not to MP_STATE_DIRECTORY. --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index c0c9d11b..0a1ef950 100644 --- a/NEWS +++ b/NEWS @@ -22,7 +22,7 @@ This file documents the major additions and syntax changes between releases. check_ide_smart -0/--auto-off, -1/--auto-on and -i/--immediate: options have been disabled because they were broken State retention: the NAGIOS_PLUGIN_STATE_DIRECTORY environment variable has been - renamed MP_STATE_DIRECTORY. The old variable will continue to work in v1.6.x + renamed MP_STATE_PATH. The old variable will continue to work in v1.6.x check_swap used to allow returning OK on a system without swap when only percent thresholds were used. This is no longer the case and one must now use -n/--no-swap= The Perl and Shell plugins now use the PATH specified via ./configure's --trusted-path -- cgit v1.2.3-74-g34f1 From eb85a612a3321c57efbd672f8b11bfefbc659876 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 21 Jun 2014 15:15:44 +0200 Subject: Add UID to state retention file path Add the UID of the invoking user to the state retention file path. This helps solving permission issues when different users run the same plugin. --- NEWS | 2 ++ lib/tests/test_utils.c | 8 ++++++-- lib/utils_base.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 0a1ef950..4c511790 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ This file documents the major additions and syntax changes between releases. been disabled because they were broken State retention: the NAGIOS_PLUGIN_STATE_DIRECTORY environment variable has been renamed MP_STATE_PATH. The old variable will continue to work in v1.6.x + Add the UID of the invoking user to the state retention file path. This helps solving + permission issues when different users run the same plugin check_swap used to allow returning OK on a system without swap when only percent thresholds were used. This is no longer the case and one must now use -n/--no-swap= The Perl and Shell plugins now use the PATH specified via ./configure's --trusted-path diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index 356887d5..f35b7e27 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c @@ -21,6 +21,7 @@ #include "tap.h" +#include #include #include @@ -29,6 +30,7 @@ int main (int argc, char **argv) { + char state_path[1024]; range *range; double temp; thresholds *thresholds = NULL; @@ -345,9 +347,10 @@ main (int argc, char **argv) np_enable_state("allowedchars_in_keyname", 77); temp_state_key = this_monitoring_plugin->state; + sprintf(state_path, "/usr/local/nagios/var/%lu/check_test/allowedchars_in_keyname", (unsigned long)geteuid()); ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" ); ok( !strcmp(temp_state_key->name, "allowedchars_in_keyname"), "Got key name with valid chars" ); - ok( !strcmp(temp_state_key->_filename, "/usr/local/nagios/var/check_test/allowedchars_in_keyname"), "Got internal filename" ); + ok( !strcmp(temp_state_key->_filename, state_path), "Got internal filename" ); /* Don't do this test just yet. Will die */ @@ -359,12 +362,13 @@ main (int argc, char **argv) np_enable_state("funnykeyname", 54); temp_state_key = this_monitoring_plugin->state; + sprintf(state_path, "/usr/local/nagios/var/%lu/check_test/funnykeyname", (unsigned long)geteuid()); ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" ); ok( !strcmp(temp_state_key->name, "funnykeyname"), "Got key name" ); - ok( !strcmp(temp_state_key->_filename, "/usr/local/nagios/var/check_test/funnykeyname"), "Got internal filename" ); + ok( !strcmp(temp_state_key->_filename, state_path), "Got internal filename" ); ok( temp_state_key->data_version==54, "Version set" ); temp_state_data = np_state_read(); diff --git a/lib/utils_base.c b/lib/utils_base.c index 04c4b4f9..55d35fdd 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -489,7 +489,9 @@ void np_enable_state(char *keyname, int expected_data_version) { this_state->state_data=NULL; /* Calculate filename */ - asprintf(&temp_filename, "%s/%s/%s", _np_state_calculate_location_prefix(), this_monitoring_plugin->plugin_name, this_state->name); + asprintf(&temp_filename, "%s/%lu/%s/%s", + _np_state_calculate_location_prefix(), (unsigned long)geteuid(), + this_monitoring_plugin->plugin_name, this_state->name); this_state->_filename=temp_filename; this_monitoring_plugin->state = this_state; -- cgit v1.2.3-74-g34f1 From c0311d98481b783f1d24dd6c59fe25ce994a090d Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 22 Jun 2014 14:10:38 +0200 Subject: check_radius: Support FreeRADIUS Client library Allow for using the FreeRADIUS Client library instead of radiusclient or radiusclient-ng. The latter two projects are dead. Closes #1231. --- NEWS | 1 + REQUIREMENTS | 10 ++++++---- configure.ac | 11 +++++++++-- plugins/check_radius.c | 21 ++++++++++++++------- 4 files changed, 30 insertions(+), 13 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 4c511790..796bb2da 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ This file documents the major additions and syntax changes between releases. check_ide_smart now defaults to plugin output, original output appended with -v Extra-Opts are now enabled by default check_swap now supports a configurable state when there is no swap + check_radius now supports the FreeRADIUS Client library FIXES Don't let e.g. check_http's -C option reset SSL version if e.g. -S 1 -C 5 is specified diff --git a/REQUIREMENTS b/REQUIREMENTS index 994764c6..303fd62b 100644 --- a/REQUIREMENTS +++ b/REQUIREMENTS @@ -50,14 +50,16 @@ check_dbi: http://libdbi.sourceforge.net/ check_radius: - - Requires the radiusclient-ng library available from: + - Requires the FreeRADIUS Client library available from: + http://freeradius.org/freeradius-client/ + - As an alternative, the radiusclient-ng library may be used: http://sourceforge.net/projects/radiusclient-ng.berlios/ - This plugin also works with the original radiusclient library from ftp://ftp.cityline.net/pub/radiusclient/ RPM (rpmfind): radiusclient 0.3.2, radiusclient-devel-0.3.2 - Unless you're using a distro-maintained version of this library you - probably want to use radiusclient-ng. The original radiusclient library is - unmaintained and has many known issues, particularly with 64bit systems. + However, you probably want to use the FreeRADIUS Client library, as + both radiusclient and radiusclient-ng are unmaintained and have known + issues. check_snmp: - Requires the NET-SNMP package available from diff --git a/configure.ac b/configure.ac index a7501ab7..9aaa515e 100644 --- a/configure.ac +++ b/configure.ac @@ -286,8 +286,15 @@ AS_IF([test "x$with_radius" != "xno"], [ RADIUSLIBS="-lradiusclient-ng" AC_SUBST(RADIUSLIBS) else - AC_MSG_WARN([Skipping radius plugin]) - AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) + AC_CHECK_LIB(freeradius-client,rc_read_config) + if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then + EXTRAS="$EXTRAS check_radius\$(EXEEXT)" + RADIUSLIBS="-lfreeradius-client" + AC_SUBST(RADIUSLIBS) + else + AC_MSG_WARN([Skipping radius plugin]) + AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) + fi fi fi LIBS="$_SAVEDLIBS" diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 3481f0cc..9394d26d 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c @@ -36,9 +36,10 @@ const char *email = "devel@monitoring-plugins.org"; #include "utils.h" #include "netutils.h" -#ifdef HAVE_LIBRADIUSCLIENT_NG +#if defined(HAVE_LIBFREERADIUS_CLIENT) +#include +#elif defined(HAVE_LIBRADIUSCLIENT_NG) #include -rc_handle *rch = NULL; #else #include #endif @@ -47,11 +48,14 @@ int process_arguments (int, char **); void print_help (void); void print_usage (void); -/* libradiusclient(-ng) wrapper functions */ -#ifdef HAVE_LIBRADIUSCLIENT_NG +#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) #define my_rc_conf_str(a) rc_conf_str(rch,a) #define my_rc_send_server(a,b) rc_send_server(rch,a,b) +#ifdef HAVE_LIBFREERADIUS_CLIENT +#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,(a)->secret,e,f) +#else #define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,e,f) +#endif #define my_rc_own_ipaddress() rc_own_ipaddress(rch) #define my_rc_avpair_add(a,b,c,d) rc_avpair_add(rch,a,b,c,-1,d) #define my_rc_read_dictionary(a) rc_read_dictionary(rch, a) @@ -72,6 +76,10 @@ void print_usage (void); int my_rc_read_config(char *); +#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) +rc_handle *rch = NULL; +#endif + char *server = NULL; char *username = NULL; char *password = NULL; @@ -142,11 +150,10 @@ Please note that all tags must be lowercase to use the DocBook XML DTD. int main (int argc, char **argv) { - UINT4 service; char msg[BUFFER_LEN]; SEND_DATA data; int result = STATE_UNKNOWN; - UINT4 client_id; + uint32_t client_id, service; char *str; setlocale (LC_ALL, ""); @@ -392,7 +399,7 @@ print_usage (void) int my_rc_read_config(char * a) { -#ifdef HAVE_LIBRADIUSCLIENT_NG +#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) rch = rc_read_config(a); return (rch == NULL) ? 1 : 0; #else -- cgit v1.2.3-74-g34f1 From f518395410b175484de6c2fdf288ab3b36788e7a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 22 Jun 2014 21:58:25 +0200 Subject: NEWS: Add missing tab characters --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 796bb2da..726376ce 100644 --- a/NEWS +++ b/NEWS @@ -2,8 +2,8 @@ This file documents the major additions and syntax changes between releases. 1.6 ... ENHANCEMENTS - check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with - fallback to sendmail + check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with + fallback to sendmail check_ide_smart now defaults to plugin output, original output appended with -v Extra-Opts are now enabled by default check_swap now supports a configurable state when there is no swap -- cgit v1.2.3-74-g34f1 From f52efd00bfc747cca182f51d61fdd65b94c1d58a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 23 Jun 2014 01:20:37 +0200 Subject: NEWS: Add missing entries for the upcoming release --- NEWS | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 726376ce..575cbdad 100644 --- a/NEWS +++ b/NEWS @@ -1,21 +1,35 @@ This file documents the major additions and syntax changes between releases. -1.6 ... +2.0 ... ENHANCEMENTS check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with fallback to sendmail check_ide_smart now defaults to plugin output, original output appended with -v - Extra-Opts are now enabled by default + Extra-Opts are now enabled by default, see: + https://www.monitoring-plugins.org/doc/extra-opts.html check_swap now supports a configurable state when there is no swap check_radius now supports the FreeRADIUS Client library + New check_mysql_query -f option to specify a client options file + New check_mysql_query -g option to specify a client options group + Add performance data to check_mysql_query + New check_file_age -i/--ignore-missing option to return OK on nonexistent files + Make check_ping, check_users, and check_disk work on Windows FIXES Don't let e.g. check_http's -C option reset SSL version if e.g. -S 1 -C 5 is specified + Don't have check_http's -N option expect an argument check_ide_smart could disable offline auto tests but could not re-enable them. For this reason all SMART command modes have been disabled. check_dig: fix wrong IPv6 arguments order (Stéphane Bortzmeyer) + check_dig: make sure not to give up too early when a timeout is specified with -t + check_log: don't stumble over log lines that include a "%" character + check_nt: add UPTIME to perfdata + Handle negative values properly with check_snmp + Handle SNMPv3 noAuthNoPriv properly with check_snmp + Fix compilation with GnuTLS WARNINGS + New default installation prefix: /usr/local instead of /usr/local/nagios check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells utils.sh no longer defines ECH check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatile output) are now deprecated -- cgit v1.2.3-74-g34f1 From 1a0467f672ae7a3cb8ecf35e9cbedc0cb4c6124e Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 6 Jul 2014 12:42:36 +0200 Subject: NEWS: Add missing entries --- NEWS | 2 ++ 1 file changed, 2 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 575cbdad..171d5b80 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ This file documents the major additions and syntax changes between releases. Add performance data to check_mysql_query New check_file_age -i/--ignore-missing option to return OK on nonexistent files Make check_ping, check_users, and check_disk work on Windows + New check_ssh -P option to specify the expected SSH protocol version + check_dns now emits the warning and critical thresholds with the performance data FIXES Don't let e.g. check_http's -C option reset SSL version if e.g. -S 1 -C 5 is specified -- cgit v1.2.3-74-g34f1 From 76d8a40cddef7a63507cb0d0ce224ec373e4c62c Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 7 Jul 2014 16:49:32 +0200 Subject: NEWS: Update version number We're going to release version 2.0, not 1.6. --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 171d5b80..9e3c62fc 100644 --- a/NEWS +++ b/NEWS @@ -39,7 +39,7 @@ This file documents the major additions and syntax changes between releases. check_ide_smart -0/--auto-off, -1/--auto-on and -i/--immediate: options have been disabled because they were broken State retention: the NAGIOS_PLUGIN_STATE_DIRECTORY environment variable has been - renamed MP_STATE_PATH. The old variable will continue to work in v1.6.x + renamed MP_STATE_PATH. The old variable will continue to work in v2.0.x Add the UID of the invoking user to the state retention file path. This helps solving permission issues when different users run the same plugin check_swap used to allow returning OK on a system without swap when only percent thresholds -- cgit v1.2.3-74-g34f1 From 43b66c06a921b878ba4de2a246a219cca94dd498 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 7 Jul 2014 21:02:52 +0200 Subject: NEWS: Add a warning regarding check_snmp Tell users that check_snmp might now return CRITICAL in cases where it used to return OK, and how to deal with that. --- NEWS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 9e3c62fc..36345012 100644 --- a/NEWS +++ b/NEWS @@ -26,12 +26,14 @@ This file documents the major additions and syntax changes between releases. check_dig: make sure not to give up too early when a timeout is specified with -t check_log: don't stumble over log lines that include a "%" character check_nt: add UPTIME to perfdata - Handle negative values properly with check_snmp Handle SNMPv3 noAuthNoPriv properly with check_snmp Fix compilation with GnuTLS WARNINGS New default installation prefix: /usr/local instead of /usr/local/nagios + check_snmp now evaluates negative values properly, which means it might return CRITICAL + in cases where it used to return OK. If this is undesired, the warning/critical + threshold(s) must be fixed by specifying e.g. ~:100 instead of 100 check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells utils.sh no longer defines ECH check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatile output) are now deprecated -- cgit v1.2.3-74-g34f1 From e4e95c1d594aa11fcc040241738c675d64c5ba44 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 11 Jul 2014 09:49:59 +0200 Subject: NEWS: Wrap overly long line --- NEWS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 36345012..cf58cb42 100644 --- a/NEWS +++ b/NEWS @@ -34,7 +34,8 @@ This file documents the major additions and syntax changes between releases. check_snmp now evaluates negative values properly, which means it might return CRITICAL in cases where it used to return OK. If this is undesired, the warning/critical threshold(s) must be fixed by specifying e.g. ~:100 instead of 100 - check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells + check_procs now ignores its parent process to avoid unexpected results when invoked via + certain shells utils.sh no longer defines ECH check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatile output) are now deprecated but accepted for backward-compatibility -- cgit v1.2.3-74-g34f1 From 017b523fa4a8198d65e53b3ad414346f47ad0472 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 11 Jul 2014 11:15:36 +0200 Subject: Prepare for the 2.0 release --- NEWS | 2 +- NP-VERSION-GEN | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index cf58cb42..f28f391c 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ This file documents the major additions and syntax changes between releases. -2.0 ... +2.0 11th July 2014 ENHANCEMENTS check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with fallback to sendmail diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN index ae507e4a..26f94e78 100755 --- a/NP-VERSION-GEN +++ b/NP-VERSION-GEN @@ -6,7 +6,7 @@ SRC_ROOT=`dirname $0` NPVF=NP-VERSION-FILE -DEF_VER=1.5.git +DEF_VER=2.0.git LF=' ' diff --git a/configure.ac b/configure.ac index 87d43fd2..f6ead580 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(monitoring-plugins,1.5) +AC_INIT(monitoring-plugins,2.0) AC_CONFIG_SRCDIR(NPTest.pm) AC_CONFIG_FILES([gl/Makefile monitoring-plugins.spec]) -- cgit v1.2.3-74-g34f1 From 50cad9ae5d958f045fcea927b41b52d24ff59b91 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 11 Jul 2014 16:46:12 +0200 Subject: NEWS: Fix typo --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index f28f391c..f2898aba 100644 --- a/NEWS +++ b/NEWS @@ -37,7 +37,7 @@ This file documents the major additions and syntax changes between releases. check_procs now ignores its parent process to avoid unexpected results when invoked via certain shells utils.sh no longer defines ECH - check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatile output) are now deprecated + check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatible output) are now deprecated but accepted for backward-compatibility check_ide_smart -0/--auto-off, -1/--auto-on and -i/--immediate: options have been disabled because they were broken -- cgit v1.2.3-74-g34f1 From 8e187dfefef1397b1f87a1008e162e46a74f4782 Mon Sep 17 00:00:00 2001 From: abrist Date: Fri, 24 Jan 2014 14:04:37 -0500 Subject: Added check_hpjd port option to news and clarified the port usage error. --- NEWS | 4 ++++ plugins/check_hpjd.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index f2898aba..d48e1d8a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ This file documents the major additions and syntax changes between releases. +2.1 + ENHANCEMENTS + New check_hpjd -p option for port specification (abrist) + 2.0 11th July 2014 ENHANCEMENTS check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 1ee4d134..5fe06984 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -344,7 +344,7 @@ process_arguments (int argc, char **argv) break; case 'p': if (!is_intpos(optarg)) - usage2 (_("Port must be a positive integer"), optarg); + usage2 (_("Port must be a positive short integer"), optarg); else port = atoi(optarg); break; -- cgit v1.2.3-74-g34f1