forked from ytti/oxidized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saos.rb
46 lines (37 loc) · 1.08 KB
/
saos.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class SAOS < Oxidized::Model
using Refinements
# Ciena SAOS switch
# used for 6.x devices
comment '! '
prompt /^[\w-]+\*?>\s?/
cmd :all do |cfg|
cfg.gsub! /(Waiting for )(accounting|authorization).*\n/, '' # Remove TACACS errors
cfg.cut_both
end
cmd 'chassis show device-id power' do |cfg|
comment cfg
end
cmd 'software show' do |cfg|
cfg.gsub! /^\| Bank status.*/, '| Bank status : <removed> |'
comment cfg
end
cmd 'port xcvr show' do |cfg|
cfg.gsub! /^SHELL PARSER FAILURE.*/, '' # Ignore command failure
cfg.gsub! /(\s\|.{10}\|)(Ena\s\s|\s\sDis|UCTF\s)(.*)/, '\1 \3' # Remove transient operational state
comment cfg
end
cmd 'configuration show' do |cfg|
cfg.gsub! /^! Created: [^\n]*\n/, ''
cfg.gsub! /^! On terminal: [^\n]*\n/, ''
cfg
end
cfg :telnet do
username /login:/
password /assword:/
end
cfg :telnet, :ssh do
post_login 'system shell set more off'
post_login 'system shell session set more off'
pre_logout 'exit'
end
end