[rancid] excluding output from cisco routers and switches

allonon allonon at gmail.com
Wed Jan 6 05:23:20 UTC 2016


With further digging, I found out that part of this code to remove the 
fluctuating wattage is in the nxos.pm module but the code is based on a 
different output than what I am getting from our Nexus hardware.

So now to figure out how the existing code is actually stripping the 
wattage and adjust it for my output

On 1/4/16 16:32, rdrake wrote:
> On 01/04/2016 03:16 PM, allonon wrote:
>> I wanted to start a different topic as mine is not about flash or
>> bootflash.
>>
>> I have a similar issue with nexus output and want to prevent diff
>> emails but I want the data in the the saved config.  One of switches
>> will constantly adjust output watts by a few points.
>>
>>
>>   !Env: -------  -------------------  ----------  ----------
>>  ----------  --------------
>> - !Env: 1        N9K-PAC-650W-B             67 W           649 W     Ok
>> - !Env: 2        N9K-PAC-650W-B             71 W           649 W     Ok
>> + !Env: 1        N9K-PAC-650W-B             68 W           649 W     Ok
>> + !Env: 2        N9K-PAC-650W-B             70 W           649 W     Ok
>>
>>

> The multiple greps in that example are for different commands they want
> to match and exclude.  You can do something like this:
>
> DIFF=`cat $TMP.diff | grep -Ev "[ +-] \!Env: [0-9]"`
>
> You can test if your regex is working by making a fake diff and seeing
> if the grep matches :
> [rdrake at test ~]$ cat test.in | grep -E "[ +-] \!Env: [0-9]"
> - !Env: 1        N9K-PAC-650W-B             67 W 649 W     Ok
> - !Env: 2        N9K-PAC-650W-B             71 W 649 W     Ok
> + !Env: 1        N9K-PAC-650W-B             68 W 649 W     Ok
> + !Env: 2        N9K-PAC-650W-B             70 W 649 W     Ok
>
> [rdrake at test ~]$ cat test.in | grep -Ev "[ +-] \!Env: [0-9]"
>    !Env: -------  -------------------  ----------  ----------
> ----------  --------------
>
> (if you want to get rid of this line too you can use this)
>
> [rdrake at test ~]$ cat test.in | grep -Ev "[ +-] \!Env: [0-9-]"
> [rdrake at test ~]$
>
>
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>


More information about the Rancid-discuss mailing list