diff options
author | Saku Ytti <saku@ytti.fi> | 2013-04-27 12:16:55 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2013-04-27 12:16:55 +0300 |
commit | 70cb33c214ced1235b8e6077e11177a3ba6b7977 (patch) | |
tree | 20d0add3984642be00c1685ac0e19e50e2e4288c /lib/oxidized/input/telnet.rb | |
parent | 5fca52c86b50dd9754546902530530b9c0f6216b (diff) |
Fix timeout on receiving command from input
Diffstat (limited to 'lib/oxidized/input/telnet.rb')
-rw-r--r-- | lib/oxidized/input/telnet.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb index f946e92..2da459e 100644 --- a/lib/oxidized/input/telnet.rb +++ b/lib/oxidized/input/telnet.rb @@ -25,7 +25,11 @@ module Oxidized Log.debug "Telnet: #{cmd} @#{@node.name}" args = { 'String' => cmd } args.merge!({ 'Match' => expect, 'Timeout' => @timeout }) if expect - @telnet.cmd args + begin + @telnet.cmd args + rescue Timeout::Error + return false + end end private |