From 68b13e27b53cf935ef23037fde6e53df59fa8b3e Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Tue, 5 Aug 2014 15:54:23 +0300 Subject: fix ssh close when far end closes disgracefully ALU ISAM DSLAM does this --- CHANGELOG.md | 3 +++ lib/oxidized/input/ssh.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df997d5..8d0cd16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.2.3 +- BUGFIX: rescue @ssh.close when far end closes ungracefully (ALU ISAM) + # 0.2.2 - BUGFIX: mark node as failure if unknown error is raised diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 570f8a8..e3fcede 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -59,7 +59,7 @@ module Oxidized Timeout::timeout(CFG.timeout) { @ssh.loop } rescue Errno::ECONNRESET, Net::SSH::Disconnect, IOError ensure - @ssh.close if not @ssh.closed? + (@ssh.close rescue true) unless @ssh.closed? end def shell_open ssh -- cgit v1.2.1