aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.de> 2014-06-30 14:52:10 +0200
committerGravatar Jan Wagner <waja@cyconet.org> 2014-11-28 14:35:03 +0100
commita7d7992777963bd192cfef21988d281bc371c794 (patch)
treede9d12dd2760c3b272fa25c9d58f3742dd9905b1
parent7ef100a3ebd8195d9ad19e6c0cd8efd9c0284ee6 (diff)
downloadmonitoring-plugins-a7d7992777963bd192cfef21988d281bc371c794.tar.gz
check_ssh: change warning to critical for protocal/version errors
It makes more sense to exit critical if a explicit version/protocol is requested. This would also be more consistent with other plugins. Other string matching plugins like check_snmp or check_http exit critical if the result does not match. Signed-off-by: Sven Nierlein <sven@nierlein.de> Closes #1268
-rw-r--r--plugins/check_ssh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index b6187d61..3658965e 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -253,18 +253,18 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
if (remote_version && strcmp(remote_version, ssh_server)) {
printf
- (_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"),
+ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
ssh_server, ssh_proto, remote_version);
close(sd);
- exit (STATE_WARNING);
+ exit (STATE_CRITICAL);
}
if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
printf
- (_("SSH WARNING - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
+ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
ssh_server, ssh_proto, remote_protocol);
close(sd);
- exit (STATE_WARNING);
+ exit (STATE_CRITICAL);
}
elapsed_time = (double)deltime(tv) / 1.0e6;
@@ -307,10 +307,10 @@ print_help (void)
printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
printf (" %s\n", "-r, --remote-version=STRING");
- printf (" %s\n", _("Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)"));
+ printf (" %s\n", _("Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"));
printf (" %s\n", "-P, --remote-protocol=STRING");
- printf (" %s\n", _("Warn if protocol doesn't match expected protocol version (ex: 2.0)"));
+ printf (" %s\n", _("Alert if protocol doesn't match expected protocol version (ex: 2.0)"));
printf (UT_VERBOSE);