Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model for Eltex MES #2119

Merged
merged 7 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added

- enterasys800 model for enterasys 800-series fe/ge switches (@javichumellamo)
- model for eltex mes-series switches (@glaubway)
- add ES3526XA-V2 support in EdgeCOS model (@moisseev)

### Changed
Expand Down
3 changes: 3 additions & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
* ECI Telecom
* [ECIapollo](/lib/oxidized/model/eciapollo.rb)
* EdgeCore
* [ECS3510, ES3528M](/lib/oxidized/model/edgecos.rb)
* [ECS3510, ES3526XA-V2, ES3528M](/lib/oxidized/model/edgecos.rb)
* Eltex
* [Eltex](/lib/oxidized/model/eltex.rb)
* Ericsson/Redback
* [IPOS (former SEOS)](/lib/oxidized/model/ipos.rb)
* Extreme Networks
Expand Down
48 changes: 48 additions & 0 deletions lib/oxidized/model/eltex.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class Eltex < Oxidized::Model
# Tested with MES2324FB Version: 4.0.7.1 Build: 37 (master)

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

cmd :all do |cfg|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.cut_both
end

cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
cfg.gsub! /^(enable (password|secret)( level \d+)? \d) .+/, '\\1 <secret hidden>'
cfg.gsub! /^(\s+(?:password|secret)) (?:\d )?\S+/, '\\1 <secret hidden>'
cfg.gsub! /^(tacacs-server (.+ )?key) .+/, '\\1 <secret hidden>'
cfg.gsub! /^((tacacs|radius) server [^\n]+\n(\s+[^\n]+\n)*\s+key) [^\n]+$/m, '\1 <secret hidden>'
cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
cfg.gsub! /^username \S+ password \d \S+/, '<secret hidden>'
cfg.gsub! /^enable password \d \S+/, '<secret hidden>'
cfg.gsub! /wpa-psk ascii \d \S+/, '<secret hidden>'
cfg
end

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

cfg :telnet do
username /^(User Name):/
password /^Password:/
end

cfg :telnet, :ssh do
# preferred way to handle additional passwords
post_login do
if vars(:enable) == true
cmd "enable"
elsif vars(:enable)
cmd "enable", /^[pP]assword:/
cmd vars(:enable)
end
end
post_login 'terminal datadump'
pre_logout 'disable'
pre_logout 'exit'
end
end