summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/aireos.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/model/aireos.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/model/aireos.rb')
-rw-r--r--lib/oxidized/model/aireos.rb54
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/oxidized/model/aireos.rb b/lib/oxidized/model/aireos.rb
new file mode 100644
index 0000000..8f5f646
--- /dev/null
+++ b/lib/oxidized/model/aireos.rb
@@ -0,0 +1,54 @@
+class Aireos < Oxidized::Model
+
+ # AireOS (at least I think that is what it's called, hard to find data)
+ # Used in Cisco WLC 5500
+
+ comment '# ' ## this complains too, can't find real comment char
+ prompt /^\([^\)]+\)\s>/
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ ##show sysinfo?
+ ##show switchconfig?
+
+ cmd 'show udi' do |cfg|
+ cfg = comment clean cfg
+ cfg << "\n"
+ end
+
+ cmd 'show boot' do |cfg|
+ cfg = comment clean cfg
+ cfg << "\n"
+ end
+
+ cmd 'show run-config commands' do |cfg|
+ clean cfg
+ end
+
+ cfg :telnet, :ssh do
+ username /^User:\s*/
+ password /^Password:\s*/
+ post_login 'config paging disable'
+ end
+
+ cfg :telnet, :ssh do
+ pre_logout do
+ send "logout\n"
+ send "n"
+ end
+ end
+
+ def clean cfg
+ out = []
+ cfg.each_line do |line|
+ next if line.match /^\s*$/
+ line = line[1..-1] if line[0] == "\r"
+ out << line.strip
+ end
+ out = out.join "\n"
+ out << "\n"
+ end
+
+end