diff options
author | Bas van Elburg <Skinza@users.noreply.github.com> | 2018-05-17 20:24:00 +0200 |
---|---|---|
committer | Wild Kat <wk@users.noreply.github.com> | 2018-05-17 20:24:00 +0200 |
commit | 33c12a7615110b44cdfe0617b3cdc586df764193 (patch) | |
tree | 010964968f237788d14fb81fa41c48858019d61a | |
parent | 23d77b181efb4ab82591abfdecdbbf36c5961417 (diff) |
Fix telnet (#1343)
* Fixed: fix debug logging (passed @log to telnet)
* Fixed: call closed on sock of telnet instead of telnet
-rw-r--r-- | lib/oxidized/input/telnet.rb | 6 |
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") |