Discussion:
[rancid] Nxrancid woes
Bob Weaver
2010-03-23 19:50:57 UTC
Permalink
We've been running Rancid for a couple years now on some pretty standard Cisco gear and the powers that be decided it was time to throw some Nexus switches into the mix. Seems like some strange things happen with these ones. We figured out that the service account Rancid uses to log in had to have a certain privilege level to execute some commands so that fixed our initial issues. But I'm still having some troubles.

I've done quite a bit of searching around and narrowed the main problem down to the 'show version' command. It would appear that it does not have an EOL or something like that so the command that immediately follows it in the list appears to fail. In the debug output below I can see the first two commands then it appears to skip the 'show environment fan' which is right after the 'show version' in the command list then reports that it failed. If I comment out the 'show environment fan' command then the 'show environment temp' command becomes the missing one and so on. This is what leads me to believe that the 'show version' command is not "finishing clean" or however that should be stated. Do I need to add some regex to the ShowVersion subroutine to watch for some text in the lower portion of the 'show version' command to "tell" the script that it's over and good or something similar or am I way off track with all this?

Here's the debug output (slightly shortened):

# nxrancid -d x.x.x.x

executing clogin -t 90 -c"term no monitor-force;show version;show environment fan;show environment temperature;show environment power; ...<snipped>..." x.x.x.x
PROMPT MATCH: NY4-CORE-SW01#
HIT COMMAND:NY4-CORE-SW01# term no monitor-force
In RunCommand: NY4-CORE-SW01# term no monitor-force
HIT COMMAND:NY4-CORE-SW01# show version
In ShowVersion: NY4-CORE-SW01# show version
TYPE = NXOS
HIT COMMAND:NY4-CORE-SW01# show environment temperature
In ShowEnvTemp: NY4-CORE-SW01# show environment temperature
HIT COMMAND:NY4-CORE-SW01# show environment power
In ShowEnv: NY4-CORE-SW01# show environment power
... <snipped> ...
HIT COMMAND:NY4-CORE-SW01# show running-config
In WriteTerm: NY4-CORE-SW01# show running-config
192.168.128.4: found exit
192.168.128.4: missed cmd(s): show environment fan

Any light that could be shed on this is appreciated.

Thanks,
Bob Weaver
john heasley
2010-03-23 20:36:11 UTC
Permalink
Post by Bob Weaver
We've been running Rancid for a couple years now on some pretty standard Cisco gear and the powers that be decided it was time to throw some Nexus switches into the mix. Seems like some strange things happen with these ones. We figured out that the service account Rancid uses to log in had to have a certain privilege level to execute some commands so that fixed our initial issues. But I'm still having some troubles.
I've done quite a bit of searching around and narrowed the main problem down to the 'show version' command. It would appear that it does not have an EOL or something like that so the command that immediately follows it in the list appears to fail. In the debug output below I can see the first two commands then it appears to skip the 'show environment fan' which is right after the 'show version' in the command list then reports that it failed. If I comment out the 'show environment fan' command then the 'show environment temp' command becomes the missing one and so on. This is what leads me to believe that the 'show version' command is not "finishing clean" or however that should be stated. Do I need to add some regex to the ShowVersion subroutine to watch for some text in the lower portion of the 'show version' command to "tell" the script that it's over and good or something similar or am I way off track with all this?
its probably that show environment clock o/p changed and ShowEnv is eat
that and the show environment fan o/p. but, why isnt obvious. if you
provide the hostname.raw file from NOPIPE=YES;export NOPIPE;nxrancid -d
hostname, that will help find the problem.
Post by Bob Weaver
# nxrancid -d x.x.x.x
executing clogin -t 90 -c"term no monitor-force;show version;show environment fan;show environment temperature;show environment power; ...<snipped>..." x.x.x.x
PROMPT MATCH: NY4-CORE-SW01#
HIT COMMAND:NY4-CORE-SW01# term no monitor-force
In RunCommand: NY4-CORE-SW01# term no monitor-force
HIT COMMAND:NY4-CORE-SW01# show version
In ShowVersion: NY4-CORE-SW01# show version
TYPE = NXOS
HIT COMMAND:NY4-CORE-SW01# show environment temperature
In ShowEnvTemp: NY4-CORE-SW01# show environment temperature
HIT COMMAND:NY4-CORE-SW01# show environment power
In ShowEnv: NY4-CORE-SW01# show environment power
... <snipped> ...
HIT COMMAND:NY4-CORE-SW01# show running-config
In WriteTerm: NY4-CORE-SW01# show running-config
192.168.128.4: found exit
192.168.128.4: missed cmd(s): show environment fan
Any light that could be shed on this is appreciated.
Thanks,
Bob Weaver
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Bob Weaver
2010-03-23 20:57:48 UTC
Permalink
We noticed early on that 'show environment clock' didn't work, on our Nexus switches anyway so it's been commented out from the beginning. I've used clogin to connect as our service.rancid user and tested all the other commands that aren't commented out and they work just fine from the console.

