summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ndms.rb
blob: dab3f6267ef0b92a77f60da3c23195b0eff1a64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.each_line.reject { |line| line.match /(clock date|checksum)/ }.join
    cfg
  end

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