summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobbFromIT <38932246+RobbFromIT@users.noreply.github.com>2018-09-13 02:40:13 -0500
committerWild Kat <wk@users.noreply.github.com>2018-09-13 09:40:13 +0200
commitb64def6743003d57698a1faa790408b48bc49a26 (patch)
treea0fc836adc82e7509a13e6c341a0e70f65d51bea
parentef48dbf7b126dd37afe637d09ea0878572639093 (diff)
Add comtrol model (#1507)
-rw-r--r--CHANGELOG.md1
-rw-r--r--docs/Supported-OS-Types.md2
-rw-r--r--lib/oxidized/model/comtrol.rb41
3 files changed, 44 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6fdf459..07a9b64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
* FEATURE: add viptela model (@bobthebutcher)
* FEATURE: add ECI Telecom Appolo platform bij arien.vijn@linklight.nl
* FEATURE: ssh keepalive now configurable per node with ssh_no_keepalive boolean
+* FEATURE: add Comtrol model (@RobbFromIT)
* MISC: add gpgme and sequel gems to Dockerfile for sources
## 0.24.0
diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md
index 430fc45..bb37597 100644
--- a/docs/Supported-OS-Types.md
+++ b/docs/Supported-OS-Types.md
@@ -67,6 +67,8 @@
* [Groove](/lib/oxidized/model/coriantgroove.rb)
* ComNet
* [ComNet Microsemi Switch](/lib/oxidized/model/comnetms.rb)
+* Comtrol
+ * [RocketLinx](/lib/oxidized/model/comtrol.rb)
* Cumulus
* [Linux](/lib/oxidized/model/cumulus.rb)
* DataCom
diff --git a/lib/oxidized/model/comtrol.rb b/lib/oxidized/model/comtrol.rb
new file mode 100644
index 0000000..a325e2b
--- /dev/null
+++ b/lib/oxidized/model/comtrol.rb
@@ -0,0 +1,41 @@
+class Comtrol < Oxidized::Model
+ # Used in Comtrol Industrial Switches, such as RocketLinx ES8510
+
+ # Typical prompt "<hostname>#"
+ prompt /([#>]\s?)$/
+ comment '! '
+
+ # how to handle pager
+ expect /--More--+\s$/ do |data, re|
+ send ' '
+ data.sub re, ''
+ end
+
+ cmd :all do |cfg|
+ cfg.gsub! /^.*\e7/, ''
+ end
+
+ cmd 'show version'
+
+ cmd 'show running-config'
+
+ cfg :telnet do
+ username /^User name:/i
+ password /^Password:/i
+ end
+
+ cfg :telnet, :ssh do
+ if vars :enable
+ post_login do
+ send "enable\n"
+ # Interpret enable: true as meaning we won't be prompted for a password
+ unless vars(:enable).is_a? TrueClass
+ expect /[pP]assword:\s?$/
+ send vars(:enable) + "\n"
+ end
+ expect /^.+[#]\s?$/
+ end
+ end
+ pre_logout 'exit'
+ end
+end