I took a look at the .raw file and the output looks to me normal to me. The output of all the commands was there. The snipped below is the tail end of 'show version' and the head end of 'show environment fan'. I don't see anything that looks wrong but then I don't really know what I'm looking for either. Is it a problem that the 'MNY4-CORE-SW01# show environment fan' entry is attached to the end of the 'Core Plugin, Ethernet Plugin' part rather than being on its own line (newline)? Does that indicate that it thinks the '... fan' command was part of the 'show version' somehow?

Kernel uptime is 206 day(s), 0 hour(s), 16 minute(s), 28 second(s)^M
^M
Last reset ^M
Reason: Unknown^M
System version: 4.0(1a)N2(1)^M
Service: ^M
^M
plugin^M
Core Plugin, Ethernet Plugin^MNY4-CORE-SW01# show environment fan^M^M
^M
^M
Fan:^M
------------------------------------------------------^M
Fan Model Hw Status^M
------------------------------------------------------^M
Chassis-1 N5K-C5020-FAN -- ok^M
Chassis-2 N5K-C5020-FAN -- ok^M

Bob Weaver

Ps, sorry about that first message in HTML format. I reloaded my computer last week and forgot to force Outlook back to plain text like I generally do.
Post by Bob Weaver
Post by Bob Weaver
We've been running Rancid for a couple years now on some pretty
standard Cisco gear and the powers that be decided it was time to throw
some Nexus switches into the mix. Seems like some strange things happen
with these ones. We figured out that the service account Rancid uses to
log in had to have a certain privilege level to execute some commands
so that fixed our initial issues. But I'm still having some troubles.
Post by Bob Weaver
I've done quite a bit of searching around and narrowed the main
problem down to the 'show version' command. It would appear that it
does not have an EOL or something like that so the command that
immediately follows it in the list appears to fail. In the debug output
below I can see the first two commands then it appears to skip the
'show environment fan' which is right after the 'show version' in the
command list then reports that it failed. If I comment out the 'show
environment fan' command then the 'show environment temp' command
becomes the missing one and so on. This is what leads me to believe
that the 'show version' command is not "finishing clean" or however
that should be stated. Do I need to add some regex to the ShowVersion
subroutine to watch for some text in the lower portion of the 'show
version' command to "tell" the script that it's over and good or
something similar or am I way off track with all this?
its probably that show environment clock o/p changed and ShowEnv is eat
that and the show environment fan o/p. but, why isnt obvious. if you
provide the hostname.raw file from NOPIPE=YES;export NOPIPE;nxrancid -d
hostname, that will help find the problem.
Post by Bob Weaver
# nxrancid -d x.x.x.x
executing clogin -t 90 -c"term no monitor-force;show version;show
environment fan;show environment temperature;show environment power;
...<snipped>..." x.x.x.x
Post by Bob Weaver
PROMPT MATCH: NY4-CORE-SW01#
HIT COMMAND:NY4-CORE-SW01# term no monitor-force
In RunCommand: NY4-CORE-SW01# term no monitor-force
HIT COMMAND:NY4-CORE-SW01# show version
In ShowVersion: NY4-CORE-SW01# show version
TYPE = NXOS
HIT COMMAND:NY4-CORE-SW01# show environment temperature
In ShowEnvTemp: NY4-CORE-SW01# show environment temperature
HIT COMMAND:NY4-CORE-SW01# show environment power
In ShowEnv: NY4-CORE-SW01# show environment power
... <snipped> ...
HIT COMMAND:NY4-CORE-SW01# show running-config
In WriteTerm: NY4-CORE-SW01# show running-config
192.168.128.4: found exit
192.168.128.4: missed cmd(s): show environment fan
Any light that could be shed on this is appreciated.
Thanks,
Bob Weaver
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Per-Olof Olsson
2010-03-24 06:23:14 UTC
Permalink
Hello


Also running nexus 5000 that not work with nxrancid.

I see that parsing of 'show version' don't exit.
Add force exit by
return(1) if /Core Plugin, Ethernet Plugin/;

Also update ShowEnvTemp. Nexus5000 differ in output format!


All exit triggers have to be updated

-------------------------
nx-sw1# show klsf
^
% Invalid command at '^' marker.
------------------------

Error text are not trigging subroutine exit!


Include my just now running test of "nx5rancid"



