oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

RegEx to Hide Fan Speed & RPM for Aruba 6200 series switches.

Open vppencilsharpener opened this issue 3 years ago • 1 comments

I have a handful of Aruba 6200F series switches running firmware ML.10.09.1010 that are not properly masking fan information which is creating a lot of unnecessary commits.

It has been a while since I created a RegEx pattern for Oxidized and I need a little help getting it right.

The logged fan information looks like this: ! Fan information ! ------------------------------------------------------------------------------ ! Location- Product Serial Number Speed Direction Status RPM ! Mbr/Slot/Fan Name ! ------------------------------------------------------------------------------ ! System-1/1/1 N/A N/A slow left-to-back ok 4203
! System-1/1/2 N/A N/A slow left-to-back ok 4174
! System-1/1/3 N/A N/A slow left-to-back ok 4156
! System-2/1/1 N/A N/A slow left-to-back ok 4119
! System-2/1/2 N/A N/A slow left-to-back ok 4115
! System-2/1/3 N/A N/A slow left-to-back ok 4185

The RegEx and substitution line I came up with looks like this: cfg.gsub! /^(System-\d\/\d\/\d\s+)(\S+\s+\S+\s+)(\S+)(\s+\S+\s+\S+\s+)(\d{1,4})$/, '\\1 \\2 <speed> \\4 <rpm>'

In testing the RegEx using 3rd party tools it appears to work as intended, but I'm not having luck getting it to work within my Oxidized environment.

Any help would be appreciated.

If this can be resolved, I am more than willing to submit the final revision as a pull request.

vppencilsharpener avatar Aug 23 '22 21:08 vppencilsharpener

Just realized this might be part of pull request #2565, which is masking the entire result, not just the speed and RPM that I was trying to hide.

vppencilsharpener avatar Aug 26 '22 17:08 vppencilsharpener