[rancid] Random behavior of $found_end and $clean_run

Stefan Midjich swehack at gmail.com
Thu Jan 12 22:08:46 UTC 2017


Excluse my ignorance in Perl but I've observed some very strange
behavior on Ubuntu 16.04 with Rancid 3.3.

I've also tried patching relevant files with new code from the latest
rancid 3.6.2 package and seeing same results.

Rancid-run mostly reports that $found_end or $clean_run are zero but
if I insert a print around line 180 suddenly the variables are
magically set.

I've run several times and only once was clean_run set to 0. But if I
remove the print, it goes back to reporting "End of run not found".

I also tried setting it in ciscowlc.pm but there I can see that
found_end and clean_run are mostly set to 1.

    # WLC lacks a definitive "end of config" marker.
    if ($linecnt > 5) {
        print STDERR "Found end, return 1" if ($debug);
        $found_end = 1;
        return(1);
    }

And changed my /etc/rancid/rancid.types.conf setup to this.

cisco-wlc8;script;rancid -d -t cisco-wlc8
cisco-wlc8;login;wlogin -noenable -t 120
cisco-wlc8;module;ciscowlc
cisco-wlc8;inloop;ciscowlc::inloop
cisco-wlc8;command;ciscowlc::ShowUdi;config paging disable
cisco-wlc8;command;ciscowlc::ShowUdi;show udi
cisco-wlc8;command;ciscowlc::ShowSysinfo;show sysinfo
cisco-wlc8;command;ciscowlc::ShowConfig;show run-config

So I could see the debug info, and sure enough it hits the end but
doesn't register.

    Exiting ShowConfig: (Cisco Controller) >
 Found End, return 1
wlc01: End of run not found

Also note that the double ShowUdi is a hack for Cisco WLC version 8
where you need to disable paging.

Vanilla code with debug flag gives me this at the end of the log.

wlc01: End of run not found
wlc01: End of run not found
!--WLC End Config Data--!

Then I add this line on line 141 of /usr/lib/rancid/bin/rancid.

print(STDERR "$found_end, $clean_run\n") if ($debug);

And rancid-run says this at the end of the log.

1, 0
wlc01: End of run not found
wlc01: End of run not found

But I've added a print statement next to every instance of clean_run =
0 I could find in ciscowlc.pm yet I don't see any of them in the log.

And this behavior somtimes shifts to both values being 1, and no error
being shown.

It's unusually random and I cannot figure out what is causing this
behavior. Has anyone observed this?

I've documented my wlc v8 config here in case it might help anyone:
https://wiki.sydit.se/teknik:guider:networking:backup_av_cisco_wlc_med_rancid

-- 
Vänliga Hälsningar / Sincerely
Stefan M



More information about the Rancid-discuss mailing list