diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | docs/Model-Notes/README.md | 1 | ||||
-rw-r--r-- | docs/Model-Notes/Viptela.md | 10 | ||||
-rw-r--r-- | lib/oxidized/model/viptela.rb | 29 |
4 files changed, 41 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d99f71f..3500c0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * BUGFIX: xos model should not modify config on legacy Extreme Networks devices (sq9mev) * BUGFIX: model edgecos, ciscosmb * MISC: bump Dockerfile phusion/baseimage:0.10.0 -> 0.10.1 +* FEATURE: add viptela model (@bobthebutcher) ## 0.24.0 diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index bf3c5f6..fba31d7 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -14,6 +14,7 @@ Cumulus|[Cumulus](Cumulus.md)|11 Jun 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 Netgear|[Netgear](Netgear.md)|11 Apr 2018 +Viptela|[Viptela](Viptela.md)|1 Jul 2018 Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|1 Feb 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/Viptela.md b/docs/Model-Notes/Viptela.md new file mode 100644 index 0000000..4b4bab1 --- /dev/null +++ b/docs/Model-Notes/Viptela.md @@ -0,0 +1,10 @@ +# Viptela + +This model collects running config and other desired commands from Viptela devices. +Pagination is disabled post login. + +## Supported Commands +- show running-config +- show version + +Back to [Model-Notes](README.md)
\ No newline at end of file diff --git a/lib/oxidized/model/viptela.rb b/lib/oxidized/model/viptela.rb new file mode 100644 index 0000000..f08e1b4 --- /dev/null +++ b/lib/oxidized/model/viptela.rb @@ -0,0 +1,29 @@ +class Viptela < Oxidized::Model + # Cisco Vipetla + + prompt /[-\w]+#\s$/ + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg.gsub! /(^\s+secret-key|password|auth-password|priv-password)\s+.*$/, '\\1 <secret hidden>' + cfg.gsub! /(^\s+community)\s.*$/, '\\1 <secret hidden>' + cfg + end + + cmd 'show running-config' do |cfg| + cfg + end + + cmd 'show version' do |cfg| + comment cfg + end + + cfg :ssh do + post_login 'paginate false' + pre_logout 'exit' + end +end |