From Emmanuel.Halbwachs at obspm.fr Tue Dec 2 16:19:07 2025 From: Emmanuel.Halbwachs at obspm.fr (Emmanuel Halbwachs) Date: Tue, 2 Dec 2025 17:19:07 +0100 Subject: [rancid] Bug: option -t in plogin is overrided by option -s Message-ID: Hello, I hope this is the right place to this, please correct me if not. There is a little bug in plogin. Line 70-71: $cmd .= " -s '$opt_s'" if (length($opt_s)); $cmd .= " -t $opt_s" if (length($opt_t)); should be: $cmd .= " -s '$opt_s'" if (length($opt_s)); $cmd .= " -t $opt_t" if (length($opt_t)); Currently, due probably to a copy-paste not edited, $opt_s is used as value for option -t. Hope this helps and thanks very much to heasley and all the Rancid contributors. Have a nice day, -- Emmanuel Halbwachs, Observatoire de Paris, ? +33 1 45 07 75 54 DIO? / CASTORS? ? / PANDA? ? ? Direction Informatique de l'Observatoire ; ? CAlcul, STOckage, R?seau, Syst?me ? Pool of Awesome Network Devices Administrators From jm+rancid at roth.lu Fri Dec 5 10:19:22 2025 From: jm+rancid at roth.lu (jm+rancid at roth.lu) Date: Fri, 05 Dec 2025 11:19:22 +0100 Subject: [rancid] Prevent commit when device cannot be reached Message-ID: <79f66cdedf52e3a2e39bcee12bd49a65@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? 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? Thanks From heas at shrubbery.net Sat Dec 6 17:54:04 2025 From: heas at shrubbery.net (heasley) Date: Sat, 6 Dec 2025 17:54:04 +0000 Subject: [rancid] Prevent commit when device cannot be reached In-Reply-To: <79f66cdedf52e3a2e39bcee12bd49a65@roth.lu> References: <79f66cdedf52e3a2e39bcee12bd49a65@roth.lu> Message-ID: 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. From jm+rancid at roth.lu Sun Dec 7 14:47:27 2025 From: jm+rancid at roth.lu (Marki) Date: Sun, 07 Dec 2025 15:47:27 +0100 Subject: [rancid] Prevent commit when device cannot be reached In-Reply-To: References: <79f66cdedf52e3a2e39bcee12bd49a65@roth.lu> Message-ID: <659168fd-abdf-4667-8260-dd97944abf7c@roth.lu> On 06/12/2025 18:54, heasley wrote: > Fri, Dec 05, 2025 at 11:19:22AM +0100, Marki: > >> 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. I care about it bc I like my repos clean i.e. without useless commits. I'm not sure we are talking about the same thing here. I'm used to not getting any empty/irrelevant config committed but instead get email notification about "missed" routers after 24 hours. I'll dig a little bit further why this isn't the case with this module which I copy/pasted together from other modules. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm+rancid at roth.lu Sun Dec 7 15:14:48 2025 From: jm+rancid at roth.lu (Marki) Date: Sun, 07 Dec 2025 16:14:48 +0100 Subject: [rancid] Prevent commit when device cannot be reached In-Reply-To: References: <79f66cdedf52e3a2e39bcee12bd49a65@roth.lu> Message-ID: Alright I think I found something. Behavior is different if debug is enabled. LOL In fact it still was enabled in my module, and in this case what bin/rancid (not) does is: unlink "$host.new" if (! $debug); in case of no clean run, missed commands, etc. Maybe one should handle this differently like creating a $host.debug file in debug mode while still removing $host.new, in order not to change overall behavior during debugging. -------------- next part -------------- An HTML attachment was scrubbed... URL: