Discussion:
[rancid] Set per-host timeout in .cloginrc?
Michael W. Lucas
2012-04-26 21:11:06 UTC
Permalink
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?

==ml
--
Michael W. Lucas
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/
Latest book: SSH Mastery http://www.michaelwlucas.com/nonfiction/ssh-mastery
***@BlackHelicopters.org, Twitter @mwlauthor
heasley
2012-04-26 22:04:26 UTC
Permalink
Post by 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]
Michael W. Lucas
2012-04-30 15:06:24 UTC
Permalink
Patch works. Timeout is successfully set, changes checked in.

Thank you!

==ml
Post by heasley
Post by 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]
--
Michael W. Lucas
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/
Latest book: SSH Mastery http://www.michaelwlucas.com/nonfiction/ssh-mastery
***@BlackHelicopters.org, Twitter @mwlauthor
Loading...