From 4e786f83decca053c98293fc4a4a555e4d247c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Sat, 25 Jul 2015 20:02:14 -0600 Subject: sslutils: Check if OpenSSL supports SSLv3. diff --git a/plugins/sslutils.c b/plugins/sslutils.c index d0ae474..4933dd0 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c @@ -66,7 +66,12 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int #endif break; case 3: /* SSLv3 protocol */ +#if defined(OPENSSL_NO_SSL3) + printf(("%s\n", _("CRITICAL - SSL protocol version 3 is not supported by your SSL library."))); + return STATE_CRITICAL; +#else method = SSLv3_client_method(); +#endif break; default: /* Unsupported */ printf("%s\n", _("CRITICAL - Unsupported SSL protocol version.")); -- cgit v0.10-9-g596f From 1c0ec88152125624c35e0d675efde65fee7bf8df Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Thu, 1 Oct 2015 17:05:47 +0200 Subject: travis: fix http test host Signed-off-by: Sven Nierlein diff --git a/plugins/t/NPTest.cache.travis b/plugins/t/NPTest.cache.travis index 4ebfb90..ce798c2 100644 --- a/plugins/t/NPTest.cache.travis +++ b/plugins/t/NPTest.cache.travis @@ -17,7 +17,7 @@ 'NP_HOST_HPJD_PORT_INVALID' => '161', 'NP_HOST_HPJD_PORT_VALID' => '', 'NP_HOST_TCP_HTTP' => 'localhost', - 'NP_HOST_TCP_HTTP2' => 'labs.consol.de', + 'NP_HOST_TCP_HTTP2' => 'test.monitoring-plugins.org', 'NP_HOST_TCP_IMAP' => 'imap.web.de', 'NP_HOST_TCP_POP' => 'pop.web.de', 'NP_HOST_TCP_SMTP' => 'localhost', -- cgit v0.10-9-g596f From 6a939fa1bacd90b64a8e09939ee06223330f7567 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 5 May 2015 14:56:31 +0200 Subject: Fixes segfaults when running via monitoring worker (off-by-one) Grabed from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198318 diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index b874c55..5508d5f 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -1182,7 +1182,7 @@ int call_getopt(int argc, char **argv){ } } - return i; + return i+1; } -- cgit v0.10-9-g596f From 466cb79e5224327c29fc6b84a1cec99c2b190c5a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 2 Oct 2015 12:18:13 +0200 Subject: check_dhcp: Fix option parsing The call_getopt() function didn't always return the correct number of processed arguments. However, since check_dhcp doesn't support non-option arguments, the caller doesn't need this number anyway. Closes #1345. diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index 5508d5f..25d4ed4 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -229,7 +229,7 @@ struct in_addr requested_address; int process_arguments(int, char **); int call_getopt(int, char **); -int validate_arguments(void); +int validate_arguments(int, int); void print_usage(void); void print_help(void); @@ -1059,29 +1059,19 @@ int get_results(void){ /* process command-line arguments */ int process_arguments(int argc, char **argv){ - int c; + int arg_index; if(argc<1) return ERROR; - c=0; - while((c+=(call_getopt(argc-c,&argv[c]))) 0) + usage(_("Got unexpected non-option argument")); return OK; } -- cgit v0.10-9-g596f From 0b8041226446572eba0f82316716622f57d715e0 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Fri, 27 Mar 2015 13:16:42 +0100 Subject: Fix incorrect performance data thresholds Closes #1330 diff --git a/plugins/check_ups.c b/plugins/check_ups.c index 099881d..fd8c2d1 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c @@ -242,8 +242,8 @@ main (int argc, char **argv) } xasprintf (&data, "%s %s", data, perfdata ("battery", (long)ups_battery_percent, "%", - check_warn, (long)(1000*warning_value), - check_crit, (long)(1000*critical_value), + check_warn, (long)(warning_value), + check_crit, (long)(critical_value), TRUE, 0, TRUE, 100)); } else { xasprintf (&data, "%s %s", data, @@ -271,8 +271,8 @@ main (int argc, char **argv) } xasprintf (&data, "%s %s", data, perfdata ("load", (long)ups_load_percent, "%", - check_warn, (long)(1000*warning_value), - check_crit, (long)(1000*critical_value), + check_warn, (long)(warning_value), + check_crit, (long)(critical_value), TRUE, 0, TRUE, 100)); } else { xasprintf (&data, "%s %s", data, @@ -308,8 +308,8 @@ main (int argc, char **argv) } xasprintf (&data, "%s %s", data, perfdata ("temp", (long)ups_temperature, tunits, - check_warn, (long)(1000*warning_value), - check_crit, (long)(1000*critical_value), + check_warn, (long)(warning_value), + check_crit, (long)(critical_value), TRUE, 0, FALSE, 0)); } else { xasprintf (&data, "%s %s", data, -- cgit v0.10-9-g596f From 63f8441b841785d66ef918cdf8f1480e58dedccd Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 2 Oct 2015 13:29:28 +0200 Subject: NEWS: Mention check_ups performance data fix diff --git a/NEWS b/NEWS index c999e51..efd1ced 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ This file documents the major additions and syntax changes between releases. +2.1.2 ... + FIXES + Fix incorrect performance data thresholds emitted by check_ups + 2.1.1 2nd December 2014 FIXES Fix check_ntp's jitter checking -- cgit v0.10-9-g596f From f3bf672ebbed538c72bfa7837e52b1bf76017afa Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Sun, 12 Apr 2015 14:32:21 +0200 Subject: add perl snmp to travis dependencies it is required for the check_snmp tests Signed-off-by: Sven Nierlein diff --git a/.travis.yml b/.travis.yml index 2275be3..c362869 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ before_install: install: - sudo apt-get install -qq --no-install-recommends perl autotools-dev libdbi-dev libldap2-dev libpq-dev libmysqlclient-dev libfreeradius-client-dev libkrb5-dev libnet-snmp-perl procps - - sudo apt-get install -qq --no-install-recommends libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader + - sudo apt-get install -qq --no-install-recommends libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl - sudo apt-get install -qq --no-install-recommends fping snmp netcat smbclient fping pure-ftpd apache2 postfix libhttp-daemon-ssl-perl - sudo apt-get install -qq --no-install-recommends autoconf automake -- cgit v0.10-9-g596f From 9e49f7e656e9667bb1077a79b2c832995d601558 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Sun, 12 Apr 2015 14:37:27 +0200 Subject: enable libtab on travis builds to enable some more tests Signed-off-by: Sven Nierlein diff --git a/.travis.yml b/.travis.yml index c362869..ee18b6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: before_script: - tools/setup - - ./configure + - ./configure --enable-libtap - make - export NPTEST_CACHE="$(pwd)/plugins/t/NPTest.cache.travis" - ssh-keygen -t dsa -N "" -f ~/.ssh/id_dsa -- cgit v0.10-9-g596f From f693f2c0bf5789a89b89e0821ffb741e0368cee5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Sun, 12 Apr 2015 15:15:39 +0200 Subject: install snmpd on travis tests because its required for ./plugins/tests/check_snmp.t Signed-off-by: Sven Nierlein diff --git a/.travis.yml b/.travis.yml index ee18b6c..21a1713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ before_install: install: - sudo apt-get install -qq --no-install-recommends perl autotools-dev libdbi-dev libldap2-dev libpq-dev libmysqlclient-dev libfreeradius-client-dev libkrb5-dev libnet-snmp-perl procps - - sudo apt-get install -qq --no-install-recommends libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl + - sudo apt-get install -qq --no-install-recommends libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd - sudo apt-get install -qq --no-install-recommends fping snmp netcat smbclient fping pure-ftpd apache2 postfix libhttp-daemon-ssl-perl - sudo apt-get install -qq --no-install-recommends autoconf automake -- cgit v0.10-9-g596f From 6ba26122f4746a7e16272b1b9546342820400a78 Mon Sep 17 00:00:00 2001 From: Oliver Skibbe Date: Fri, 6 Mar 2015 11:51:45 +0100 Subject: check_snmp.c: switched DEFAULT_TIMEOUT to DEFAULT_SOCKET_TIMEOUT (provided by utils.h), already used by help description, see issue #1318 diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 2c62a23..6d7ec6d 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -41,7 +41,6 @@ const char *email = "devel@monitoring-plugins.org"; #define DEFAULT_PORT "161" #define DEFAULT_MIBLIST "ALL" #define DEFAULT_PROTOCOL "1" -#define DEFAULT_TIMEOUT 1 #define DEFAULT_RETRIES 5 #define DEFAULT_AUTH_PROTOCOL "MD5" #define DEFAULT_PRIV_PROTOCOL "DES" @@ -224,7 +223,7 @@ main (int argc, char **argv) outbuff = strdup (""); delimiter = strdup (" = "); output_delim = strdup (DEFAULT_OUTPUT_DELIMITER); - timeout_interval = DEFAULT_TIMEOUT; + timeout_interval = DEFAULT_SOCKET_TIMEOUT; retries = DEFAULT_RETRIES; np_init( (char *) progname, argc, argv ); -- cgit v0.10-9-g596f From 2d677b19ed34ff8171dbf07fb7744e560737d143 Mon Sep 17 00:00:00 2001 From: Oliver Skibbe Date: Fri, 6 Mar 2015 12:43:34 +0100 Subject: check_snmp: modified tests (Closes #1325) diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t index 2d6c44a..aefd872 100644 --- a/plugins/t/check_snmp.t +++ b/plugins/t/check_snmp.t @@ -166,8 +166,8 @@ SKIP: { SKIP: { skip "no non responsive host defined", 2 if ( ! $host_nonresponsive ); $res = NPTest->testCmd( "./check_snmp -H $host_nonresponsive -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:"); - cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" ); - like($res->output, '/External command error: Timeout: No Response from /', "String matches timeout problem"); + cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL with non responsive host" ); + like($res->output, '/Plugin timed out while executing system call/', "String matches timeout problem"); } SKIP: { -- cgit v0.10-9-g596f From 0a406d8dcec816a94d283b872755b28f219bea2e Mon Sep 17 00:00:00 2001 From: Sebastian Herbszt Date: Sat, 20 Dec 2014 20:58:22 +0100 Subject: sslutils: remove superfluous parenthesis Remove superfluous parenthesis. Signed-off-by: Sebastian Herbszt diff --git a/plugins/sslutils.c b/plugins/sslutils.c index 4933dd0..494a1ec 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c @@ -59,7 +59,7 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int break; case 2: /* SSLv2 protocol */ #if defined(USE_GNUTLS) || defined(OPENSSL_NO_SSL2) - printf(("%s\n", _("CRITICAL - SSL protocol version 2 is not supported by your SSL library."))); + printf("%s\n", _("CRITICAL - SSL protocol version 2 is not supported by your SSL library.")); return STATE_CRITICAL; #else method = SSLv2_client_method(); -- cgit v0.10-9-g596f From 8e661a3bd6c6892ed4db926eab769c167b0e9091 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 4 Oct 2015 15:11:40 +0200 Subject: sslutils: Remove superfluous parenthesis for sslv3 function too diff --git a/plugins/sslutils.c b/plugins/sslutils.c index 494a1ec..f34c3d7 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c @@ -67,7 +67,7 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int break; case 3: /* SSLv3 protocol */ #if defined(OPENSSL_NO_SSL3) - printf(("%s\n", _("CRITICAL - SSL protocol version 3 is not supported by your SSL library."))); + printf("%s\n", _("CRITICAL - SSL protocol version 3 is not supported by your SSL library.")); return STATE_CRITICAL; #else method = SSLv3_client_method(); -- cgit v0.10-9-g596f