summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/firewareos.rb
blob: db4015772664d6b34a0f616c658c5decd612dd5a (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
class FirewareOS < Oxidized::Model
  prompt /^\[?\w*\]?\w*?(<\w*>)?(#|>)\s*$/
  comment  '-- '

  cmd :all do |cfg|
    cfg.cut_both
  end

  # Handle Logon Disclaimer added in XTM 11.9.3
  expect /^I have read and accept the Logon Disclaimer message. \(yes or no\)\? $/ do |data, re|
    send "yes\n"
    data.sub re, ''
  end

  cmd 'show sysinfo' do |cfg|
    # avoid commits due to uptime
    cfg = cfg.each_line.reject { |line| line.match /(.*time.*)|(.*memory.*)|(.*cpu.*)/ }
    cfg = cfg.join
    comment cfg
  end

  cmd 'export config to console'

  cfg :ssh do
    pre_logout 'exit'
  end
end