diff options
author | Yuri Zubov <y.zubov@sumatosoft.com> | 2018-04-19 14:19:41 +0300 |
---|---|---|
committer | Yuri Zubov <y.zubov@sumatosoft.com> | 2018-04-19 14:38:45 +0300 |
commit | 12c770dd3504748d3e67f99175b26d0515a3d283 (patch) | |
tree | f9f13030a002a85f8b722b00dde8b74f5a45dbc5 /lib/oxidized/model | |
parent | 234199264146bcd19f6949efbe122d62346dbdff (diff) |
Basic support for NDMS OS (Zyxel Keenetic)
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r-- | lib/oxidized/model/ndms.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/oxidized/model/ndms.rb b/lib/oxidized/model/ndms.rb new file mode 100644 index 0000000..c632bb9 --- /dev/null +++ b/lib/oxidized/model/ndms.rb @@ -0,0 +1,25 @@ +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 |