[rancid] filtering of show license

Václav Ovsík vaclav.ovsik at i.cz
Tue Jul 12 07:42:40 UTC 2016


On Mon, Jul 11, 2016 at 04:01:56PM +0200, Václav Ovsík wrote:
> > Hi,
> > with Rancid 3.4.1 a new information is digged from IOS using
> >     show license
> > but it contains relative (changing) time :-/ e.g.:
> > 
> >     Index 3 Feature: securityk9
> > 	    Period left: 5  days 7  hours
> > 	    Period Used: 7  weeks 5  days
> > 
> > have anybody already solved this? (change to end-of-license time or so)
> 
> for this time I added only removing:
> 
> @@ -587,6 +587,7 @@
>  	return(0) if (/% license not supported on this device/i);# show lic on old box
>  	return(1) if (/Line has invalid autocommand /);
>  	return(1) if (/(invalid (input|command) detected|type help or )/i);
> +	s/^(\s*Period (?:left|used)):(?:\s*\d+\s*(?:weeks|days|hours))+/$1: <removed>/i;
>  
>  	ProcessHistory("COMMENTS","keysort","LICENSE","! $_");
>      }

singular too :-/

--- ios.pm.orig 2016-05-18 08:09:10.000000000 +0200
+++ ios.pm      2016-07-12 09:35:02.552000000 +0200
@@ -587,6 +587,7 @@
        return(0) if (/% license not supported on this device/i);# show lic on old box
        return(1) if (/Line has invalid autocommand /);
        return(1) if (/(invalid (input|command) detected|type help or )/i);
+       s/^(\s*Period (?:left|used)):(?:\s*\d+\s*(?:weeks?|days?|hours?))+/$1: <removed>/i;
 
        ProcessHistory("COMMENTS","keysort","LICENSE","! $_");
     }

-- 
Zito



More information about the Rancid-discuss mailing list