aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2014-01-10 15:56:30 +0100
committerGravatar Jan Wagner <waja@cyconet.org> 2014-01-10 15:56:30 +0100
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 1c032a4f..2d635281 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -250,6 +250,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
printf
(_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"),
ssh_server, ssh_proto, remote_version);
+ recv (sd, output, BUFF_SZ, 0);
close(sd);
exit (STATE_WARNING);
}
@@ -260,6 +261,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
(_("SSH OK - %s (protocol %s) | %s\n"),
ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
+ recv (sd, output, BUFF_SZ, 0);
close(sd);
exit (STATE_OK);
}