[rancid] Set per-host timeout in .cloginrc?
heasley
heas at shrubbery.net
Thu Apr 26 22:04:26 UTC 2012
Thu, Apr 26, 2012 at 05:11:06PM -0400, Michael W. Lucas:
> Hi,
>
> I have a Mikrotik that runs export very slowly. It has several
> full-route BGP peers in IPv4 and IPv6, filtering rules, and so on, so
> this isn't terribly surprising.
>
> The default rancid timeout is 90 seconds.
>
> Is it possible to change the timeout in .cloginrc for just this
> particular host, or do I need to edit mtlogin?
cloginrc timeout knob is supposed to provide this, but its missing in
mtlogin. this patch should do it.
Index: bin/mtlogin.in
===================================================================
--- bin/mtlogin.in (revision 2457)
+++ bin/mtlogin.in (working copy)
@@ -71,7 +71,7 @@
# tracks if we receive them on the command line.
set do_passwd 1
# Sometimes routers take awhile to answer (the default is 10 sec)
-set timeout 45
+set timeoutdflt 45
# Find the user in the ENV, or use the unix userid.
if {[ info exists env(CISCO_USER) ]} {
@@ -177,7 +177,7 @@
-T* {
if {! [ regexp .\[tT\](.+) $arg ignore timeout]} {
incr i
- set timeout [ lindex $argv $i ]
+ set timeoutdflt [ lindex $argv $i ]
}
# Command file
} -x* -
@@ -466,6 +466,12 @@
set autoenable 1
set enable 0
+ # device timeout
+ set timeout [find timeout $router]
+ if { [llength $timeout] == 0 } {
+ set timeout $timeoutdflt
+ }
+
# Figure out passwords
if { $do_passwd } {
set pswd [find password $router]
More information about the Rancid-discuss
mailing list