summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/timos.rb
blob: 6bbdddf4f191fabb5b7ad4055513168dc316ff55 (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
44
45
class TiMOS < Oxidized::Model

  # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent)
  # used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP
 
  comment  '# '

  prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/

  cmd :all do |cfg, cmdstring|
    new_cfg = comment "COMMAND: #{cmdstring}\n"
    new_cfg << cfg.each_line.to_a[1..-2].join
  end

  cmd 'show bof' do |cfg|
    comment cfg
  end

  cmd 'show system information' do |cfg|
    # strip uptime
    cfg.sub! /^System Up Time.*\n/, ''
    comment cfg
  end

  cmd 'show card state' do |cfg|
    comment cfg
  end

  cmd 'show boot-messages' do |cfg|
    cfg.gsub! /\r/, ""
    comment cfg
  end

  cmd 'admin display-config'

  cfg :telnet do
    username /^Login: /
    password /^Password: /
  end

  cfg :telnet, :ssh do
    post_login 'environment no more'
    pre_logout 'logout'
  end
end