summaryrefslogtreecommitdiff
path: root/lib/oxidized/input/telnet.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2013-04-27 13:00:11 +0300
committerSaku Ytti <saku@ytti.fi>2013-04-27 13:00:11 +0300
commit80f5c733b3b9c1bf0be3bcafbb868574b77c91b2 (patch)
treec0a0df8b1e012ffee25037c856abbdd89b602789 /lib/oxidized/input/telnet.rb
parent70cb33c214ced1235b8e6077e11177a3ba6b7977 (diff)
Fix connction reset on disconnect
Dell Powerconnect does this
Diffstat (limited to 'lib/oxidized/input/telnet.rb')
-rw-r--r--lib/oxidized/input/telnet.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb
index 2da459e..09c3df9 100644
--- a/lib/oxidized/input/telnet.rb
+++ b/lib/oxidized/input/telnet.rb
@@ -39,8 +39,11 @@ module Oxidized
end
def disconnect
- @pre_logout.each { |command| cmd(command, nil) }
- @telnet.close
+ begin
+ @pre_logout.each { |command| cmd(command, nil) }
+ @telnet.close
+ rescue Errno::ECONNRESET
+ end
end
def username re=/^(Username|login)/