Closed maddog-nn closed 2 years ago
Probably a good start
Look at 2078
cmd 'show system' do |cfg|
cfg.gsub! /^(System Up Time)./, '' cfg.gsub! /^(\sUnit\sTemperature)./, '' # Remove temperature table heading cfg.gsub! /^((-{24}\s){2}-{24}).$/, '' # Remove temperature table line cfg.gsub! /^(\s{10,11}\d).*/, '' # Remove temperature table values comment cfg.lines.to_a[5..-5].join
end
I did submit a vrtx.rb but it hasn't shown up. I might have done it. Bit of a github noob
I can add the file next week to this thread
If you looking to add your own “cfg.secret” removal block you can look here:
That way you do not affect the default model for when you update oxidized and you have your own model which removes code at your discretion. In this case your temperature output.
Hi guys, i'm pretty new in ruby so could you please explain more detailed what should i do?
Here is a sample of what we do with Procurve model.
We use the default model provided by oxidized but use our own secret
block as stated in the previous link.
At the end run some additional show cmds but irrelevant to this thread.
cat .config/oxidized/model/procurve.rb
require 'oxidized/model/procurve.rb'
class Procurve < Oxidized::Model
prompt /^\r?(\w+\-\w+\-\w+\-*(?i)(ap|rtr|sw|olt)\-\d+[#>]\s?)$/
cmd :secret, clear: true do |cfg|
cfg.gsub! /^(password)\s(\S+)\s(user-name)\s(\S+)\s(\S+)\s(\S+)$/, '\\1 \\2 \\3 \\4 \\5 <redacted>'
cfg.gsub! /^(snmp-server community).*/, '\\1 <redacted>'
cfg.gsub! /^(snmp-server host).*/, '\\1 <redacted>'
cfg.gsub! /^(radius-server key).*/, '\\1 <redacted>'
cfg.gsub! /^(\s+((\d+\s+){2}|\d+\s+)\w+\s+(\w+\s+(Powered|Present)|Powered)\s+(AC\s+\S+|\s+)).*/, '\\1'
cfg.gsub! /^( Currently supplying ).*/, '\\1 <redacted>'
cfg
end
pre do
cmd 'show system power-supply | in Power|Not P|Model|---' do |cfg|
comment cfg
end
end
end
no-feedback -> closed
Hello, We have a lot of commits from some Dell equipment like VRTX switches when temperature changes on switch. I mean temperature info includes in output of 'show system' command. How we can exclude this information from output or ignore if temperature differs from previous temperature value? For example here is one of the last diffs:
Thank you in advance!