/Peo
Post by Bob Weaver
We noticed early on that 'show environment clock' didn't work, on our Nexus switches anyway so it's been commented out from the beginning. I've used clogin to connect as our service.rancid user and tested all the other commands that aren't commented out and they work just fine from the console.
I took a look at the .raw file and the output looks to me normal to me. The output of all the commands was there. The snipped below is the tail end of 'show version' and the head end of 'show environment fan'. I don't see anything that looks wrong but then I don't really know what I'm looking for either. Is it a problem that the 'MNY4-CORE-SW01# show environment fan' entry is attached to the end of the 'Core Plugin, Ethernet Plugin' part rather than being on its own line (newline)? Does that indicate that it thinks the '... fan' command was part of the 'show version' somehow?
Kernel uptime is 206 day(s), 0 hour(s), 16 minute(s), 28 second(s)^M
^M
Last reset ^M
Reason: Unknown^M
System version: 4.0(1a)N2(1)^M
Service: ^M
^M
plugin^M
Core Plugin, Ethernet Plugin^MNY4-CORE-SW01# show environment fan^M^M
^M
^M
Fan:^M
------------------------------------------------------^M
Fan Model Hw Status^M
------------------------------------------------------^M
Chassis-1 N5K-C5020-FAN -- ok^M
Chassis-2 N5K-C5020-FAN -- ok^M
Bob Weaver
Ps, sorry about that first message in HTML format. I reloaded my computer last week and forgot to force Outlook back to plain text like I generally do.
Post by Bob Weaver
Post by Bob Weaver
We've been running Rancid for a couple years now on some pretty
standard Cisco gear and the powers that be decided it was time to throw
some Nexus switches into the mix. Seems like some strange things happen
with these ones. We figured out that the service account Rancid uses to
log in had to have a certain privilege level to execute some commands
so that fixed our initial issues. But I'm still having some troubles.
Post by Bob Weaver
I've done quite a bit of searching around and narrowed the main
problem down to the 'show version' command. It would appear that it
does not have an EOL or something like that so the command that
immediately follows it in the list appears to fail. In the debug output
below I can see the first two commands then it appears to skip the
'show environment fan' which is right after the 'show version' in the
command list then reports that it failed. If I comment out the 'show
environment fan' command then the 'show environment temp' command
becomes the missing one and so on. This is what leads me to believe
that the 'show version' command is not "finishing clean" or however
that should be stated. Do I need to add some regex to the ShowVersion
subroutine to watch for some text in the lower portion of the 'show
version' command to "tell" the script that it's over and good or
something similar or am I way off track with all this?
its probably that show environment clock o/p changed and ShowEnv is eat
that and the show environment fan o/p. but, why isnt obvious. if you
provide the hostname.raw file from NOPIPE=YES;export NOPIPE;nxrancid -d
hostname, that will help find the problem.
Post by Bob Weaver
# nxrancid -d x.x.x.x
executing clogin -t 90 -c"term no monitor-force;show version;show
environment fan;show environment temperature;show environment power;
...<snipped>..." x.x.x.x
Post by Bob Weaver
PROMPT MATCH: NY4-CORE-SW01#
HIT COMMAND:NY4-CORE-SW01# term no monitor-force
In RunCommand: NY4-CORE-SW01# term no monitor-force
HIT COMMAND:NY4-CORE-SW01# show version
In ShowVersion: NY4-CORE-SW01# show version
TYPE = NXOS
HIT COMMAND:NY4-CORE-SW01# show environment temperature
In ShowEnvTemp: NY4-CORE-SW01# show environment temperature
HIT COMMAND:NY4-CORE-SW01# show environment power
In ShowEnv: NY4-CORE-SW01# show environment power
... <snipped> ...
HIT COMMAND:NY4-CORE-SW01# show running-config
In WriteTerm: NY4-CORE-SW01# show running-config
192.168.128.4: found exit
192.168.128.4: missed cmd(s): show environment fan
Any light that could be shed on this is appreciated.
Thanks,
Bob Weaver
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
john heasley
2010-03-24 21:11:38 UTC
Permalink
Post by Per-Olof Olsson
Hello
Also running nexus 5000 that not work with nxrancid.
I see that parsing of 'show version' don't exit.
Add force exit by
return(1) if /Core Plugin, Ethernet Plugin/;
Also update ShowEnvTemp. Nexus5000 differ in output format!
please try the attached. if this doesn't work, please send the .raw file
as described below to me.
Post by Per-Olof Olsson
Post by john heasley
if you
provide the hostname.raw file from NOPIPE=YES;export NOPIPE;nxrancid -d
hostname, that will help find the problem.
Loading...