Re: [rancid] Questions about sub ProcessHistory

2018-04-05 Thread Lee
On 4/5/18, Gauthier, Chris  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 
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


Re: [rancid] Questions about sub ProcessHistory

2018-04-05 Thread heasley
Thu, Apr 05, 2018 at 09:59:23PM +, 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 |
> cgauth...@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 
> Date: Thursday, April 5, 2018 at 1:58 PM
> To: "Gauthier, Chris" 
> Cc: heasley , "rancid-discuss@shrubbery.net" 
> 
> Subject: Re: [rancid] Questions about sub ProcessHistory
> 
> Thu, Apr 05, 2018 at 08:18:57PM +, 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: [rancid] Questions about sub ProcessHistory

2018-04-05 Thread 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.

Thanks,
Chris



Chris Gauthier Senior Network Engineer | comScore, Inc.
t +1 (503) 331-2704 |
cgauth...@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 
Date: Thursday, April 5, 2018 at 1:58 PM
To: "Gauthier, Chris" 
Cc: heasley , "rancid-discuss@shrubbery.net" 

Subject: Re: [rancid] Questions about sub ProcessHistory

Thu, Apr 05, 2018 at 08:18:57PM +, 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: [rancid] Questions about sub ProcessHistory

2018-04-05 Thread heasley
Thu, Apr 05, 2018 at 08:18:57PM +, 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: [rancid] Questions about sub ProcessHistory

2018-04-05 Thread heasley
Thu, Apr 05, 2018 at 05:55:57PM +, 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

[rancid] Questions about sub ProcessHistory

2018-04-05 Thread 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?

Thanks,
Chris


Chris Gauthier Senior Network Engineer | comScore, Inc.
t +1 (503) 331-2704 |
cgauth...@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.
___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Re: [rancid] fortigate fnlogin problem (and a workaround)

2018-04-05 Thread Natxo Asenjo
On Thu, Apr 5, 2018 at 11:00 AM, Ak Sn  wrote:

> Hi
>
> I had the same error. See the message http://www.shrubbery.net/
> pipermail/rancid-discuss/2018-April/010180.html from heasly
> rancid 3.7 and the changed fnlogin file from 3.99 works perfect in my
> setup!
>
> ftp://ftp.shrubbery.net/pub/rancid/alpha/rancid-3.99.99.tar.gz
>

Awesome, thanks for the link.

I was no longer on the list, so I missed that message ;-)

 --
regards,
Natxo
___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Re: [rancid] fortigate fnlogin problem (and a workaround)

2018-04-05 Thread heasley
Thu, Apr 05, 2018 at 11:00:30AM +0200, Ak Sn:
> Hi
> 
> I had the same error. See the message
> http://www.shrubbery.net/pipermail/rancid-discuss/2018-April/010180.html
> from heasly
> rancid 3.7 and the changed fnlogin file from 3.99 works perfect in my setup!
> 
> ftp://ftp.shrubbery.net/pub/rancid/alpha/rancid-3.99.99.tar.gz

Sorry; this will be 3.8 soonish.  i have 2 things remaining to fix/add
before cutting 3.8.

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


Re: [rancid] fortigate fnlogin problem (and a workaround)

2018-04-05 Thread Ak Sn
Hi

I had the same error. See the message
http://www.shrubbery.net/pipermail/rancid-discuss/2018-April/010180.html
from heasly
rancid 3.7 and the changed fnlogin file from 3.99 works perfect in my setup!

ftp://ftp.shrubbery.net/pub/rancid/alpha/rancid-3.99.99.tar.gz

BR
Alex

2018-04-05 8:21 GMT+02:00 Natxo Asenjo :

> hi,
>
> I have a working installation of rancid (3.6.2) running on Ubuntu 16.04
> and I need to migrate the application to Centos 7.
>
> So I decided to upgrade rancid as well to version 3.7.
>
> The fortigate fnlogin scripts of 3.7 is not working properly with our
> fortinets (we do not have a lot of them, but the ones we have give a
> timeout.
>
> 3.6.2 working:
> ## $Id: fnlogin.in 3519 2016-12-01 00:23:58Z heas $
>
> 3.7 not working
> ## $Id: fnlogin.in 3718 2017-07-20 17:14:42Z heas $
>
>
> This is a piece of the log:
>
> starting: Thu Apr 5 07:50:42 CEST 2018
>
>
>
> Trying to get all of the configs.
> 94.142.211.65: missed cmd(s): all commands
> 94.142.211.65: End of run not found
> 94.142.211.65 fnlogin error: Error: TIMEOUT reached
>
> =
> Getting missed routers: round 1.
> xx.xx.xx.xx: missed cmd(s): all commands
> xx.xx.xx.xx: End of run not found
> xx.xx.xx.xx fnlogin error: Error: TIMEOUT reached
>
>
> If I replace fnlogin in the centos box (3.7) with the one in 3.6.2,
> everything works great.
>
> The fortinet is:
>
> #Version: FortiGate-600D v5.2.11,build0754,170421 (GA)
>
> not running the latest firmware, but wil do soon.
>
> For us this is not a problem as it's working, but maybe someone else could
> find this interesting to know.
>
> --
> Groeten,
> natxo
>
> ___
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
>
___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

[rancid] fortigate fnlogin problem (and a workaround)

2018-04-05 Thread Natxo Asenjo
hi,

I have a working installation of rancid (3.6.2) running on Ubuntu 16.04 and
I need to migrate the application to Centos 7.

So I decided to upgrade rancid as well to version 3.7.

The fortigate fnlogin scripts of 3.7 is not working properly with our
fortinets (we do not have a lot of them, but the ones we have give a
timeout.

3.6.2 working:
## $Id: fnlogin.in 3519 2016-12-01 00:23:58Z heas $

3.7 not working
## $Id: fnlogin.in 3718 2017-07-20 17:14:42Z heas $


This is a piece of the log:

starting: Thu Apr 5 07:50:42 CEST 2018



Trying to get all of the configs.
94.142.211.65: missed cmd(s): all commands
94.142.211.65: End of run not found
94.142.211.65 fnlogin error: Error: TIMEOUT reached

=
Getting missed routers: round 1.
xx.xx.xx.xx: missed cmd(s): all commands
xx.xx.xx.xx: End of run not found
xx.xx.xx.xx fnlogin error: Error: TIMEOUT reached


If I replace fnlogin in the centos box (3.7) with the one in 3.6.2,
everything works great.

The fortinet is:

#Version: FortiGate-600D v5.2.11,build0754,170421 (GA)

not running the latest firmware, but wil do soon.

For us this is not a problem as it's working, but maybe someone else could
find this interesting to know.

--
Groeten,
natxo
___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss