diff options
Diffstat (limited to 'lib/oxidized/input/telnet.rb')
-rw-r--r-- | lib/oxidized/input/telnet.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb index 13fccf7..d305fcd 100644 --- a/lib/oxidized/input/telnet.rb +++ b/lib/oxidized/input/telnet.rb @@ -10,9 +10,12 @@ module Oxidized @node = node @timeout = CFG.timeout @node.model.cfg['telnet'].each { |cb| instance_exec(&cb) } + port = vars(:telnet_port) || 23 - opt = { 'Host' => @node.ip, 'Timeout' => @timeout, - 'Model' => @node.model } + opt = { 'Host' => @node.ip, + 'Port' => port.to_i, + 'Timeout' => @timeout, + 'Model' => @node.model } opt['Output_log'] = CFG.input.debug?.to_s + '-telnet' if CFG.input.debug? @telnet = Net::Telnet.new opt |