lib/oxidized/model/awplus.rb in oxidized-0.25.1 vs lib/oxidized/model/awplus.rb in oxidized-0.26.0
- old
+ new
@@ -13,11 +13,11 @@
# Removes gibberish pager output e.g. VT100 escape codes
cmd :all do |cfg|
cfg.gsub! /\e\[K/, '' # example how to handle pager - cleareol EL0
cfg.gsub! /\e\[7m\e\[m/, '' # example how to handle pager - Reverse SGR7
- cfg.gsub! /\r/, '' # Filters rogue ^M - see issue #415
+ cfg.delete! "\r" # Filters rogue ^M - see issue #415
cfg.cut_both
end
# Remove passwords from config file.
# Add vars "remove_secret: true" to global oxidized config file to enable.
@@ -41,17 +41,17 @@
cfg.insert(0, "Starting: Show system cmd \n")
cfg << "\n \nEnding: show system cmd"
comment cfg << "\n--------------------------------------------------------------------------------! \n \n"
# Removes the following lines from "show system" in output file. This ensures oxidized diffs are meaningful.
comment cfg.each_line.reject { |line|
- line.match /^$\n/ or # Remove blank lines in "sh sys"
- line.match /System Status\s*.*/ or
- line.match /RAM\s*:.*/ or
- line.match /Uptime\s*:.*/ or
- line.match /Flash\s*:.*/ or
- line.match /Current software\s*:.*/ or
- line.match /Software version\s*:.*/ or
- line.match /Build date\s*:.*/
+ line.match(/^$\n/) || # Remove blank lines in "sh sys"
+ line.match(/System Status\s*.*/) ||
+ line.match(/RAM\s*:.*/) ||
+ line.match(/Uptime\s*:.*/) ||
+ line.match(/Flash\s*:.*/) ||
+ line.match(/Current software\s*:.*/) ||
+ line.match(/Software version\s*:.*/) ||
+ line.match(/Build date\s*:.*/)
} .join
end
# Actually get the devices running config#
cmd 'show running-config' do |cfg|