<div dir="ltr">Thanks for the help Alan.<div><br></div><div>My perl module is based on the builtin ciscowlc module.</div><div><br></div><div>The exit condition (if I've understood you correctly) is this:-</div><div><br></div><div><div> ProcessHistory("","","","\n!--WLC End Config Data--!\n");</div><div> print STDERR " Exiting ShowConfig: $_" if ($debug);</div><div> # WLC lacks a definitive "end of config" marker.</div><div> if ($linecnt > 5) {</div><div><br></div><div> $found_end = 1;</div><div> return(1);</div><div> }</div></div><div><br></div><div>It seems like the perl module is telling me the file is short, but the raw file is definitely the full show running-config output.</div><div><br></div><div>I'm kinda lost now :/</div><div><br></div><div>Cheers,</div><div>Rod.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 17, 2015 at 2:16 PM, Alan McKinnon <span dir="ltr"><<a href="mailto:alan.mckinnon@gmail.com" target="_blank">alan.mckinnon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That's a fairly common error, but it never has a common solution.<br>
<br>
Basically, your script read the raw file, detected the start of "show<br>
running-config" and started to process it in sub ShowConfig()<br>
<br>
However, the script didn't find the end of that output for whatever<br>
reason and processing fell all the way through to the very end with the<br>
error "End of run not found". You will have to dig into the script and<br>
find what it uses for that. There's a main loop in ShowConfig() and it<br>
will have a regex exit condition (possibly "end" followed by a prompt or<br>
something similar).<br>
<br>
Carefully examine the raw file to see what your device put out, and make<br>
ShowConfig() match.<br>
<span class=""><br>
<br>
On 17/12/2015 08:01, Rod Hendricks wrote:<br>
> I'm getting closer.<br>
><br>
> rancid.types.conf now looks like this:-<br>
> hirschmann;script;rancid -t hirschmann<br>
> hirschmann;login;hmlogin<br>
> hirschmann;module;hirschmann<br>
> hirschmann;inloop;hirschmann::inloop<br>
> hirschmann;command;hirschmann::ShowConfig;show running-config<br>
><br>
> Output now looks like this:-<br>
> -bash-4.2$ rancid -d -thirschmann 192.168.254.103<br>
> loadtype: device type hirschmann<br>
> loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf<br>
> executing hmlogin -t 90 -c"show running-config" 192.168.254.103<br>
> PROMPT MATCH:<br>
> HIT COMMAND:(Hirschmann Railswitch) #show running-config<br>
> HIT COMMAND:(Hirschmann Railswitch) #show running-config<br>
> In ShowConfig: (Hirschmann Railswitch) #show running-config<br>
> Exiting ShowConfig:<br>
</span>> 192.168.254.103 <<a href="http://192.168.254.103" rel="noreferrer" target="_blank">http://192.168.254.103</a>>: End of run not found<br>
> 192.168.254.103 <<a href="http://192.168.254.103" rel="noreferrer" target="_blank">http://192.168.254.103</a>>: End of run not found<br>
<span class="">> !--WLC End Config Data--!<br>
> -bash-4.2$<br>
><br>
> .raw file still looks correct.<br>
><br>
> .new file looks like:-<br>
> !RANCID-CONTENT-TYPE: hirschmann<br>
> !<br>
><br>
> !--WLC Begin Config Data--!<br>
><br>
> !--WLC End Config Data--!<br>
><br>
> Ideas?<br>
><br>
> Cheers,<br>
> Rod.<br>
><br>
><br>
><br>
> On Wed, Dec 16, 2015 at 11:57 PM, Dan Anderson <<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a>>> wrote:<br>
><br>
> That field is basically a call to a subroutine within the module so<br>
</span>> if you copied <a href="http://ciscowlc.pm" rel="noreferrer" target="_blank">ciscowlc.pm</a> <<a href="http://ciscowlc.pm" rel="noreferrer" target="_blank">http://ciscowlc.pm</a>>, you'd need to use<br>
<span class="">> ShowConfig as WriteTerm doesn't exist in that module.<br>
><br>
> On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks<br>
> <<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a><br>
</span><span class="">> <mailto:<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a>>> wrote:<br>
><br>
> I don't fully understand the purpose of WriteTerm. But from<br>
> what you are saying above, is my rancid.types.conf in my<br>
> original post wrong? Should<br>
><br>
> hirschmann;command;hirschmann::WriteTerm;show running-config<br>
><br>
> in fact look like<br>
><br>
> hirschmann;command;hirschmann::ShowConfig;show running-config<br>
><br>
> ?<br>
> If so, I guess I've messed that up by not understanding the<br>
> significance of that keyword. Rancid server is on my work dev<br>
> box - will try this out in 12hrs when i get back to the office.<br>
><br>
> Thanks again.<br>
><br>
> Cheers,<br>
> Rod.<br>
><br>
> On Wed, Dec 16, 2015 at 11:07 PM, Dan Anderson<br>
</span>> <<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a> <mailto:<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a>>> wrote:<br>
><br>
> ShowConfig in <a href="http://ciscowlc.pm" rel="noreferrer" target="_blank">ciscowlc.pm</a> <<a href="http://ciscowlc.pm" rel="noreferrer" target="_blank">http://ciscowlc.pm</a>> uses the line<br>
<span class="">> counting method.<br>
><br>
> while (<$INPUT>) {<br>
> <---SNIP---><br>
><br>
> $linecnt++;<br>
> <---SNIP---><br>
><br>
> # WLC lacks a definitive "end of config" marker.<br>
> if ($linecnt > 5) {<br>
> $found_end = 1;<br>
> return(1);<br>
> }<br>
> return(0);<br>
><br>
><br>
</span>> WriteTerm in <a href="http://ios.pm" rel="noreferrer" target="_blank">ios.pm</a> <<a href="http://ios.pm" rel="noreferrer" target="_blank">http://ios.pm</a>> looks for the "end" keyword.<br>
<span class="">><br>
> On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks<br>
> <<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a><br>
</span><div><div class="h5">> <mailto:<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a>>> wrote:<br>
><br>
> Thanks Dan.<br>
><br>
> Your explanation makes sense. Which script normally<br>
> defines this delimiter? I would be happy to settle for<br>
> the moment in just short-circuiting this delimiter check<br>
> so I can I can get the job running. Have included<br>
> device config below. Don't worry about the passwords -<br>
> its a test unit with factory default config.<br>
><br>
> Escape character is '^]'.<br>
><br>
><br>
><br>
> Copyright (c) 2004-2015 Hirschmann Automation<br>
> and Control GmbH<br>
><br>
> All rights reserved<br>
><br>
> Railswitch Release L2E-08.0.09<br>
><br>
> (Build date 2015-04-06 21:32)<br>
><br>
><br>
><br>
> System Name: RS-F602F7<br>
> Mgmt-IP : 192.168.254.103<br>
> Base-MAC : 00:80:63:F6:02:F7<br>
> System Time: 2015-01-02 10:11:52<br>
><br>
><br>
><br>
> (Hirschmann Railswitch)<br>
> User:admin<br>
> Password:*******<br>
><br>
> NOTE: Enter '?' for Command Help. Command help displays<br>
> all options<br>
> that are valid for the 'normal' command forms of<br>
> that particular mode.<br>
> For a list of valid 'no' command forms for that<br>
> mode, enter the help<br>
> command 'no ?'. For the syntax of a particular<br>
> command form, please<br>
> consult the documentation.<br>
><br>
><br>
> (Hirschmann Railswitch) >enable<br>
><br>
> (Hirschmann Railswitch) #<br>
> (Hirschmann Railswitch) #show running-config<br>
><br>
> !Current Configuration:<br>
> !<br>
> !Parameter string escape handling \, 1<br>
> !Characters to be preceded with escape char (\): \, !,<br>
> ", ', ?<br>
><br>
> !System Description "Hirschmann Railswitch"<br>
> !System Version L2E-08.0.09 Build: 2015-04-06 21:32<br>
><br>
> vlan database<br>
> exit<br>
><br>
><br>
> configure<br>
><br>
> !<br>
><br>
><br>
> interface 1/1<br>
> no auto-negotiate<br>
><br>
> exit<br>
><br>
><br>
> interface 1/2<br>
> no auto-negotiate<br>
><br>
> exit<br>
><br>
><br>
> interface 1/3<br>
><br>
> exit<br>
><br>
><br>
> interface 1/4<br>
><br>
> exit<br>
><br>
><br>
> interface 1/5<br>
><br>
> exit<br>
><br>
><br>
> interface 1/6<br>
><br>
> exit<br>
><br>
><br>
> interface 1/7<br>
><br>
> exit<br>
><br>
><br>
> interface 1/8<br>
><br>
> exit<br>
><br>
><br>
> !Address Conflict Detection<br>
><br>
> !Bridge Address Learning<br>
><br>
> !Bridge Fast Link Detection<br>
><br>
> !Maximum size of frame (packet size)<br>
><br>
> !Bridge Address Relearn Detection<br>
><br>
> !Bridge Address Relearn Threshold<br>
><br>
> !Bridge Duplex Mismatch Detection<br>
><br>
> !Bridge Hash Optimizing<br>
><br>
> !Service Mode<br>
><br>
> !VLAN Learning<br>
><br>
><br>
> !Hirschmann DHCP Relay<br>
><br>
> !Hirschmann Device Status<br>
><br>
><br>
> !DIP Switch Admin State<br>
><br>
><br>
> !Ethernet/IP<br>
><br>
> !Power over Ethernet (IEEE 802.3af)<br>
> !Selftest<br>
><br>
> !Skip ACA on boot<br>
><br>
><br>
> !Hirschmann HIPER Ring<br>
> ! configuration determined by DIP switch<br>
> hiper-ring mode ring-switch<br>
> hiper-ring port primary 1/1<br>
> hiper-ring port secondary 1/2<br>
><br>
> !LLDP (IEEE802.1AB Link Layer Discovery Protocol)<br>
><br>
> !Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)<br>
> !No MRP domains exist.<br>
><br>
> !MAC/IP Based Port Security<br>
><br>
><br>
> !ProfinetIO<br>
><br>
><br>
> !Hirschmann Precision Time Protocol (PTP, IEEE 1588)<br>
><br>
> !Hirschmann Ring Coupling<br>
> !Note: master/slave (also for single) part of<br>
> configuration determined by<br>
> ! DIP switch (cannot be overridden by management)<br>
> ring-coupling operation on<br>
><br>
> !Hirschmann Signal Contacts<br>
><br>
><br>
> !Hirschmann SNMP Access Control<br>
><br>
><br>
> !SNTP<br>
><br>
><br>
> !Hirschmann Broadcast Limiter<br>
><br>
><br>
> !Hirschmann Temperature Limit Settings<br>
><br>
> users passwd admin<br>
> :v1:81449548fb49a99be2d6411bdb9a10ea7e9c92c9510eb373a26176b48b934890:<br>
> users snmpv3 authentication admin md5<br>
> users passwd user<br>
> :v1:81439e52f35ecca73b21339156609d20cf630a65d0e92261cb29e58647ae54f4:<br>
> users snmpv3 authentication user md5<br>
><br>
> lineconfig<br>
> exit<br>
><br>
> no spanning-tree<br>
><br>
> !IGMP Snooping<br>
> exit<br>
><br>
><br>
> (Hirschmann Railswitch) #logoutConnection closed by<br>
> foreign host.<br>
> -bash-4.2$<br>
><br>
> Cheers,<br>
> Rod.<br>
><br>
> On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson<br>
> <<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a><br>
</div></div><span class="">> <mailto:<a href="mailto:dan.w.anderson@gmail.com">dan.w.anderson@gmail.com</a>>> wrote:<br>
><br>
> It sounds like it's not finding an<br>
> end-of-configuration delimiter. I'm not familiar<br>
> with the device type, but for Cisco devices, it<br>
> usually looks for the keyword "end" by itself at the<br>
> end of "show run" to determine whether or not it has<br>
> successfully pulled the configuration. Other device<br>
> types sometimes look for more than 5 lines of<br>
> config, etc. Without knowing more about the<br>
> configuration file format, I can't say which method<br>
> (if either) would work for your situation.<br>
><br>
> On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks<br>
> <<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a><br>
</span><span class="">> <mailto:<a href="mailto:rod.hendricks@graduate.uwa.edu.au">rod.hendricks@graduate.uwa.edu.au</a>>> wrote:<br>
><br>
> Hi.<br>
><br>
> I am really struggling with getting a new device<br>
> type up and running.<br>
><br>
> Rancid v3.2, installed into Centos 7 with yum<br>
> from EPEL repo. I have an installation that is<br>
> currently working against a test Cisco router,<br>
> so I know the base install is all good.<br>
><br>
> I have created a login script hmlogin (based off<br>
> complogin, with session paginate commented out)<br>
> I have created a perl script <a href="http://hirschmann.pm" rel="noreferrer" target="_blank">hirschmann.pm</a><br>
</span><span class="">> <<a href="http://hirschmann.pm" rel="noreferrer" target="_blank">http://hirschmann.pm</a>> (based on <a href="http://ciscowlc.om" rel="noreferrer" target="_blank">ciscowlc.om</a><br>
> <<a href="http://ciscowlc.om" rel="noreferrer" target="_blank">http://ciscowlc.om</a>>).<br>
><br>
</span><span class="">> rancid.types.conf:<br>
> hirschmann;script;rancid -t hirschmann<br>
> hirschmann;login;hmlogin<br>
> hirschmann;module;hirschmann<br>
> hirschmann;inloop;hirschmann::inloop<br>
> hirschmann;command;hirschmann::WriteTerm;show<br>
> running-config<br>
><br>
> I can run it directly with hmlogin -c"show<br>
> running-config" 192.168.254.103<br>
> I get no errors running this, and I get the<br>
> output expected.<br>
><br>
> However, when I run the following: rancid -d<br>
> -thirschmann 192.168.254.103<br>
> I get:<br>
> loadtype: device type hirschmann<br>
> loadtype: found device type hirschmann in<br>
> /etc/rancid/rancid.types.conf<br>
> executing hmlogin -t 90 -c"show running-config"<br>
> 192.168.254.103<br>
> PROMPT MATCH:<br>
> HIT COMMAND:(Hirschmann Railswitch) #show<br>
> running-config<br>
> HIT COMMAND:(Hirschmann Railswitch) #show<br>
> running-config<br>
</span>> 192.168.254.103 <<a href="http://192.168.254.103" rel="noreferrer" target="_blank">http://192.168.254.103</a>>: missed<br>
> cmd(s): all commands<br>
> 192.168.254.103 <<a href="http://192.168.254.103" rel="noreferrer" target="_blank">http://192.168.254.103</a>>: End of<br>
> run not found<br>
> 192.168.254.103 <<a href="http://192.168.254.103" rel="noreferrer" target="_blank">http://192.168.254.103</a>>: End of<br>
<span class="">> run not found<br>
> !<br>
> -bash-4.2$<br>
><br>
> The .raw file has the full correct output of the<br>
> show running-config.<br>
> The .new file only has:<br>
> !RANCID-CONTENT-TYPE: hirschmann<br>
> !<br>
><br>
> I feel oh so close to getting this running!<br>
> Appreciate any help that can be offered.<br>
><br>
> Cheers,<br>
> Rod.<br>
><br>
> _______________________________________________<br>
> Rancid-discuss mailing list<br>
> <a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
</span>> <mailto:<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a>><br>
<span class="">> <a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" rel="noreferrer" target="_blank">http://www.shrubbery.net/mailman/listinfo/rancid-discuss</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Dan<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Rancid-discuss mailing list<br>
> <a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
</span>> <mailto:<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a>><br>
<span class="">> <a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" rel="noreferrer" target="_blank">http://www.shrubbery.net/mailman/listinfo/rancid-discuss</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Dan<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Rancid-discuss mailing list<br>
</span>> <a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a> <mailto:<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a>><br>
<span class="im HOEnZb">> <a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" rel="noreferrer" target="_blank">http://www.shrubbery.net/mailman/listinfo/rancid-discuss</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Dan<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Rancid-discuss mailing list<br>
> <a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
> <a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" rel="noreferrer" target="_blank">http://www.shrubbery.net/mailman/listinfo/rancid-discuss</a><br>
><br>
<br>
<br>
--<br>
</span><span class="HOEnZb"><font color="#888888">Alan McKinnon<br>
<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo/rancid-discuss" rel="noreferrer" target="_blank">http://www.shrubbery.net/mailman/listinfo/rancid-discuss</a><br>
</div></div></blockquote></div><br></div>