summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/aosw.rb
blob: 26ee0fa0e9650aed297a485a4469c16c6d69ea02 (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
35
36
37
38
39
40
41
42
43
class AOSW < Oxidized::Model

  # AOSW - Alcatel-Lucent OS - Wireless 
  # Used in Alcatel OAW-4750 WLAN controller (Aruba)

  comment  '# '
  prompt /^\([^)]+\) #/

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

  cmd 'show version' do |cfg|
    cfg = cfg.each_line.select { |line| not line.match /Switch uptime/i }
    comment cfg.join
  end

  cmd 'show inventory' do |cfg|
    cfg = cfg.each_line.take_while { |line| not line.match /Output \d Config/i }
    comment cfg.join
  end

  cmd 'show slots' do |cfg|
    comment cfg
  end
  cmd 'show license' do |cfg|
    comment cfg
  end
  cmd 'show configuration' do |cfg|
    cfg
  end

  cfg :telnet do
    username /^User:\s*/
    password /^Password:\s*/
  end

  cfg :telnet, :ssh do
    post_login 'no paging'
    pre_logout 'exit'
  end

end