summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/panos.rb
blob: 3fdebf7a77b6dbe0c41d65a6ba9a3c38d4ff1ea8 (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
class PanOS < Oxidized::Model
  # PaloAlto PAN-OS model #

  comment '! '

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

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

  cmd 'show system info' do |cfg|
    cfg.gsub! /^(up)?time: .*$/, ''
    cfg.gsub! /^app-.*?: .*$/, ''
    cfg.gsub! /^av-.*?: .*$/, ''
    cfg.gsub! /^threat-.*?: .*$/, ''
    cfg.gsub! /^wildfire-.*?: .*$/, ''
    cfg.gsub! /^wf-private.*?: .*$/, ''
    cfg.gsub! /^url-filtering.*?: .*$/, ''
    cfg.gsub! /^global-.*?: .*$/, ''
    comment cfg
  end

  cmd 'show config running' do |cfg|
    cfg
  end

  cfg :ssh do
    post_login 'set cli pager off'
    pre_logout 'quit'
  end
end