summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBas van Elburg <Skinza@users.noreply.github.com>2018-05-17 20:24:00 +0200
committerWild Kat <wk@users.noreply.github.com>2018-05-17 20:24:00 +0200
commit33c12a7615110b44cdfe0617b3cdc586df764193 (patch)
tree010964968f237788d14fb81fa41c48858019d61a /lib
parent23d77b181efb4ab82591abfdecdbbf36c5961417 (diff)
Fix telnet (#1343)
* Fixed: fix debug logging (passed @log to telnet) * Fixed: call closed on sock of telnet instead of telnet
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/input/telnet.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb
index e7c2ee3..4b9a656 100644
--- a/lib/oxidized/input/telnet.rb
+++ b/lib/oxidized/input/telnet.rb
@@ -16,7 +16,8 @@ module Oxidized
telnet_opts = { 'Host' => @node.ip,
'Port' => port.to_i,
'Timeout' => @timeout,
- 'Model' => @node.model }
+ 'Model' => @node.model,
+ 'Log' => @log }
@telnet = Net::Telnet.new telnet_opts
if @node.auth[:username] and @node.auth[:username].length > 0
@@ -64,7 +65,7 @@ module Oxidized
rescue Errno::ECONNRESET
ensure
@log.close if Oxidized.config.input.debug?
- (@telnet.close rescue true) unless @telnet.closed?
+ (@telnet.close rescue true) unless @telnet.sock.closed?
end
end
end
@@ -80,6 +81,7 @@ class Net::Telnet
waittime = @options["Waittime"]
fail_eof = @options["FailEOF"]
model = @options["Model"]
+ @log = @options["Log"]
if options.kind_of?(Hash)
prompt = if options.has_key?("Match")