From fd1b2c2ac903b3a8e2578a4ca0f48a61309a0493 Mon Sep 17 00:00:00 2001 From: Ilya Demyanov Date: Sun, 31 Dec 2017 09:19:49 +0300 Subject: Create snr.rb --- lib/oxidized/model/snr.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/oxidized/model/snr.rb (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/snr.rb b/lib/oxidized/model/snr.rb new file mode 100644 index 0000000..3f1fab5 --- /dev/null +++ b/lib/oxidized/model/snr.rb @@ -0,0 +1,14 @@ +class SNR < Oxidized::Model + + comment '!' + + cmd 'show running-config' do |cfg| + cfg = cfg.each_line.to_a[1..-1] + end + + cfg :ssh do + post_login 'terminal length 0' + pre_logout 'exit' + end + +end -- cgit v1.2.1 From 343cf3227cafe4a7de4a7be5934163eb6bd2dba9 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Tue, 20 Mar 2018 23:17:29 +0100 Subject: expand dcnos model --- lib/oxidized/model/dcnos.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/dcnos.rb b/lib/oxidized/model/dcnos.rb index 5a39e2b..4a33fa0 100644 --- a/lib/oxidized/model/dcnos.rb +++ b/lib/oxidized/model/dcnos.rb @@ -12,6 +12,14 @@ class DCNOS < Oxidized::Model comment cfg end + cmd 'show boot-files' do |cfg| + comment cfg + end + + cmd 'show flash' do |cfg| + comment cfg + end + cmd 'show running-config' do |cfg| cfg = cfg.each_line.to_a[1..-1] end -- cgit v1.2.1 From 2d8e40344a05ac16869941c19dbcd6df8ddac80c Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Tue, 20 Mar 2018 23:38:23 +0100 Subject: better comments --- lib/oxidized/model/dcnos.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/dcnos.rb b/lib/oxidized/model/dcnos.rb index 4a33fa0..c6b2e36 100644 --- a/lib/oxidized/model/dcnos.rb +++ b/lib/oxidized/model/dcnos.rb @@ -6,7 +6,7 @@ class DCNOS < Oxidized::Model - comment '!' + comment '! ' cmd 'show version' do |cfg| comment cfg -- cgit v1.2.1 From 4ba96c79f7eaf5dd9c02c9488d77a5c896c96d8c Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Fri, 23 Mar 2018 09:24:38 +0100 Subject: yield cfg for clarity --- lib/oxidized/model/dcnos.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/dcnos.rb b/lib/oxidized/model/dcnos.rb index c6b2e36..f53bc0d 100644 --- a/lib/oxidized/model/dcnos.rb +++ b/lib/oxidized/model/dcnos.rb @@ -21,7 +21,8 @@ class DCNOS < Oxidized::Model end cmd 'show running-config' do |cfg| - cfg = cfg.each_line.to_a[1..-1] + cfg = cfg.each_line.to_a[1..-1].join + cfg end cfg :telnet do -- cgit v1.2.1 From b2fcf887b3ea7e85e916ec7265a494a6efbf8fa7 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Thu, 5 Apr 2018 14:23:20 +0200 Subject: strip uptime info from show version --- lib/oxidized/model/dcnos.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/dcnos.rb b/lib/oxidized/model/dcnos.rb index f53bc0d..ec0c7f6 100644 --- a/lib/oxidized/model/dcnos.rb +++ b/lib/oxidized/model/dcnos.rb @@ -9,6 +9,7 @@ class DCNOS < Oxidized::Model comment '! ' cmd 'show version' do |cfg| + cfg = cfg.gsub! /^(Uptime is ).*/, '' comment cfg end -- cgit v1.2.1