[rancid] Completely disable mail functionality in 3.14?

Andrew Weaver aweaver at ee.net
Thu May 14 19:21:18 UTC 2026


Okay,

Thank you very much for that debug command that was helpful in 
illustrating another problem I'm having.

Note: I specifically built version 3.14 with /opt/rancid (using these 
flags) because I have a 3.07 installed already in /usr/local/rancid...

./configure --prefix=/opt/rancid --localstatedir=/opt/rancid

I created this in /opt/rancid/etc/rancid.types.conf [for NXOS]

cisco-nx2;script;rancid -t cisco-nx
cisco-nx2;login;clogin
cisco-nx2;module;nxos
cisco-nx2;inloop;nxos::inloop
cisco-nx2;command;rancid::RunCommand;term no monitor-force
cisco-nx2;command;nxos::WriteTerm;show running-config

In router.db I have the device specified as this:

nxlab1;cisco-nx2;up

env NOPIPE=YES PATH=${PATH}:/opt/rancid/bin rancid -t cisco-nx2 -d 
nxlab1
loadtype: device type cisco-nx2
loadtype: found device type cisco-nx2 at 
/opt/rancid/etc/rancid.types.conf:21
executing clogin -t 90 -c"term no monitor-force;show running-config" 
nxlab1
PROMPT MATCH: NX65(\([^)#]+\))?\#
HIT COMMAND:NX65#  term no monitor-force
     In RunCommand: NX65#  term no monitor-force
HIT COMMAND:NX65# show running-config
     In WriteTerm: NX65# show running-config
nxlab1: found exit
nxlab1: End of run not found
nxlab1: found_end is false

The crazy part is that when rancid-run executes either in cron (using 
this rancid /opt/rancid/bin/rancid-run > /dev/null 2>&1)

or run manually on the CLI like this: /opt/rancid/bin/rancid-run -r 
nxlab1

It's not actually using the cisco-nx2 "command" at all.

I know this because I edited this line

ProcessHistory("","","","!RANCID-CONTENT-TYPE: $devtype\n!\n");

to be

ProcessHistory("","","","!RANCID-CONTENT-TYPE: 
QUICKLYLOSINGMYMIND\n!\n");

in /opt/rancid/lib/rancid/nxos.pm

In the config file rancid-run creates it says this:

!RANCID-CONTENT-TYPE: cisco

In the config file that this creates

env NOPIPE=YES PATH=${PATH}:/opt/rancid/bin rancid -t cisco-nx2 -d 
nxlab1

it says: !RANCID-CONTENT-TYPE: QUICKLYLOSINGMYMIND

Do you have any idea why /opt/rancid/bin/rancid-run is doing it totally 
differently than the debug command?

Also assuming I can even fix this issue is there some way to suppress 
the logging of "End of run not found" that you are aware of?

Since it is expected that there would be no "end of run" for NXOS that 
message probably doesn't need to be logged.

thank you very much.

On 2026-05-14 14:38, Jethro Binks wrote:

> So rancid.types.base (from github repo) currently says:
> 
> # SMC and Dell PowerConnect N2048, 34xx (config is incomplete), 35xx 
> (3524,
> # 3524P, 3548, 3548P), N4032F, N4064, 62xxx, M6348, 64xx (6428), 7048,
> # M8024(-k), and R1-2401.
> smc;script;rancid -t smc
> smc;login;hlogin
> smc;timeout;90
> smc;module;smc
> smc;inloop;smc::inloop
> smc;command;rancid::RunCommand;terminal datadump
> smc;command;smc::ShowSys;show system
> smc;command;smc::ShowVer;show version
> smc;command;smc::Dir;dir
> smc;command;smc::ShowVlan;show vlan
> smc;command;smc::WriteTerm;show running-config
> 
> Is your device one of the listed models?  It might be poorly tested if 
> not.  (It might be poorly tested if it is 🙂 ).
> 
> Anyway, it calls hlogin to log into the device and that was originally 
> written for "hp" devices - but I guess it was functional enough to not 
> need to write something specific.  But it sends "no page" (directly in 
> the script), which I guess isn't applicable for SMC.  Google does 
> suggest "terminal length 0" might work.   On some systems there is no 
> way to turn off paging (no idea about yours though), and so the parsing 
> script has to handle finding and filtering out "--- more ---" lines and 
> similar, which can often be painful.
> 
> Smc.pm.in has several instances of: "# pager remnants like: ^H^H^H    
> ^H^H^H content" so I guess there is some known paging imperfection 
> here, and it might be a code versions have made changes.
> 
> If your only problem is the directory listing changes, then simplest 
> thing to do is to comment out the dir line:
> 
> #smc;command;smc::Dir;dir
> 
> If you want to keep all but the volatile ones, then you might look in 
> smc.pm (or smc.pm.in if you are building from source) in sub Dir and 
> modify it in some suitable way to match ones you don't want, maybe:
> 
>       next if (
>         /^aaafile\.prv/ ||
> /^syslog\d+\.sys/
> );        
> 
> (is 'aaafile.prv' a real SMC file, or just a placeholder filename in 
> the code?)
> 
> It's very hard to keep on top of all the slight differences that appear 
> even between different models in the same family or different code 
> versions for a particular one from the same vendor, let alone between 
> all vendors and their constantly shifting names, and the maintainer of 
> rancid can only directly test a few of them and relies on reports or 
> patches.  Oxidized has similar issues, if their repo is anything to go 
> by; I found the remark "I removed the "terminal datadump" from the 
> porwerconnect.rb as these models doesn't have the command" in there at 
> least.
> 
> A well-written script should catch when an invalid command is sent and 
> just move on.  It should also catch valid commands for which the 
> current user doesn't have permissions neatly too.
> 
> For debugging, I'd do something like:
> 
> env NOPIPE=YES PATH=${PATH}:/usr/local/rancid/bin rancid -t smc -d 
> devicename
> 
> And you will get a .new and a .raw file that you can see a bit more 
> about what's going on.
> 
> Jethro.
> 
> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  
> .
> 
> Jethro R Binks, Network Manager,
> 
> Information Services Directorate, University Of Strathclyde, Glasgow, 
> UK
> 
> The University of Strathclyde is a charitable body, registered in 
> Scotland, number SC015263.
> 
> -------------------------
> 
> From: Andrew Weaver <aweaver at ee.net>
> Sent: 14 May 2026 6:27 PM
> To: Jethro Binks <jethro.binks at strath.ac.uk>
> Cc: rancid-discuss at www.shrubbery.net <rancid-discuss at www.shrubbery.net>
> Subject: Re: [rancid] Completely disable mail functionality in 3.14?
> 
> We use many different types.
> 
> The one I am trying to fix right now is "smc"
> 
> it doesn't seem like it sends 'term length 0' before looking at the 
> configuration so there ends up being spaces in the configuration file 
> in weird places as it paginates so it counts the exact same 
> "configuration file" as having a diff in it..
> 
> It was this:
> 
> smc;script;rancid -t smc
> smc;login;hlogin
> smc;timeout;90
> smc;module;smc
> smc;inloop;smc::inloop
> smc;command;rancid::RunCommand;terminal datadump
> smc;command;smc::ShowSys;show system
> smc;command;smc::ShowVer;show version
> smc;command;smc::Dir;dir
> smc;command;smc::ShowVlan;show vlan
> smc;command;smc::WriteTerm;show running-config
> 
> I'm not sure what "terminal datadump" is supposed to do as that command 
> doesn't exist on our dell switches.
> 
> So we'll end up seeing things like this in the configs and the configs 
> are "updated" every time RANCID goes out to check the configuration 
> file and I cannot figure out why since the configurations almost never 
> actually change.
> 
> "!
> <return>                                                       
> interface vlan 1"
> 
> So I tried changing it to:
> 
> smc;script;rancid -t smc
> smc;login;hlogin
> smc;timeout;90
> smc;module;smc
> smc;inloop;smc::inloop
> smc;command;rancid::RunCommand;terminal length 0
> #smc;command;smc::ShowSys;show system
> #smc;command;smc::ShowVer;show version
> #smc;command;smc::Dir;dir
> #smc;command;smc::ShowVlan;show vlan
> smc;command;smc::WriteTerm;show running-config
> 
> Is there any way to log what it's actually doing when it is running 
> like as far as the commands and the responses? I'd like to get it to 
> stop thinking that there is a configuration change every single time 
> rancid-run is ran.
> 
> thanks.
> 
> On 2026-05-14 05:43, Jethro Binks wrote:
> 
> What "devices" are you backing up?  What rancid type are you using?
> 
> Many of the rancid types have an exclusion for filenames that are known 
> to be volatile and change and filter them out from processing, or else 
> the time fields are filtered out.
> 
> (eg in ios.pm:
> 
> sub ShowFlash {
> ...
> # Drop these files entirely.
> /\s+(private-multiple-fs|multiple-fs|LISP-MapCache-IPv\S+|nv_hdr)$/ &&
> Next;
> 
> )
> 
> Jethro.
> 
> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  
> .
> 
> Jethro R Binks, Network Manager,
> 
> Information Services Directorate, University Of Strathclyde, Glasgow, 
> UK
> 
> The University of Strathclyde is a charitable body, registered in 
> Scotland, number SC015263.
> 
> -------------------------
> 
> From: Rancid-discuss <rancid-discuss-bounces at www.shrubbery.net> on 
> behalf of Andrew Weaver <aweaver at ee.net>
> Sent: 13 May 2026 7:55 PM
> To: rancid-discuss at www.shrubbery.net <rancid-discuss at www.shrubbery.net>
> Subject: Re: [rancid] Completely disable mail functionality in 3.14?
> 
> Hello,
> 
> I apologize for replying to myself but it seems like the reason it's 
> trying to send that many emails is because it thinks that this is a 
> change and so it's creating a diff for things like this:
> 
> 38,39c38,39
> < ! syslog1.sys             r-       131072      --      26-Apr-2016 
> 15:15:24
> < ! syslog2.sys             r-       131072      --      26-Apr-2016 
> 15:15:24
> ---
>> ! syslog1.sys             r-       131072      --      26-Apr-2016 
>> 15:26:39
>> ! syslog2.sys             r-       131072      --      26-Apr-2016 
>> 15:26:39
> 
> We're solely using RANCID as a way to backup the configuration files on 
> our devices.
> 
> Is there any way to globally disable it checking the file dates on the 
> syslog files on network devices?
> 
> I noticed on other switches it appears to think that the wattage being 
> used by the PSUs is a configuration change.
> 
> Do I need to make a custom version of whatever commands it's running to 
> exclude things that change constantly?
> 
> On 2026-05-13 14:37, Andrew Weaver wrote:
> 
> Hello,
> 
> I noticed that the logs on our RANCID machine were growing quite large.
> 
> I determined that it is because it's writing 10MB of this half of the 
> time rancid-run runs:
> 
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> No configuration file found at /home/rancid/.esmtprc or /etc/esmtprc
> 
> So then I created a blank .esmtprc file that caused it to start logging 
> two lines for each thing that I don't want it doing in the first place. 
> ;)
> 
> File /home/rancid/.esmtprc must have no more than -rwx--x--- (0710) 
> permissions.
> open: /home/rancid/.esmtprc: Success
> 
> OK fine, I fixed that.
> 
> How do I just disable every single thing to do with SMTP .esmtprc, etc?
> 
> Thank you so much if anyone can assist me.
> 
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at www.shrubbery.net
> https://www.shrubbery.net/mailman/listinfo/rancid-discuss
> 
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at www.shrubbery.net
> https://www.shrubbery.net/mailman/listinfo/rancid-discuss

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20260514/64dcf06d/attachment.htm>


More information about the Rancid-discuss mailing list