summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/boss.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2017-05-15 15:51:04 +0300
committerGitHub <noreply@github.com>2017-05-15 15:51:04 +0300
commitff727cf7f28b2a55f65b4a2943c889df8f91265c (patch)
tree364bf89349b290cbb38db6257eef72a8a2c9b521 /lib/oxidized/model/boss.rb
parenta12af21ed3c7b8c3644303651d74259a595f778d (diff)
parentdd8101df0aa579405eab958da623fb36ef3231ab (diff)
Merge pull request #849 from ospfbgp/patch-4
Add support for Avaya BOSS
Diffstat (limited to 'lib/oxidized/model/boss.rb')
-rw-r--r--lib/oxidized/model/boss.rb76
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/oxidized/model/boss.rb b/lib/oxidized/model/boss.rb
new file mode 100644
index 0000000..02201a1
--- /dev/null
+++ b/lib/oxidized/model/boss.rb
@@ -0,0 +1,76 @@
+class Boss < Oxidized::Model
+ # Avaya Baystack Operating System Software(BOSS)
+ # Created by danielcoxman@gmail.com
+ # May 15, 2017
+ # This was tested on ers3510, ers5530, ers4850, ers5952
+ # ssh and telnet were tested with banner and without
+
+ comment '! '
+
+ prompt /^[^\s#>]+[#>]$/
+
+ # Handle the banner
+ # to disable the banner on BOSS the configuration parameter is "banner disabled"
+ expect /Enter Ctrl-Y to begin\./ do |data, re|
+ send "\cY"
+ data.sub re, ''
+ end
+
+ # Handle the Failed retries since last login
+ # no known way to disable other than to implement radius authentication
+ expect /Press ENTER to continue/ do |data, re|
+ send "\n"
+ data.sub re, ''
+ end
+
+ # Handle the menu on the older BOSS example ers55xx, ers56xx
+ # to disable them menu on BOSS the configuration parameter is "cmd-interface cli"
+ expect /ommand Line Interface\.\.\./ do |data, re|
+ send "c"
+ data.sub re, ''
+ end
+
+ # needed for proper formatting
+ cmd('') { |cfg| comment "#{cfg}\n" }
+
+ # Do a sys-info and check and see if it supports stack
+ cmd 'show sys-info' do |cfg|
+ @stack = true if cfg.match /Stack/
+ cfg.gsub! /(^((.*)sysUpTime(.*))$)/, 'removed sysUpTime'
+ cfg.gsub! /(^((.*)sysNtpTime(.*))$)/, 'removed sysNtpTime'
+ cfg.gsub! /(^((.*)sysRtcTime(.*))$)/, 'removed sysNtpTime'
+ # remove timestamp
+ cfg.gsub! /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} .*/, ''
+ comment "#{cfg}\n"
+ end
+
+ # if a stack then collect the stacking information
+ cmd 'show stack-info' do |cfg|
+ if @stack
+ # remove timestamp
+ cfg.gsub! /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} .*/, ''
+ comment "#{cfg}\n"
+ end
+ end
+
+ cmd 'show running-config' do |cfg|
+ cfg.gsub! /^show running-config/, '! show running-config'
+ # remove timestamp
+ cfg.gsub! /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} .*/, ''
+ cfg.gsub! /^[^\s#>]+[#>]$/, ''
+ cfg.gsub! /^! clock set.*/, '! removed clock set'
+ cfg
+ end
+
+ cfg :telnet do
+ username /Username: /
+ password /Password: /
+ end
+
+ cfg :telnet, :ssh do
+ pre_logout 'logout'
+ post_login 'terminal length 0'
+ post_login 'terminal width 132'
+ end
+
+end