Discussion:
[rancid] A little help modifing the cisco scrip
Richey
2012-02-20 16:39:11 UTC
Permalink
I am polling a large number of Adtran TA900 routers with Rancid. Setting
them up just like a cisco box for the most part does exactly what I need.
The TA900 will spit console messages out during telnet/ssh sessions similar
to how Cisco boxes will if you are consoled into them. The problem is that
this sometimes causes a router to end up with hundreds of revisions when the
only thing that's different is that the router threw out a message which
caused Rancid to think that it was a change.

So I've been searching and I really can't find the correct Google phrase but
what script would I modify so I can add the command "no events" so that it
would turn off the console output for that session? I figured that if I can
send that command before anything else then I won't see the console event
which will keep Rancid from thinking it was a config change.


Richey
Lee
2012-02-20 17:55:50 UTC
Permalink
The quick-n-dirty fix would be to add it to clogin under
proc run_commands { prompt command } {

For example, I added a "term width 132" there to prevent spurious
diffs when running rancid from crontab & then from a terminal:

send "terminal length 0\r"
# -LR- wait for prompt then send term width
expect {
-re $prompt {}
-re "\[\n\r]+" { exp_continue }
}
send "terminal width 132\r" ;# -LR-


Another option would be adding the command to
@commandtable = (
in rancid .. but you'd also have to add a routine to handle the command.

Lee
Post by Richey
I am polling a large number of Adtran TA900 routers with Rancid. Setting
them up just like a cisco box for the most part does exactly what I need.
The TA900 will spit console messages out during telnet/ssh sessions similar
to how Cisco boxes will if you are consoled into them. The problem is that
this sometimes causes a router to end up with hundreds of revisions when the
only thing that's different is that the router threw out a message which
caused Rancid to think that it was a change.
So I've been searching and I really can't find the correct Google phrase but
what script would I modify so I can add the command "no events" so that it
would turn off the console output for that session? I figured that if I can
send that command before anything else then I won't see the console event
which will keep Rancid from thinking it was a config change.
Richey
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
heasley
2012-02-21 21:33:05 UTC
Permalink
Post by Lee
The quick-n-dirty fix would be to add it to clogin under
proc run_commands { prompt command } {
For example, I added a "term width 132" there to prevent spurious
send "terminal length 0\r"
# -LR- wait for prompt then send term width
expect {
-re $prompt {}
-re "\[\n\r]+" { exp_continue }
}
send "terminal width 132\r" ;# -LR-
Another option would be adding the command to
@commandtable = (
in rancid .. but you'd also have to add a routine to handle the command.
is there not a configuration on the box that will disable it globally?

else, i'd create a new rancid script for it - add to
@commandtable = (
{'show version' => 'DoNothing'},
Post by Lee
Lee
Post by Richey
I am polling a large number of Adtran TA900 routers with Rancid. Setting
them up just like a cisco box for the most part does exactly what I need.
The TA900 will spit console messages out during telnet/ssh sessions similar
to how Cisco boxes will if you are consoled into them. The problem is that
this sometimes causes a router to end up with hundreds of revisions when the
only thing that's different is that the router threw out a message which
caused Rancid to think that it was a change.
So I've been searching and I really can't find the correct Google phrase but
what script would I modify so I can add the command "no events" so that it
would turn off the console output for that session? I figured that if I can
send that command before anything else then I won't see the console event
which will keep Rancid from thinking it was a config change.
Richey
_______________________________________________
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
Loading...