summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/eciapollo.rb
blob: ad15360b2e624a0e4f69f998fbfc1ac55e7dfc20 (plain)
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
# ECI Telecom Apollo
# Tested on OPT9608 systems via SSH and telnet

class ECIapollo < Oxidized::Model
  prompt /^([\w.@()-]+[#>]\s?)$/
  comment '# '

  cmd :all do |cfg|
    cfg.each_line.to_a[1..-2].join
  end

  cmd :secret do |cfg|
    cfg.gsub!(/community (\S+) {/, 'community <hidden> {')
    cfg.gsub!(/ "\$\d\$\S+; ## SECRET-DATA/, ' <secret removed>;')
    cfg
  end

  cfg :telnet do
    username(/^login:/)
    password(/^Password:/)
  end

  cfg :telnet, :ssh do
    post_login 'set cli screen-length 0'
    post_login 'set cli screen-width 0'
    pre_logout 'exit'
  end

  cmd('show version')           { |cfg| comment cfg }
  cmd('show system licenses')   { |cfg| comment cfg }
  cmd('show configuration')     { |cfg| comment cfg }
  cmd('show configuration | display-set') { |cfg| cfg }
  cmd('show chassis inventory') { |cfg| comment cfg }
end