Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ytti/oxidized
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fu committed Feb 19, 2020
2 parents aad043e + bbe864c commit c061088
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 466 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/publishdocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Publish Docker
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: oxidized/oxidized
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
462 changes: 0 additions & 462 deletions CHANGELOG.md

This file was deleted.

7 changes: 7 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 @@ -88,6 +90,7 @@
* [PowerConnect](/lib/oxidized/model/powerconnect.rb)
* [AOSW](/lib/oxidized/model/aosw.rb)
* [DellX](/lib/oxidized/model/dellx.rb)
* [Dell EMC Networking OS10](/lib/oxidized/model/os10.rb)
* D-Link
* [D-Link](/lib/oxidized/model/dlink.rb)
* ECI Telecom
Expand All @@ -106,6 +109,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 Expand Up @@ -192,6 +197,8 @@
* [SBM-GEM-X2C, GEM-X2C+, GEM-X3S+, XEM-X10SM](/lib/oxidized/model/aricentiss.rb)
* Symantec
* [Blue Coat ProxySG / Security Gateway OS (SGOS)](/lib/oxidized/model/sgos.rb)
* Telco Systems
* [Telco Systems T-Marc 3306](/lib/oxidized/model/telco.rb)
* Trango Systems
* [Trango](/lib/oxidized/model/trango.rb)
* TPLink
Expand Down
10 changes: 10 additions & 0 deletions lib/oxidized/model/ciscosmb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class CiscoSMB < Oxidized::Model
cfg :telnet, :ssh do
username /^User ?[nN]ame:/
password /^\r?Password:$/

post_login do
if vars(:enable) == true
cmd 'enable'
elsif vars(:enable)
cmd 'enable', /^\r?Password:$/
cmd vars(:enable)
end
end

post_login 'terminal datadump' # Disable pager
post_login 'terminal width 0'
post_login 'terminal len 0'
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
10 changes: 10 additions & 0 deletions lib/oxidized/model/edgecos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ class EdgeCOS < Oxidized::Model
comment cfg
end

cmd 'show interfaces transceiver' do |cfg|
cfg.gsub! /(\d\d)!/, '\\1 ' # alarm indicators of DDM thresholds
cfg.gsub! /^(\s*Temperature\s*:).*/, '\1 <hidden>'
cfg.gsub! /^(\s*Vcc\s*:).*/, '\1 <hidden>'
cfg.gsub! /^(\s*Bias Current\s*:).*/, '\1 <hidden>'
cfg.gsub! /^(\s*TX Power\s*:).*/, '\1 <hidden>'
cfg.gsub! /^(\s*RX Power\s*:).*/, '\1 <hidden>'
comment cfg
end

cfg :telnet do
username /^Username:/
password /^Password:/
Expand Down
1 change: 1 addition & 0 deletions lib/oxidized/model/eos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class EOS < Oxidized::Model
cfg.gsub! /(password \d+) (\S+).*/, '\\1 <secret hidden>'
cfg.gsub! /^(enable secret).*/, '\\1 <configuration removed>'
cfg.gsub! /^(tacacs-server key \d+).*/, '\\1 <configuration removed>'
cfg.gsub! /( {6}key) (\h+ 7) (\h+).*/, '\\1 <secret hidden>'
cfg
end

Expand Down
8 changes: 4 additions & 4 deletions lib/oxidized/model/gcombnps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ class GcomBNPS < Oxidized::Model
# tested with:
# - S5330 (aka Fiberstore S3800)

prompt /^\r?([\w.@()-]+?(\(1-16 chars\))?[#>:]\s?)$/ # also match SSH password promt (post_login commands are sent after the first prompt)
prompt /^\r?([\w.@()-]+?(\(1-\d+ chars\))?[#>:]\s?)$/ # also match SSH password promt (post_login commands are sent after the first prompt)
comment '! '

# alternative to handle the SSH login, but this breaks telnet
# expect /^Password\(1-16 chars\):/ do |data|
# expect /^Password\(1-\d+ chars\):/ do |data|
# send @node.auth[:password] + "\n"
# ''
# end
Expand Down Expand Up @@ -66,8 +66,8 @@ class GcomBNPS < Oxidized::Model
end

cfg :telnet do
username /^Username\(1-32 chars\):/
password /^Password\(1-16 chars\):/
username /^Username\(1-\d+ chars\):/
password /^Password\(1-\d+ chars\):/
end

cfg :ssh do
Expand Down
46 changes: 46 additions & 0 deletions lib/oxidized/model/os10.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
class OS10 < Oxidized::Model
# For switches running Dell EMC Networking OS10 #
#
# Tested with : Dell PowerSwitch S4148U-ON

comment '! '

cmd :all do |cfg|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.each_line.to_a[2..-2].join
end

cmd :secret do |cfg|
cfg.gsub! /(password )(\S+)/, '\1<secret hidden>'
cfg
end

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

cmd 'show inventory media' do |cfg|
comment cfg
end

cmd 'show running-configuration' do |cfg|
cfg.each_line.to_a[3..-1].join
end

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

cfg :telnet, :ssh do
if vars :enable
post_login do
send "enable\n"
cmd vars(:enable)
end
end
post_login 'terminal length 0'
pre_logout 'exit'
pre_logout 'exit'
end
end
24 changes: 24 additions & 0 deletions lib/oxidized/model/telco.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class TELCO < Oxidized::Model
# Telco Systems T-Marc 3306

prompt /^(\r?[\w.@_()-]+[#]\s?)$/
comment '! '

cmd :all do |cfg|
cfg.each_line.to_a[2..-2].join.delete("\n")
end

cmd 'show running-config' do |cfg|
cfg
end

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

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

0 comments on commit c061088

Please sign in to comment.