summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ndms.rb
blob: 57cb70660e2ef13fc2ebde6fb789d3b7cf0a4ab5 (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
class NDMS < Oxidized::Model
  # Pull config from Zyxel Keenetic devices from version NDMS >= 2.0

  comment  '! '

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

  cmd 'show version' do |cfg|
    cfg = cfg.each_line.to_a[1..-3].join
    comment cfg
  end

  cmd 'show running-config' do |cfg|
    cfg = cfg.cut_both
    cfg = cfg.reject { |line| line.match /(clock date|checksum)/ }.join
    cfg
  end

  cfg :telnet do
    username /^Login:/
    password /^Password:/
    pre_logout 'exit'
  end
end