summaryrefslogtreecommitdiff
path: root/lib/oxidized/input/cli.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-03-05 13:54:36 +0200
committerSaku Ytti <saku@ytti.fi>2014-03-05 13:54:36 +0200
commitf8be9c5a3597768128d70209daf4d40e527a7880 (patch)
tree656a61bee97b11e022fa0d27be38f059c146e18f /lib/oxidized/input/cli.rb
parent91abe312526e3bd0cd4927209dbff53976393dde (diff)
Add AireOS support
Crappy Cisco WLC 5k, much quality, very implementation, such secure * stop pre_logout from expecting prompt by default
Diffstat (limited to 'lib/oxidized/input/cli.rb')
-rw-r--r--lib/oxidized/input/cli.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/oxidized/input/cli.rb b/lib/oxidized/input/cli.rb
index ab93b06..2e6ac35 100644
--- a/lib/oxidized/input/cli.rb
+++ b/lib/oxidized/input/cli.rb
@@ -5,6 +5,7 @@ module Oxidized
def initialize
@post_login = []
@pre_logout = []
+ @username, @password, @exec = nil
end
def get
@@ -15,7 +16,7 @@ module Oxidized
end
def disconnect_cli
- @pre_logout.each { |command, block| block ? block.call : (cmd command) }
+ @pre_logout.each { |command, block| block ? block.call : (cmd command, nil) }
end
def post_login _post_login=nil, &block
@@ -29,6 +30,15 @@ module Oxidized
@pre_logout << [_pre_logout, block]
end
end
+
+ def username re=/^(Username|login)/
+ @username or @username = re
+ end
+
+ def password re=/^Password/
+ @password or @password = re
+ end
+
end
end
end