[rancid] Setup issue
Michael T. Voity
mvoity at uvm.edu
Mon May 5 17:47:53 UTC 2014
Alan,
I got things working for my cisco-xr devices with RANCID. I did a
bunch of debugging and tweaking to get it all dialed in.
OS level I did this globally -
export NOPIPE=YES
export PATH $PATH:/usr/local/rancid/bin
I determined that things were timing out when it would run the command
'admin show env all' and then fail the rest of the command.
I then commented out 'cisco-xr;command;iosxr::ShowEnv;admin show env
all' in '/usr/local/rancid/etc/rancid.types.base'
Once this was commented out, all is well and it works perfect!
Thank you to Alan and Heasley for all your guidance in getting this fixed!
-Mike
Michael T. Voity
Network Engineer
University of Vermont
On 5/4/14, 4:12 PM, Alan McKinnon wrote:
> Hi Michael,
>
> By themselves those errors are not harmful (rancid can deal with them).
> To show why, I need to backtrack a bit and explain how the code is
> organised. This applies to 2.3.x I haven't read 3.0 enough to comment much.
>
> A text dump of a login session running commands show the structure:
> a text prompt, followed by the prompt character (> or #) then the
> command run, a newline, followed by the command output. Repeat for all
> commands. Finally, and exit, quit or similar command and the end of the
> text.
>
> The rancid script starts by skipping over everything from the beginning
> till it finds the defined prompt character. It records that text as the
> separator between the end of one command and the start of the next. The
> command run is immediately after on the same line which it looks up in
> @command and the value of that key is the sub to pass the text to. The
> script passes all text it finds to the sub until it hits the next
> prompt; and the cycle repeats.
>
> Two things can go wrong here:
> - A peculiar prompt that confuses the script[1]
> - the sub is in a while or other loop when that command output ends,
> without this the code that detects the prompt does not run when it must.
> The rule is that the command subs must be running their top-level code
> when the command exits.
>
> My first guess is that the command before those that didn't run is not
> exiting cleanly. Run this:
>
> clogin -t 90 -c "show version;show memory;show diag"
>
> and look for oddities in the output.
>
> Ordinarily a failed command is not a problem. The script looks for error
> messages and if it finds say "command not authorized" it simply skips
> over it and continues with the next one.
>
>
>
> [1]As an example I had a weird bug once with Cisco that didn;t run
> classic IOS. A command "show admin "something-or-other" didn't have a
> trailing newline in the output; all other commands were correct. My
> solution is to comment that command out - for me the output isn't
> especially useful in any way.
>
>
>
> On 03/05/2014 13:45, Michael T. Voity wrote:
>> Alan,
>>
>> I ran the xrancid and was given this -
>>
>> [rancid at netwatch bin]$ ./xrancid -d watt-uvm-gw3-200.3.uvm.edu
>> executing clogin -t 90 -c "show version;show memory;show diag;show
>> switch;show slot;show configuration detail;show configuration"
>> watt-uvm-gw3-200.3.uvm.edu
>> sh: clogin: command not found
>> watt-uvm-gw3-200.3.uvm.edu: missed cmd(s): all commands
>> watt-uvm-gw3-200.3.uvm.edu: End of run not found
>> watt-uvm-gw3-200.3.uvm.edu: End of run not found
>>
>> Then I ran just -
>>
>> ./clogin -t 90 -c "show version;show memory;show diag;show switch;show
>> slot;show configuration detail;show configuration"
>> watt-uvm-gw3-200.3.uvm.edu
>>
>> And determined that- show switch;show slot;show configuration
>> detail;show configuration did not run.
>>
>>
>> Ideas?
>>
>> -Mike
>>
>>
>> Michael T. Voity
>> Network Engineer
>> University of Vermont
>>
>> On 5/3/14, 2:43 AM, Alan McKinnon wrote:
>>> That's the standard log message you posted; for debugging purposes it's
>>> not especially useful. It's telling you that stuff didn't work and then
>>> lists all the stuff that didn't work. It doesn't indicate why.
>>>
>>> Run the parser script directly in debug mode to find out what's really
>>> going on.
>>>
>>> xrrancid -d <hostname>
>>>
>>>
>>> This might not give you the real failure yet, but it will narrow it down
>>> to which area the problem happens in.
>>>
>>>
>>> On 02/05/2014 21:11, Michael T. Voity wrote:
>>>> Hello,
>>>>
>>>> I'm new to the RANCID realm. Before posting to this list I have done
>>>> my research and cannot quite seem to get the right answer to my issue.
>>>>
>>>> I'm trying to get RANCID to work with my Cisco ASR9001 which has
>>>> ios-xr -
>>>>
>>>> In the log file i get these messages -
>>>>
>>>> Trying to get all of the configs.
>>>> swick-uvm-gw2: missed cmd(s): dir /all disk1a:,admin show diag,dir /all
>>>> slavedisk2:,dir /all sec-slot2:,dir /all disk1:,dir /all sec-nvram:,dir
>>>> /all disk2:,dir /all sec-bootflash:,dir /all slaveslot2:,dir /all
>>>> disk0:,dir /all compactflasha:,dir /all slaveslot0:,dir /all
>>>> sec-slot1:,dir /all harddiska:,dir /all slavenvram:,dir /all
>>>> sec-disk2:,dir /all sec-disk0:,dir /all harddiskb:,dir /all
>>>> slavedisk1:,show controllers,show rpl maximum,dir /all slavedisk0:,show
>>>> debug,dir /all bootflash:,dir /all sec-slot0:,dir /all sec-disk1:,dir
>>>> /all disk0a:,dir /all slot2:,dir /all compactflash:,dir /all
>>>> harddisk:,dir /all slot0:,admin show running,show vlan,dir /all
>>>> slavebootflash:,dir /all slaveslot1:,dir /all nvram:,admin show
>>>> inventory raw,show running-config,dir /all slot1:
>>>> swick-uvm-gw2: End of run not found
>>>> !
>>>> watt-uvm-gw3: missed cmd(s): dir /all disk1a:,admin show diag,dir /all
>>>> slavedisk2:,dir /all sec-slot2:,dir /all disk1:,dir /all sec-nvram:,dir
>>>> /all disk2:,dir /all sec-bootflash:,dir /all slaveslot2:,dir /all
>>>> disk0:,dir /all compactflasha:,dir /all slaveslot0:,dir /all
>>>> sec-slot1:,dir /all harddiska:,dir /all slavenvram:,dir /all
>>>> sec-disk2:,dir /all sec-disk0:,dir /all harddiskb:,dir /all
>>>> slavedisk1:,show controllers,show rpl maximum,dir /all slavedisk0:,show
>>>> debug,dir /all bootflash:,dir /all sec-slot0:,dir /all sec-disk1:,dir
>>>> /all disk0a:,dir /all slot2:,dir /all compactflash:,dir /all
>>>> harddisk:,dir /all slot0:,admin show running,show vlan,dir /all
>>>> slavebootflash:,dir /all slaveslot1:,dir /all nvram:,admin show
>>>> inventory raw,show running-config,dir /all slot1:
>>>> watt-uvm-gw3: End of run not found
>>>> !
>>>>
>>>>
>>>> When i switch it from ios-xr to ios in the router.db file, it works, but
>>>> every time I run the rancid-run it gives me a huge diff of the ios-xr
>>>> routers.
>>>>
>>>> I have also un-commented NOPIPE=YES; export NOPIPE
>>>>
>>>> I have setup my ios-xr routers in a separate group.
>>>>
>>>> Still no dice.
>>>>
>>>> I have a separate group for my ios devices that is working fine.
>>>>
>>>> ideas?
>>>>
>>>> -Mike
>>>>
>> _______________________________________________
>> 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