Imported Upstream version 2.1.1+git20151012

This commit is contained in:
Jan Wagner 2015-10-12 15:49:08 +02:00
parent 61401f6508
commit 494a834dcf
15 changed files with 397 additions and 319 deletions

View file

@ -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 );

View file

@ -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,

View file

@ -59,14 +59,19 @@ 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();
#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."));

View file

@ -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',

View file

@ -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: {