summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ndms.rb
blob: 1947f911969416e2ba0ff03aa3944cbda7b65677 (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.each_line.to_a[1..-2]
    cfg = cfg.reject { |line| line.match /(clock date|checksum)/ }.join
    cfg
  end

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