summaryrefslogtreecommitdiff
path: root/lib/oxidized/input/telnet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/input/telnet.rb')
-rw-r--r--lib/oxidized/input/telnet.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb
index 84d9877..4e80ceb 100644
--- a/lib/oxidized/input/telnet.rb
+++ b/lib/oxidized/input/telnet.rb
@@ -19,6 +19,10 @@ module Oxidized
expect @node.prompt
end
+ def connected?
+ @telnet and not @telnet.sock.closed?
+ end
+
def cmd cmd, expect=@node.prompt
Log.debug "Telnet: #{cmd} @#{@node.name}"
args = { 'String' => cmd }