ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.79k stars 921 forks source link

[Procurve] show system power-supply #1453

Closed thanegill closed 6 years ago

thanegill commented 6 years ago

Since #1176 was merged I get flapping configs outputs whenever the wattage changes on my switches.

switch-name# show system power-supply 

Power Supply Status: 

  Member  PS#   Model     Serial      State           AC/DC  + V        Wattage   Max   
  ------- ----- --------- ----------- --------------- ----------------- --------- ------
  1       1     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        48       250
  1       2     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        34       250
  2       1     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        47       250
  2       2     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        33       250
  3       1     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        21       250
  3       2     JL085A    XXXXXXXXXX  Powered         AC 120V/240V        25       250

This is a 3810 stack running 16.02. The Wattage column changes constantly. Almost every time a config is pulled.

It looks like the output on some hp/procurve systems show usage and some don't.

davama commented 6 years ago

@thanegill Noticed that too. Using this gsub for that, might need to mod for you case.

    cfg.gsub! /(^(\s|\s+)[1-4]\s+\S+\s+(\S+|Powered|Not Present)).*/, '\\1'

If you want to undo the PR that's fine too.

thanegill commented 6 years ago

This works for me. Though I'm sure that it would break for other models.

cfg.gsub! /(^\s+\d+\s+\d+\s+\w+\s+\w+\s+\w+\s+\w+\s+\S+)(\s+\w+)(\s+\w+)/, '\\1\\3'

http://rubular.com/r/L5cCVlswEe

rbeumer commented 6 years ago

I have tried the regexes above but Oxidized refuses to start, no logs available (Oxidized 0.24)

davama commented 6 years ago

@rbeumer Typo? How does your config look?

rbeumer commented 6 years ago

@davama My apologies, it seems I was too hasty. When I test it now it works flawlessly.

RaceFPV commented 6 years ago

Just updating to let everyone know I saw the same issue as well with Aruba switches across multiple models and the gsub provided by davama cleaned it up enough that I don't get config changes at every wattage uptick/downtick.

davama commented 6 years ago

If you want to undo the PR that's fine too.

As i mentioned before we can undo it, if that is the consensus.

Now our setup uses custom models with our own edits so having 'show system....' is not needed since we can easily add to our own model. https://github.com/ytti/oxidized/issues/1384

It was originally added to the distribution model to have all hardware info within the config backup but with custom models now it's not really needed.

Whatever is decided is fine

laf commented 6 years ago

Seems like it would be worthwhile having a PR for the gsub fix if someone can do that?

no-response[bot] commented 6 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. The information that is currently in the issue is insufficient to take further action. Feel free to re-open this issue if additional information becomes available, or if you believe it has been closed in error.

systeembeheerder commented 6 years ago

@laf I tried both gusbs but still have "Watt updates". My vote would be to remove #1176