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

Adds support for NEC IX devices. #2409

Merged
merged 1 commit into from
Nov 30, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- model for zte c300 and c320 olt (@glaubway)
- model for LANCOM (@systeembeheerder)
- model for Aruba CX switches (@jmurphy5)
- model for NEC IX devices (@mikenowak)

### Changed

Expand Down
2 changes: 2 additions & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
* MRV
* [MasterOS](/lib/oxidized/model/masteros.rb)
* [FiberDriver](/lib/oxidized/model/fiberdriver.rb)
* NEC
* [NEC IX](/lib/oxidized/model/necix.rb)
* Netgear
* [Netgear switches](/lib/oxidized/model/netgear.rb)
* Netonix
Expand Down
30 changes: 30 additions & 0 deletions lib/oxidized/model/necix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class NecIX < Oxidized::Model
prompt /^(\([\w.-]*\)\s[#$]|^\S+[$#]\s?)$/
comment '! '
expect /^--More--$/ do |data, re|
send ' '
data.sub re, ''
end

cmd 'show running-config' do |cfg|
cfg = cfg.each_line.to_a[3..-2].join
cfg.gsub! /^.*Current time.*$/, ''
cfg
end

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

cfg :telnet, :ssh do
post_login do
send "configure\n"
end

pre_logout do
send "\cZ"
send "exit\n"
end
end
end