[rancid] Re: Netscreen: nlogin file 'set console page 0'
Skinner, Michael
Michael.Skinner at virginmedia.co.uk
Wed Nov 12 10:37:11 UTC 2008
It is possible for rancid to deal with the pager on netscreens. In my
infrastructure rancid has read only accounts on devices, so has no
ability to edit the console page, it gets on fine... admittedly I had to
hack the code a bit, as the build in read-only support was broken.
Problem and fix when originally discovered:
http://www.shrubbery.net/pipermail/rancid-discuss/2007-May/002224.html
Paul Zimmerman took the trouble to tidy this up further, details at
bottom of email
There is no reason this method couldn't be used for read/write accounts.
Mike
[rancid at caillez ~/local/libexec/rancid]$ sccs diffs -C8 -r1.2 nrancid
------- nrancid -------
*** - Mon Jul 23 09:20:57 2007
--- nrancid Mon Jul 23 09:17:18 2007
***************
*** 141,160 ****
}
# This routine parses "get system"
sub GetSystem {
print STDERR " In GetSystem: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
last if(/$prompt/);
- # throw away the pager lines
- next if /^--- more ---/;
/^Serial Number: (\d+), Control Number: \d+$/ &&
ProcessHistory("SYSTEM","","", "!SN: $1\n") && next;
/^Product Name: (\S+)$/ &&
ProcessHistory("SYSTEM","","", "!Product: $1\n") &&
next;
/^Hardware Version: (\S+), / &&
ProcessHistory("SYSTEM","","", "!HW: $1\n") && next;
/^Software Version: (\S+), Type: (\S+)$/ &&
--- 141,160 ----
}
# This routine parses "get system"
sub GetSystem {
print STDERR " In GetSystem: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
+ # throw away the pager text
+ s/^--- more ---( \x08|\x08)*//;
next if /^\s*$/;
last if(/$prompt/);
/^Serial Number: (\d+), Control Number: \d+$/ &&
ProcessHistory("SYSTEM","","", "!SN: $1\n") && next;
/^Product Name: (\S+)$/ &&
ProcessHistory("SYSTEM","","", "!Product: $1\n") &&
next;
/^Hardware Version: (\S+), / &&
ProcessHistory("SYSTEM","","", "!HW: $1\n") && next;
/^Software Version: (\S+), Type: (\S+)$/ &&
***************
*** 179,199 ****
ProcessHistory("FILE","","","!\n");
return(0);
}
sub GetConf {
print STDERR " In GetConf: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
next if /^Total Config.+$/i;
last if(/$prompt/);
- # throw away the pager lines
- next if /^--- more ---/;
if (/^set admin name "(\S+)"$/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","!set admin name <removed>
\n");
next;
}
if (/^set admin password (\S+)$/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","!set admin password
<removed>\n");
next;
--- 179,199 ----
ProcessHistory("FILE","","","!\n");
return(0);
}
sub GetConf {
print STDERR " In GetConf: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
+ # throw away the pager text
+ s/^--- more ---( \x08|\x08)*//;
next if /^\s*$/;
next if /^Total Config.+$/i;
last if(/$prompt/);
if (/^set admin name "(\S+)"$/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","!set admin name <removed>
\n");
next;
}
if (/^set admin password (\S+)$/ && $filter_pwds >= 1) {
ProcessHistory("ADMIN","","","!set admin password
<removed>\n");
next;
-----Original Message-----
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of john heasley
Sent: 12 November 2008 02:01
To: Atif.SIDDIQUI at HydroOne.com
Cc: rancid-discuss at shrubbery.net
Subject: [rancid] Re: Netscreen: nlogin file 'set console page 0'
Tue, Nov 11, 2008 at 05:57:41PM -0500, Atif.SIDDIQUI at HydroOne.com:
> I found this patch: config change;
>
>
>
> but we should be able to put in the page only for that vty sessionnot
> affecting all the users and config;
>
> As RANCID does not save the config after doing the following steps;
> other users always get a message to save the config or not; even
> though they have not change anything; it was because RANCID added "set
> console 0" then unset it cause the config changes. Can we have a
workaround.
That does not seem to be a very good fix. If another user happens to be
logged-in when rancid runs, the pager will be disabled AND if another
user re-enables the pager it will confuse nlogin, possibly causing it to
hang (thus more emails about problems collecting...).
A better fix, assuming this is still a global knob, is to deal with the
pager, if possible.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
------------------------------------------------------------------------------
Save Paper - Do you really need to print this e-mail?
Visit www.virginmedia.com for more information, and more fun.
This email and any attachments are or may be confidential and legally privileged
and are sent solely for the attention of the addressee(s). If you have received this
email in error, please delete it from your system: its use, disclosure or copying is
unauthorised. Statements and opinions expressed in this email may not represent
those of Virgin Media. Any representations or commitments in this email are
subject to contract. Please note that we are migrating our email addresses to a
company wide address of "@virginmedia.co.uk". If you are sending to a Telewest or
ntl email address your email will be re-directed.
Registered office: 160 Great Portland Street, London W1W 5QA.
Registered in England and Wales with number 2591237
==============================================================================
More information about the Rancid-discuss
mailing list