summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Aksola <anton.aksola@nebula.fi>2014-04-09 13:18:18 +0300
committerAnton Aksola <anton.aksola@nebula.fi>2014-04-09 13:18:18 +0300
commit6e07722fda2bf488f1076d492b04c221fc75b716 (patch)
tree5669efcf0e375cc015ab5463fd86c52973a4819b
parentd8ca58940a916c673febc9e0350a278b7987d368 (diff)
add model for AOS7 (Omniswitch 6900/10k)
supports virtual chassis for OS6900
-rw-r--r--lib/oxidized/model/aos7.rb58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/oxidized/model/aos7.rb b/lib/oxidized/model/aos7.rb
new file mode 100644
index 0000000..8d11066
--- /dev/null
+++ b/lib/oxidized/model/aos7.rb
@@ -0,0 +1,58 @@
+class AOS7 < Oxidized::Model
+
+ # Alcatel-Lucent Operating System Version 7 (Linux based)
+ # used in OmniSwitch 6900/10k
+
+ comment '! '
+
+ cmd :all do |cfg, cmdstring|
+ new_cfg = comment "COMMAND: #{cmdstring}\n"
+ new_cfg << cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd 'show system' do |cfg|
+ cfg = cfg.each_line.find{|line|line.match 'Description'}
+ comment cfg.to_s.strip + "\n"
+ end
+
+ cmd 'show chassis' do |cfg|
+ # check for virtual chassis existence
+ @slave_vcids = cfg.scan(/Chassis ID (\d+) \(Slave\)/).flatten
+ @master_vcid = $1 if cfg.match /Chassis ID (\d+) \(Master\)/
+ comment cfg
+ end
+
+ cmd 'show hardware-info' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show running-directory' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show configuration snapshot' do |cfg|
+ cfg
+ end
+
+ pre do
+ cfg = []
+ if @master_vcid
+ # add slave VC boot config as comment
+ @slave_vcids.each do |id|
+ cfg << comment("vc_boot.cfg for slave chassis #{id}")
+ cfg << comment(cmd("show configuration vcm-snapshot chassis-id #{id}"))
+ end
+ cfg << cmd("show configuration vcm-snapshot chassis-id #{@master_vcid}")
+ end
+ cfg.join "\n"
+ end
+
+ cfg :telnet do
+ username /^login : /
+ password /^Password : /
+ end
+
+ cfg :telnet, :ssh do
+ pre_logout 'exit'
+ end
+end