[Nagiosplug-devel] [ nagiosplug-Patches-1894021 ] check_ssh clean shutdown of connections

SourceForge.net noreply at sourceforge.net
Thu Feb 14 21:47:25 CET 2008


Patches item #1894021, was opened at 2008-02-14 12:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1894021&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Enhancement
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Don Johnson (drj33)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ssh clean shutdown of connections

Initial Comment:
Patch against Plugin Version check_ssh v1813 (nagios-plugins 1.4.11)
Plugin Name: check_ssh
Example Plugin Commandline: ./check_ssh -H mail
Tested on operating system: CentOS 5.1 (linux 2.6.18)
Tested on architecture: intel
Tested with compiler: gcc 4.1.2

I was noticing quite a few errors in my /var/log/secure on monitored servers like:

Feb 14 12:18:33 mail sshd[3250]: fatal: Read from socket failed: Connection reset by peer

...and when I looked at the code, the connection was just being close()d, and that was it, closing the connection with a simple RST, which the other end doesn't enjoy (although nagios is content)

So, I tried adding a 'shutdown(sd, SHUT_RDWR);' right before the 'close(sd);' and the error isn't showing up anymore in the logs.

Note: I don't know C, just perl. I looked up shutdown() and tried it, and it worked, that's all!



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1894021&group_id=29880




More information about the Devel mailing list