Get rid of sshd: Read from socket failed: Connection reset by peer [preauth]

in server logs when using check_ssh.
This commit is contained in:
Dmitry Sivachenko 2013-09-25 13:06:12 +00:00
parent 60842bc029
commit 3c48668c58
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=328283
2 changed files with 19 additions and 1 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= nagios-plugins
PORTVERSION= 1.4.16
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= SF/nagiosplug/nagiosplug/${PORTVERSION}

View file

@ -0,0 +1,18 @@
--- plugins/check_ssh.c.orig 2012-06-27 21:32:47.000000000 +0400
+++ plugins/check_ssh.c 2013-09-25 17:03:01.000000000 +0400
@@ -250,6 +250,7 @@ ssh_connect (char *haddr, int hport, cha
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, cha
(_("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);
}