You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When monkey patching a model with clear the output is appended instead of replaced in the same spot, e.g. enterasys.rb
require 'oxidized/model/enterasys.rb'
class Enterasys
using Refinements
cmd 'show system hardware', clear:true do |cfg|
cfg = cfg.each_line.reject { |line| line.match(/RPM$/) || line.match(/Uptime:/) || line.match(/LM75:/) || line.match(/Temperature:/)}.join
comment cfg
end
end
leads to a configuration where the system hardware informations are appended, instead of prefixed to the configuration.
When prepending (prepend:true) there are two hardware outputs in the same spot.
The text was updated successfully, but these errors were encountered:
I had the same issue. One solution is to simply copy the whole enterasys.rb into your own model folder without using a require statement at the top and insert your own command where you want it to be in the final file. This way is also mentioned in the docs: https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md
Completely re-define an existing model by creating a file in ~/.config/oxidized/model/ with the same name as an existing model, but not require-ing the upstream model file.
When monkey patching a model with clear the output is appended instead of replaced in the same spot, e.g. enterasys.rb
leads to a configuration where the system hardware informations are appended, instead of prefixed to the configuration.
When prepending (prepend:true) there are two hardware outputs in the same spot.
The text was updated successfully, but these errors were encountered: