Mailing List Archive

Questions about sub ProcessHistory
I’m trying to get my Aruba Instant access points to be backed up by rancid and I’m using the module developed by miken32, but it really doesn’t support a lot of the Aruba stuff that I have. I’m trying to add a few extra functions into the perl module, but have run into some difficulty with `sub ProcessHistory` in rancid.pm. I’ve read the description, but am not understanding the third argument.

For example:
ProcessHistory("COMMENTS","keysort","D99","!$_"); (from the aruba.pm file)

Or

ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") (from the ios.pm file)

What is the function of the “D99” and “F1” arguments and how do I leverage them for my own function? And, what is the string in the last argument used for?

Thanks,
Chris


Chris Gauthier Senior Network Engineer | comScore, Inc.
t +1 (503) 331-2704 |
cgauthier@comscore.com
317 SW Alder Street, Suite 700 | Portland, OR 97204 United States
comscore.com
???This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system and notify sender.
Re: Questions about sub ProcessHistory [ In reply to ]
Thu, Apr 05, 2018 at 05:55:57PM +0000, Gauthier, Chris:
> I’m trying to get my Aruba Instant access points to be backed up by rancid and I’m using the module developed by miken32, but it really doesn’t support a lot of the Aruba stuff that I have. I’m trying to add a few extra functions into the perl module, but have run into some difficulty with `sub ProcessHistory` in rancid.pm. I’ve read the description, but am not understanding the third argument.
>
> For example:
> ProcessHistory("COMMENTS","keysort","D99","!$_"); (from the aruba.pm file)
>
> Or
>
> ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") (from the ios.pm file)
>
> What is the function of the “D99” and “F1” arguments and how do I leverage them for my own function? And, what is the string in the last argument used for?

3rd arg is the argument to the 2nd arg, for keysort, its the key. 4th
arg is data/payload to be stored and later output.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Questions about sub ProcessHistory [ In reply to ]
Thanks,

That helps, but does not completely help me understand what values are "valid" in the 3rd arg. I couldn't quite figure it out from the code. I tried. I looked at the man page, different sections of the source, but it's just not making sense.

