Skip to content

Commit

Permalink
add Centec Networks CNOS support (ytti#2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy36 authored Jan 30, 2020
1 parent 590e583 commit 3091d34
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Master

* FEATURE: add Centec Networks CNOS (Fiberstore S5800/S5850) support via cnos model (@freddy36)
* FEATURE: include transceiver information in EdgeCOS model (@freddy36)
* FEATURE: add Telco Systems T-Marc 3306 support via telco model (@SkylerBlumer)
* FEATURE: add enable support to ciscosmb (@deesel)
Expand Down
4 changes: 4 additions & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
* [Cambium (PMP450 Series)](/lib/oxidized/model/cambium.rb)
* Casa
* [Casa](/lib/oxidized/model/casa.rb)
* Centec Networks
* [CNOS](/lib/oxidized/model/cnos.rb)
* Check Point
* [GaiaOS](/lib/oxidized/model/gaiaos.rb)
* Ciena
Expand Down Expand Up @@ -106,6 +108,8 @@
* Fiberstore
* [S3800](/lib/oxidized/model/gcombnps.rb)
* [S3900](/lib/oxidized/model/edgecos.rb)
* [S5800](/lib/oxidized/model/cnos.rb)
* [S5850](/lib/oxidized/model/cnos.rb)
* Firebrick
* [FBxxxx](/lib/oxidized/model/firebrick.rb)
* Force10
Expand Down
33 changes: 33 additions & 0 deletions lib/oxidized/model/cnos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# model for Centec Networks CNOS based switches
class CNOS < Oxidized::Model
comment '! '

cmd :all do |cfg|
cfg.each_line.to_a[0..-2].join
end

cmd 'show running-config' do |cfg|
cfg.gsub!(/(snmp-server community )(\S+)/, '\1<hidden>')
cfg.gsub!(/key type private.+key string end/m, '<private key hidden>')
cfg
end

cmd 'show version' do |cfg|
cfg.gsub! /^(.* uptime is ).*\n/, '\1'
comment cfg
end

cmd 'show transceiver' do |cfg|
comment cfg
end

cfg :telnet do
username /^Username:/
password /^Password:/
end

cfg :telnet, :ssh do
post_login 'terminal length 0'
pre_logout 'exit'
end
end

0 comments on commit 3091d34

Please sign in to comment.