From cc2c47f7bd38a3df72f4f8a97e7d8a08cd727271 Mon Sep 17 00:00:00 2001 From: broxio Date: Fri, 27 May 2016 13:44:10 +0800 Subject: Strip out dynamic value from CLI Strip out random value from #show version - Memory - Current time is - The system has been up - Last configuration saved at #show running-config all-partitions - Current configuration - Configuration last updated at - Configuration last saved at - Configuration last synchronised at Another add in cmd #show bootimage it's similar to show version it is more readable --- lib/oxidized/model/acos.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index 7db8b00..bb9846e 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -7,6 +7,14 @@ class ACOS < Oxidized::Model prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/ cmd 'show version' do |cfg| + cfg.gsub! /\s(Last configuration saved at).*/, ' \\1 ' + cfg.gsub! /\s(Memory).*/, ' \\1 ' + cfg.gsub! /\s(Current time is).*/, ' \\1 ' + cfg.gsub! /\s(The system has been up).*/, ' \\1 ' + comment cfg + end + + cmd 'show bootimage' do |cfg| comment cfg end @@ -14,7 +22,12 @@ class ACOS < Oxidized::Model comment cfg end - cmd 'show running-config all-partitions' + cmd 'show running-config all-partitions' do |cfg| + cfg.gsub! /(Current configuration).*/, '\\1 ' + cfg.gsub! /(Configuration last updated at).*/, '\\1 ' + cfg.gsub! /(Configuration last saved at).*/, '\\1 ' + cfg.gsub! /(Configuration last synchronized at).*/, '\\1 ' + end cmd 'show aflex all-partitions' do |cfg| comment cfg -- cgit v1.2.1