And, sorry all for always adding the corporate signature. Have no control over it, including no ability to change it or turn it off. The worst part is it always turns my email from plain-text to HTML. :(

Chris


?
Chris Gauthier Senior Network Engineer | comScore, Inc.
t +1 (503) 331-2704 |
cgauthier@comscore.com
317 SW Alder Street, Suite 700 | Portland, OR 97204 United States
comscore.com
???This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system and notify sender.
-----Original Message-----
From: heasley <heas@shrubbery.net>
Date: Thursday, April 5, 2018 at 12:53 PM
To: "Gauthier, Chris" <cgauthier@comscore.com>
Cc: "rancid-discuss@shrubbery.net" <rancid-discuss@shrubbery.net>
Subject: Re: [rancid] Questions about sub ProcessHistory

Thu, Apr 05, 2018 at 05:55:57PM +0000, Gauthier, Chris:
> I’m trying to get my Aruba Instant access points to be backed up by rancid and I’m using the module developed by miken32, but it really doesn’t support a lot of the Aruba stuff that I have. I’m trying to add a few extra functions into the perl module, but have run into some difficulty with `sub ProcessHistory` in rancid.pm. I’ve read the description, but am not understanding the third argument.
>
> For example:
> ProcessHistory("COMMENTS","keysort","D99","!$_"); (from the aruba.pm file)
>
> Or
>
> ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") (from the ios.pm file)
>
> What is the function of the “D99” and “F1” arguments and how do I leverage them for my own function? And, what is the string in the last argument used for?

3rd arg is the argument to the 2nd arg, for keysort, its the key. 4th
arg is data/payload to be stored and later output.
Re: Questions about sub ProcessHistory [ In reply to ]
Thu, Apr 05, 2018 at 08:18:57PM +0000, Gauthier, Chris:
> That helps, but does not completely help me understand what values are "valid" in the 3rd arg. I couldn't quite figure it out from the code. I tried. I looked at the man page, different sections of the source, but it's just not making sense.

a string; a number should also work but with keynsort.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Questions about sub ProcessHistory [ In reply to ]
So, more specifically, how is that string used as an argument? What's the significance of the "D99" or the "F1" or whatever the other value is? That's the part I'm not sure about. I want to leverage the ProcessHistory function with the keysort, but don't know what the argument value should be or how I determine what it should be.

Thanks,
Chris


?
Chris Gauthier Senior Network Engineer | comScore, Inc.
t +1 (503) 331-2704 |
cgauthier@comscore.com
317 SW Alder Street, Suite 700 | Portland, OR 97204 United States
comscore.com
???This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system and notify sender.
-----Original Message-----
From: heasley <heas@shrubbery.net>
Date: Thursday, April 5, 2018 at 1:58 PM
To: "Gauthier, Chris" <cgauthier@comscore.com>
Cc: heasley <heas@shrubbery.net>, "rancid-discuss@shrubbery.net" <rancid-discuss@shrubbery.net>
Subject: Re: [rancid] Questions about sub ProcessHistory

Thu, Apr 05, 2018 at 08:18:57PM +0000, Gauthier, Chris:
> That helps, but does not completely help me understand what values are "valid" in the 3rd arg. I couldn't quite figure it out from the code. I tried. I looked at the man page, different sections of the source, but it's just not making sense.

a string; a number should also work but with keynsort.
Re: Questions about sub ProcessHistory [ In reply to ]
Thu, Apr 05, 2018 at 09:59:23PM +0000, Gauthier, Chris:
> So, more specifically, how is that string used as an argument? What's the significance of the "D99" or the "F1" or whatever the other value is? That's the part I'm not sure about. I want to leverage the ProcessHistory function with the keysort, but don't know what the argument value should be or how I determine what it should be.

its the sort key. what _is_ sorted.

> Thanks,
> Chris
>
>
> ?
> Chris Gauthier Senior Network Engineer | comScore, Inc.
> t +1 (503) 331-2704 |
> cgauthier@comscore.com
> 317 SW Alder Street, Suite 700 | Portland, OR 97204 United States
> comscore.com
> ???This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system and notify sender.
> -----Original Message-----
> From: heasley <heas@shrubbery.net>
> Date: Thursday, April 5, 2018 at 1:58 PM
> To: "Gauthier, Chris" <cgauthier@comscore.com>
> Cc: heasley <heas@shrubbery.net>, "rancid-discuss@shrubbery.net" <rancid-discuss@shrubbery.net>
> Subject: Re: [rancid] Questions about sub ProcessHistory
>
> Thu, Apr 05, 2018 at 08:18:57PM +0000, Gauthier, Chris:
> > That helps, but does not completely help me understand what values are "valid" in the 3rd arg. I couldn't quite figure it out from the code. I tried. I looked at the man page, different sections of the source, but it's just not making sense.
>
> a string; a number should also work but with keynsort.
>

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Questions about sub ProcessHistory [ In reply to ]
On 4/5/18, Gauthier, Chris <cgauthier@comscore.com> wrote:
> So, more specifically, how is that string used as an argument? What's the
> significance of the "D99" or the "F1" or whatever the other value is?
> That's the part I'm not sure about. I want to leverage the ProcessHistory
> function with the keysort, but don't know what the argument value should be
> or how I determine what it should be.

I remember seeing a better explanation but this was the best I could find:

---------- Forwarded message ----------
From: john heasley <heas@shrubbery.net>
Date: Tue, 28 Sep 2010 15:28:01 -0700
Subject: Re: [rancid] sorting output from custom commands...

ProcessHistory(tag, command, command_arg, data)

data is added the buffer, by command with command_arg (if specified),
unless tag or command has changed since the last call, in which case
the buffer would be flushed before calling command.

a good example, where $aclsort = "ipsort" (the function)

# order access-lists
/^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ &&
ProcessHistory("ACL $1 $2","$aclsort","$3","$_") && next;

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss