summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Wagner <waja@cyconet.org>2014-01-10 14:56:30 (GMT)
committerJan Wagner <waja@cyconet.org>2014-01-10 14:56:30 (GMT)
commita3871201821d9abe8a12e637e7dd00d9d1dde2a5 (patch)
tree7901693e77309a27b0b34b3cf39141c5faf2875d
parentd8354ec15d05241dd28891771609839b73507d28 (diff)
downloadmonitoring-plugins-a3871201821d9abe8a12e637e7dd00d9d1dde2a5.tar.gz
check_ssh: Get rid of sshd: Read from socket failed: Connection reset by peer
This fix was grabbed from FreeBSD downstream and provided by Dmitry Sivachenko. Fixes Debian Bug #734811
-rw-r--r--plugins/check_ssh.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 1c032a4..2d63528 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -250,6 +250,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
250 printf 250 printf
251 (_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"), 251 (_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"),
252 ssh_server, ssh_proto, remote_version); 252 ssh_server, ssh_proto, remote_version);
253 recv (sd, output, BUFF_SZ, 0);
253 close(sd); 254 close(sd);
254 exit (STATE_WARNING); 255 exit (STATE_WARNING);
255 } 256 }
@@ -260,6 +261,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
260 (_("SSH OK - %s (protocol %s) | %s\n"), 261 (_("SSH OK - %s (protocol %s) | %s\n"),
261 ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s", 262 ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
262 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout)); 263 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
264 recv (sd, output, BUFF_SZ, 0);
263 close(sd); 265 close(sd);
264 exit (STATE_OK); 266 exit (STATE_OK);
265 } 267 }