summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/netscaler.rb
blob: d8a844e2bc5050f36a20492594a54a704548f2f4 (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
class NetScaler < Oxidized::Model
  prompt /^>\s*$/
  comment '# '

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

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

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

  cmd :secret do |cfg|
    cfg.gsub! /(-password)\s\w+/, '\\1 <secret hidden>'
    cfg.gsub! /(-keyValue)\s\w+/, '\\1 <secret hidden>'
    cfg.gsub! /(-radKey)\s\w+/, '\\1 <secret hidden>'
    cfg.gsub! /(-ldapBindDnPassword)\s\w+/, '\\1 <secret hidden>'
    cfg
  end

  cmd 'show ns ns.conf'

  cfg :ssh do
    pre_logout 'exit'
  end
end