[rancid] Prevent commit when device cannot be reached

heasley heas at shrubbery.net
Sat Dec 6 17:54:04 UTC 2025


Fri, Dec 05, 2025 at 11:19:22AM +0100, jm+rancid at roth.lu:
> Hello,
> 
> When switches cannot be reached, an empty file only containing the
> "RANCID-CONTENT-TYPE:" header is committed.
> 
> What do I have to do in my scripts (perl module) to prevent this?

This is intentional, so that the first diff includes the entire
config.  It should occur regardless of whether the device can
be reached or not.  ie:

loop for new devices
	add file
	commit
loop for collection
	collect
diff
commit

> For example, this happens:
> 
> executing clogin -t 90 -c"terminal more disable;show running-config"
> 192.168.80.112
> 192.168.80.112: clogin error: Error: Couldn't login: 192.168.80.112
> 192.168.80.112: missed cmd(s): all commands
> 192.168.80.112: End of run not found
> 192.168.80.112: clean_run is false
> 192.168.80.112: found_end is false
> Sending        configs/192.168.80.112   <--- This is what I'd like to
> prevent.
> 
> What setting should I use in order to prevent commit in such a case?

The only reason that I can imagine you would care about this is if
you have some other process that consumes the files.  Assuming that
is the case, simply ignore files that have fewer than 10 lines or
less than 100 bytes or something like similar.



More information about the Rancid-discuss mailing list