summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2018-04-20 13:34:53 +0300
committerGitHub <noreply@github.com>2018-04-20 13:34:53 +0300
commite4bd9dbc63b74e49ed7e7aafcb07aaf021bbee93 (patch)
tree0edee3768d42300d05da57613277160b4bebd03d
parentc761c4eb8825c06155127be61f0789073fc507f7 (diff)
parent12c770dd3504748d3e67f99175b26d0515a3d283 (diff)
Merge pull request #1286 from yuri-zubov/master
Basic support for NDMS OS (Zyxel Keenetic)
-rw-r--r--docs/Supported-OS-Types.md1
-rw-r--r--lib/oxidized/model/ndms.rb25
2 files changed, 26 insertions, 0 deletions
diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md
index 7a765f8..4556946 100644
--- a/docs/Supported-OS-Types.md
+++ b/docs/Supported-OS-Types.md
@@ -163,3 +163,4 @@
* [Zhone (OLT and MX)](/lib/oxidized/model/zhoneolt.rb)
* Zyxel
* [ZyNOS](/lib/oxidized/model/zynos.rb)
+ * [NDMS](/lib/oxidized/model/ndms.rb)
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