From b1e49f82d5256c62121f1387aa7f22be0e9bc26a Mon Sep 17 00:00:00 2001 From: Will Glynn Date: Fri, 15 Aug 2014 11:03:45 -0500 Subject: Add Ubiquiti AirOS model --- README.md | 1 + lib/oxidized/model/airos.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lib/oxidized/model/airos.rb diff --git a/README.md b/README.md index 704b158..348aa3a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ * Huawei VRP * Juniper JunOS * Juniper ScreenOS (Netscreen) + * Ubiquiti AirOS # Install diff --git a/lib/oxidized/model/airos.rb b/lib/oxidized/model/airos.rb new file mode 100644 index 0000000..316c4f0 --- /dev/null +++ b/lib/oxidized/model/airos.rb @@ -0,0 +1,20 @@ +class Airos < Oxidized::Model + # Ubiquiti AirOS circa 5.x + + prompt /^[^#]+# / + + cmd 'cat /etc/board.info' do |cfg| + cfg.split("\n").map { |line| "# #{line}" }.join("\n") + "\n" + end + + cmd 'cat /tmp/system.cfg' + + cmd :secret do |cfg| + cfg.gsub! /^(users\.\d+\.password|snmp\.community)=.+/, "# \\1=" + cfg + end + + cfg :ssh do + exec true + end +end -- cgit v1.2.1 From 78066ec67b7e935764c93d3f52d145760e2eab32 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 15 Aug 2014 22:24:01 +0200 Subject: Added enable magic for powerconnect model, fixed pagination issues --- lib/oxidized/model/powerconnect.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index 4f90b77..1d0352e 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -19,7 +19,7 @@ class PowerConnect < Oxidized::Model cmd 'show system' do |cfg| cfg = cfg.each_line.take_while { |line| not line.match(/uptime/i) } - comment cfg + comment cfg.join "\n" end cmd 'show running-config' @@ -30,9 +30,14 @@ class PowerConnect < Oxidized::Model end cfg :telnet, :ssh do - post_login 'terminal datadump' - post_login 'enable' - pre_logout 'exit' + if vars :enable + send "enable\n" + send vars(:enable) + "\n" + end + + post_login "terminal length 0" + pre_logout "logout" + end end -- cgit v1.2.1 From f0cbdd19179b2aa009c9f6ae29ecf4c01a3ad2a8 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 16 Aug 2014 11:19:22 +0300 Subject: update change log, bump up gemspec --- CHANGELOG.md | 3 ++- oxidized.gemspec | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60dd462..01df3ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # 0.2.3 - BUGFIX: rescue @ssh.close when far end closes disgracefully (ALU ISAM) -- BUGFIX: remove changing lines from model/procurve.rb 'show system-information' output +- BUGFIX: bugfixes to models - FEATURE: Alcatel-Lucent ISAM 7302/7330 model added by @jalmargyyk - FEATURE: Huawei VRP model added by @jalmargyyk +- FEATURE: Ubiquiti AirOS added by @willglyn - FEATURE: Support 'input' debug in config, ssh/telnet use it to write session log # 0.2.2 diff --git a/oxidized.gemspec b/oxidized.gemspec index 78157b9..dae9d89 100644 --- a/oxidized.gemspec +++ b/oxidized.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'oxidized' - s.version = '0.2.2' + s.version = '0.2.3' s.licenses = %w( Apache-2.0 ) s.platform = Gem::Platform::RUBY s.authors = [ 'Saku Ytti' ] -- cgit v1.2.1