Discussion:
[rancid] NX-OS and colorized prompts
Gauthier, Chris
2017-07-11 15:11:53 UTC
Permalink
In trying to get my Nexus switches working, I discovered a problem. The colorized prompts on the Nexus switches use ANSI Escape codes. This totally trips out rancid and causes it to miss commands. I verified by turning off the colorization manually that is the issue. I copied the cisco-nx and renamed it in my rancid.types.conf file and added

cisco-nx5600-9000;command;rancid::RunCommand;no term color

right before the line

cisco-nx5600-9000;command;rancid::RunCommand;term no monitor

Rancid timed out after the “no term color” command executed and changed the prompt. Suggestions on how to remedy this within rancid?

--Chris


Chris GauthierSenior Network Engineer | comScore, Inc.
o +1 503-331-***@comscore.com
317 SW Alder St, Suite 500 | Portland | OR97204
............................................................................................................................................................................................................................
heasley
2017-07-11 15:28:50 UTC
Permalink
Post by Gauthier, Chris
In trying to get my Nexus switches working, I discovered a problem. The colorized prompts on the Nexus switches use ANSI Escape codes. This totally trips out rancid and causes it to miss commands. I verified by turning off the colorization manually that is the issue. I copied the cisco-nx and renamed it in my rancid.types.conf file and added
cisco-nx5600-9000;command;rancid::RunCommand;no term color
right before the line
cisco-nx5600-9000;command;rancid::RunCommand;term no monitor
Rancid timed out after the “no term color” command executed and changed the prompt. Suggestions on how to remedy this within rancid?
hold on while i curse for 20 minutes. seriously cisco, what is the utility
of this.

can you disable it by default in the config? Maybe setting a non-color-
supporting TERM would work?
Gauthier, Chris
2017-07-11 17:01:08 UTC
Permalink
Chris GauthierSenior Network Engineer | comScore, Inc.
o +1 503-331-***@comscore.com
317 SW Alder St, Suite 500 | Portland | OR97204
............................................................................................................................................................................................................................

-----Original Message-----
From: heasley <***@shrubbery.net>
Date: Tuesday, July 11, 2017 at 8:28 AM
To: "Gauthier, Chris" <***@comscore.com>
Cc: "rancid-***@shrubbery.net" <rancid-***@shrubbery.net>
Subject: Re: [rancid] NX-OS and colorized prompts
Post by Gauthier, Chris
In trying to get my Nexus switches working, I discovered a problem. The colorized prompts on the Nexus switches use ANSI Escape codes. This totally trips out rancid and causes it to miss commands. I verified by turning off the colorization manually that is the issue. I copied the cisco-nx and renamed it in my rancid.types.conf file and added
cisco-nx5600-9000;command;rancid::RunCommand;no term color
right before the line
cisco-nx5600-9000;command;rancid::RunCommand;term no monitor
Rancid timed out after the “no term color” command executed and changed the prompt. Suggestions on how to remedy this within rancid?
hold on while i curse for 20 minutes. seriously cisco, what is the utility
of this.

can you disable it by default in the config? Maybe setting a non-color-
supporting TERM would work?


It’s disabled by default, but, I do believe rancid should be able to work through this. Btw, I’m running 3.6.2. It’s also an easy to fix on a per-session basis by executing the “no term color” command, which I tried. I suspect the changed prompt threw off rancid since it didn’t match what it saw before. The testing account I am using happens to have it turned on all the time because humans use it and it’s useful.

--Chris
Piegorsch, Weylin William
2017-07-11 20:32:48 UTC
Permalink
As Chris mentioned, the colorization s disabled by default. But, the command “term color persist” will add an entry into a per-user .rc file, which is executed upon login and stored in the bootflash: (you can also manually add additional entries into this file via “echo foo >> bootflash:///user.rc”, I make extensive use of that for my login to build the CLI environment I prefer). Assuming rancid logs in with the credentials of a service account rather than the credentials of a “real” user, this should not be an issue.

As for “what is the utility” – I’ve found this to be highly useful to breakup the output into easily-recognizable blocks, making the output more pleasing to the (er, “my”) eyes while also making it quicker to read. It’s akin to IDEs that colorize software code. Though... I seem to be the only one on my team that likes it.

weylin

-----Original Message-----
From: heasley <***@shrubbery.net>
Date: Tuesday, July 11, 2017 at 11:28
To: "Gauthier, Chris" <***@comscore.com>
Cc: "rancid-***@shrubbery.net" <rancid-***@shrubbery.net>
Subject: Re: [rancid] NX-OS and colorized prompts
Post by Gauthier, Chris
In trying to get my Nexus switches working, I discovered a problem. The colorized prompts on the Nexus switches use ANSI Escape codes. This totally trips out rancid and causes it to miss commands. I verified by turning off the colorization manually that is the issue. I copied the cisco-nx and renamed it in my rancid.types.conf file and added
cisco-nx5600-9000;command;rancid::RunCommand;no term color
right before the line
cisco-nx5600-9000;command;rancid::RunCommand;term no monitor
Rancid timed out after the “no term color” command executed and changed the prompt. Suggestions on how to remedy this within rancid?
hold on while i curse for 20 minutes. seriously cisco, what is the utility
of this.

can you disable it by default in the config? Maybe setting a non-color-
supporting TERM would work?

Loading...