<div dir="ltr"><div><div>Thank you!<br><br></div>Now it's working<br><br></div>If some has a same issue:<br><br># diff ios.pm.orig-3.6.2 <a href="http://ios.pm">ios.pm</a><br>140c140,143<br><       if (/[>#]\s?exit$/) {<br>---<br>>           # note: this match sucks rocks, but currently the extreme bits are<br>>           # unreliable about echoing the 'exit\n' command.  this match might<br>>           # really be a bad idea, but instead rely upon WriteTerm's found_end?<br>>       if (/($prompt\s?(quit|exit)|Connection( to \S+)? closed)/ && $found_end) {<br>150c153<br><       while (/[>#]\s*($cmds_regexp)\s*$/) {<br>---<br>>       while (/$prompt\s*($cmds_regexp)\s*$/) {<br>153,154c156,159<br><               $prompt = ($_ =~ /^([^#>]+[#>])/)[0];<br><               $prompt =~ s/([][}{)(+\\])/\\$1/g;<br>---<br>>               $prompt = ($_ =~ /^([^#]+#)/)[0];<br>>               $prompt =~ s/([][}{)(\\])/\\$1/g;<br>>               $prompt =~ s/[:.](\d+ ?)#/[:.]\\d+ ?#/;<br>>               $prompt =~ s/\*/\\\*/;<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 6, 2017 at 7:06 AM, heasley <span dir="ltr"><<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Mon, Jun 05, 2017 at 06:01:58PM +0300, Alexander R:<br>
<div><div class="h5">> On Fri, Dec 16, 2016 at 8:44 PM, heasley <<a href="mailto:heas@shrubbery.net">heas@shrubbery.net</a>> wrote:<br>
><br>
> > Tue, Dec 13, 2016 at 10:30:08AM +0300, Alexander R:<br>
> > > On Tue, Dec 13, 2016 at 12:19 AM, heasley <<a href="mailto:heas@shrubbery.net">heas@shrubbery.net</a>> wrote:<br>
> > ><br>
> > > > Mon, Dec 12, 2016 at 12:01:24PM +0300, Alexander R:<br>
> > > > > my configuration:<br>
> > > > > centos 7 x86_64<br>
> > > > > i've issue in rancid 3.5.1 and 3.6.0<br>
> > > ><br>
> > > > thank you for including this.<br>
> > > ><br>
> > > > > i've issue to collect configs from switch modules "BNT Layer 2/3<br>
> > Copper<br>
> > > > > Gigabit Ethernet Switch Module for IBM BladeCenter (5.2.8 (FLASH<br>
> > > > image1))",<br>
> > > > > it has IP 192.168.1.11<br>
> > > > ><br>
> > > > > It's cisco-like CLI, so i've created my own "ibm" type in<br>
> > > > rancid.types.conf:<br>
> > > > ><br>
> > > > > # cat /etc/rancid/rancid.types.conf<br>
> > > > > ibm;script;rancid -t ibm<br>
> > > > > ibm;login;clogin<br>
> > > > > ibm;module;ios<br>
> > > > > ibm;inloop;ios::inloop<br>
> > > > > ibm;command;ios::WriteTerm;<wbr>show running-config<br>
> > > > ><br>
> > > > > It's working fine with other switch module  "IBM Networking OS<br>
> > Virtual<br>
> > > > > Fabric 10Gb Switch Module for IBM BladeCenter (7.8.3 (FLASH<br>
> > image1))" and<br>
> > > > > it have IP 192.168.1.12, but not with "BNT Layer 2/3 Copper Gigabit<br>
> > > > > Ethernet Switch Module for IBM BladeCenter (5.2.8 (FLASH image1))"<br>
> > > > ><br>
> > > > > Fail device:<br>
> > > > > # rancid -t ibm -d 192.168.1.11<br>
> > > > > loadtype: device type ibm<br>
> > > > > loadtype: found device type ibm in /etc/rancid/rancid.types.conf<br>
> > > > > executing clogin -t 90 -c"show running-config" 192.168.1.11<br>
> > > > > PROMPT MATCH: sw11#<br>
> > > > > HIT COMMAND:sw11#show running-config<br>
> > > > >     In WriteTerm: sw11#show running-config<br>
> > > > > <a href="http://192.168.1.11" rel="noreferrer" target="_blank">192.168.1.11</a>: End of run not found<br>
> > > > > end<br>
> > > > ><br>
> > > > > In 192.168.1.11.raw i see config issued by "show run..."<br>
> > > > ><br>
> > > > > Ok device:<br>
> > > > > # rancid -t ibm -d 192.168.1.12<br>
> > > > > loadtype: device type ibm<br>
> > > > > loadtype: found device type ibm in /etc/rancid/rancid.types.conf<br>
> > > > > executing clogin -t 90 -c"show running-config" 192.168.1.12<br>
> > > > > PROMPT MATCH: sw12#<br>
> > > > > HIT COMMAND:sw12#show running-config<br>
> > > > >     In WriteTerm: sw12#show running-config<br>
> > > > > <a href="http://192.168.1.12" rel="noreferrer" target="_blank">192.168.1.12</a>: End of run not found<br>
> > > > > end<br>
> > > > ><br>
> > > > > ps. 192.168.1.11 has NO words "exit" in config, because interface<br>
> > isn't<br>
> > > > > configured (such a configuration plan).<br>
> > > > > 192.168.1.12 has words "exit", because interfaces is configured.<br>
> > > > ><br>
> > > > > Could you help me?<br>
> > > ><br>
> > > > ios::WriteTerM() will expect to find and "end" marker in the config,<br>
> > > > without<br>
> > > > which it will not set $found_end.  if this device does not have this<br>
> > marker<br>
> > > > or something similar that a customer version of ios::WriteTerm could<br>
> > use,<br>
> > > > you can use a custom version of ios::WriteTerm that just counts lines,<br>
> > > > which<br>
> > > > ios::WriteTerm already does if the input is an ASA (or a few others),<br>
> > which<br>
> > > > lack an end marker.<br>
> > > ><br>
> > ><br>
> > > Hi,<br>
> > > thank you for responce.<br>
> > ><br>
> > > It's my configs<br>
> > ><br>
> > > Ok device:<br>
> > > rancid]# tail -n5 192.168.1.12.raw<br>
> > > ntp secondary-server 192.168.1.1<br>
> > > !<br>
> > > end<br>
> > ><br>
> > > sw12#exitReceived disconnect from <a href="http://192.168.1.12" rel="noreferrer" target="_blank">192.168.1.12</a>: 11: Logged out.<br>
> > > rancid]#<br>
> > ><br>
> > > Fail device:<br>
> > > rancid]# tail -n5 192.168.1.11.raw<br>
> > > ntp secondary-server 192.168.1.1<br>
> > > !<br>
> > > end<br>
> > ><br>
> > > sw11#exitReceived disconnect from <a href="http://192.168.1.11" rel="noreferrer" target="_blank">192.168.1.11</a>: 11: Logged out.<br>
> >           ^^ this is likely the problem; the lousy thing didnt echo the<br>
> > CR.  inloop() expects the CR and set $clean_run.  you'll have to adjust<br>
> > the match; the lousy exos does this too.<br>
> ><br>
><br>
> I'm sorry, but how to do this "you'll have to adjust the match"?<br>
<br>
</div></div>there is a match in inloop() for the exit/logout/whatever from the cli.<br>
it expects the device to act normally and this one does not, as mentioned.<br>
see the same match in <a href="http://exos.pm" rel="noreferrer" target="_blank">exos.pm</a>; something similar to that ought to work.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> ><br>
> > > rancid]#<br>
> > ><br>
> > > So, both switches have "end" word at the end of file. Any ideas? I don't<br>
> > > know why it's not worked on same "text" files<br>
> > ><br>
> > ><br>
> > > > the purpose of this is that some devices behave poorly in low memory<br>
> > > > conditions, eg: memory leaks.  some appear to succeed to produce a<br>
> > config,<br>
> > > > but output nothing.  requiring the marker prevents rancid from dropping<br>
> > > > the config from the repo.<br>
> > > ><br>
> ><br>
</div></div></blockquote></div><br></div>