From guy20034u at yahoo.com Fri Oct 1 05:34:33 2021 From: guy20034u at yahoo.com (simon ben) Date: Fri, 1 Oct 2021 05:34:33 +0000 (UTC) Subject: [rancid] Restore config on cisco devices In-Reply-To: References: <616421999.1285977.1632812313955.ref@mail.yahoo.com> <616421999.1285977.1632812313955@mail.yahoo.com> <782567046.292868.1632981231414@mail.yahoo.com> Message-ID: <858088618.511958.1633066473048@mail.yahoo.com> Dear Heasley, Once again really appreciate your quick response and thanks for the clarification regards simon On Thursday, September 30, 2021, 11:07:37 PM GMT+3, heasley wrote: Thu, Sep 30, 2021 at 05:53:51AM +0000, simon ben: > just wanted to know regarding the alternate way mentioned by you after doing a minimum config for the cisco switch or router for network connectivity as guess it would be a better option > Is it possible to restore the config from viewvc screen from the browser as I dont see any option neither no option to down and save it as a file on my local desktop pc No, viewvc is only a CVS repository viewer. > appreciate your advice and help if the restore could be done from viewvc screen or if any tool is available with viewvc to achieve this Each device family may require its own procedure to restore a config, possibly manual cut/paste.? One could automate it with expect talking to the console, but I have not done this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.o.hopkins at gmail.com Fri Oct 1 10:07:41 2021 From: c.o.hopkins at gmail.com (Craig Hopkins) Date: Fri, 1 Oct 2021 11:07:41 +0100 Subject: [rancid] Restore config on cisco devices In-Reply-To: References: <616421999.1285977.1632812313955.ref@mail.yahoo.com> <616421999.1285977.1632812313955@mail.yahoo.com> <782567046.292868.1632981231414@mail.yahoo.com> Message-ID: Pasting into a Cisco comes with risks, as it won't negate any default configuration that is already there. The safest approach is to give the switch a temporary IP address, and then TFTP / FTP the file into the startup-config position and reboot. On Thu, 30 Sept 2021 at 21:07, heasley wrote: > Thu, Sep 30, 2021 at 05:53:51AM +0000, simon ben: > > just wanted to know regarding the alternate way mentioned by you after > doing a minimum config for the cisco switch or router for network > connectivity as guess it would be a better option > > Is it possible to restore the config from viewvc screen from the browser > as I dont see any option neither no option to down and save it as a file on > my local desktop pc > > No, viewvc is only a CVS repository viewer. > > > appreciate your advice and help if the restore could be done from viewvc > screen or if any tool is available with viewvc to achieve this > > Each device family may require its own procedure to restore a config, > possibly > manual cut/paste. One could automate it with expect talking to the > console, > but I have not done this. > > _______________________________________________ > 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: From weylin at bu.edu Fri Oct 1 20:18:58 2021 From: weylin at bu.edu (Piegorsch, Weylin William) Date: Fri, 1 Oct 2021 20:18:58 +0000 Subject: [rancid] Restore config on cisco devices In-Reply-To: References: <616421999.1285977.1632812313955.ref@mail.yahoo.com> <616421999.1285977.1632812313955@mail.yahoo.com> <782567046.292868.1632981231414@mail.yahoo.com> Message-ID: Even with this, there are caveats, and it should be tested on a non-production unit and put into SOP form. Examples of things that can bite you: 1. Passwords might be obfuscated. If you?re not careful, some configurations can make it so that you can?t log on to the CLI, and would require a password recovery procedure to regain access to the unit. In some super-duper high security environments, you might not be able to recover the password and would need to RMA the unit. There?s a rancid parameter that I think addresses this, but test for it. 2. Passwords are not the only things obfuscated. Our ISIS keystrings and SNMP community strings I think are also obfuscated in rancid. I think there?s similarly a rancid parameter that affects this (might be the same one). 3. Some parameters are not stored in the running-config. VTP is particularly notorious about this. Even if you have ?vtp mode off?, not everything is in the running config. I?m running vtp version 3 / vtp mode off, and a ?show run | include vtp? the ?vtp mode off? shows up but ?vtp version 3? does not. Versions 1 and 2 had this messed up idea about extended VLANs that made a mess of some of our noisy edge cases, and we needed to set VTPv3 to fix them. 4. Depending on the particular operating system (ASAOS, IOS, NX-OS, etc) I?ve found different experiences with TFTP. Sometimes I needed to use the full path, sometimes just the relative path from the tftproot folder, sometimes something else. I?ve never had an issue with SCP (and I?ve not tested FTP). End result: test, test, test, document, retest, update documentation, and test again. [Description: Description: Description: Description: cid:image001.png at 01CC278D.7D527650] Weylin Piegorsch | Manager, Network Engineering Boston University Information Services & Technology weylin at bu.edu | 617.353.8128 | bu.edu/tech Listen. Learn. Lead. From: Craig Hopkins Date: Friday, October 1, 2021 at 6:07 AM To: heasley Cc: simon ben , "rancid-discuss at shrubbery.net" Subject: Re: [rancid] Restore config on cisco devices Pasting into a Cisco comes with risks, as it won't negate any default configuration that is already there. The safest approach is to give the switch a temporary IP address, and then TFTP / FTP the file into the startup-config position and reboot. On Thu, 30 Sept 2021 at 21:07, heasley > wrote: Thu, Sep 30, 2021 at 05:53:51AM +0000, simon ben: > just wanted to know regarding the alternate way mentioned by you after doing a minimum config for the cisco switch or router for network connectivity as guess it would be a better option > Is it possible to restore the config from viewvc screen from the browser as I dont see any option neither no option to down and save it as a file on my local desktop pc No, viewvc is only a CVS repository viewer. > appreciate your advice and help if the restore could be done from viewvc screen or if any tool is available with viewvc to achieve this Each device family may require its own procedure to restore a config, possibly manual cut/paste. One could automate it with expect talking to the console, but I have not done this. _______________________________________________ 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 1594 bytes Desc: image001.jpg URL: From mick.odonovan at heanet.ie Fri Oct 15 14:59:01 2021 From: mick.odonovan at heanet.ie (Mick O'Donovan) Date: Fri, 15 Oct 2021 14:59:01 +0000 Subject: [rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices Message-ID: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> Hi Heas, all, I'm struggling with an issue in trying to get some outputs from our ZPE estate of Out of Band devices using RANCID. What I have tried to do thus far is as follows: 1. Set credentials for my devices in .cloginrc 2. Cloned both clogin and rancid files in /var/lib/rancid/bin to zpelogin and zperancid respectively (just for separation) - Here's the diff of the files: rancid at rancid-staging:~/bin$ diff clogin zpelogin 1052,1072c1052,1072 < if { $do_command || $do_script } { < if { [string compare "extreme" "$platform"] } { < # If the prompt is (enable), then we are on a switch and the < # command is "set length 0"; otherwise its "terminal length 0". < if [regexp -- ".*> .*enable" "$prompt"] { < send "set length 0\r" < expect -re $prompt {} < send "set width 132\r" < expect -re $prompt {} < send "set logging session disable\r" < } else { < send "terminal length 0\r" < expect -re $prompt {} < send "terminal width 132\r" < } < expect -re $prompt {} < } else { < send "disable clipaging\r" < expect -re $prompt {} < } < } --- > # if { $do_command || $do_script } { > # if { [string compare "extreme" "$platform"] } { > # # If the prompt is (enable), then we are on a switch and the > # # command is "set length 0"; otherwise its "terminal length 0". > # if [regexp -- ".*> .*enable" "$prompt"] { > # send "set length 0\r" > # expect -re $prompt {} > # send "set width 132\r" > # expect -re $prompt {} > # send "set logging session disable\r" > # } else { > # send "terminal length 0\r" > # expect -re $prompt {} > # send "terminal width 132\r" > # } > # expect -re $prompt {} > # } else { > # send "disable clipaging\r" > # expect -re $prompt {} > # } > # } ^^^ so essentially I've removed the cisco specific terminal length setting, etc rancid at rancid-staging:~/bin$ diff rancid zperancid 140a141,143 > # I don't care if it sees "exit" > $clean_run = 1; > ^^^ It was recommended to me several weeks back to make this change but I can't for the life of me remember why. 3. edited /etc/rancid/rancid.types.[conf?/base] to include the following lines zpe;script;zperancid -t zpe zpe;login;zpelogin zpe;module;eos zpe;inloop;eos::inloop zpe;command;eos::ShowSoftware;show system/about zpe;command;eos::ShowConfig;export_settings ^^^ the above trying the eos.pm module When I run some debug against a host I receive the following: rancid -d -t zpe loadtype: device type zpe loadtype: found device type zpe in /etc/rancid/rancid.types.base executing zpelogin -t 90 -c"show system/about;export_settings;show_settings" PROMPT MATCH: \[heanet@ /\]# HIT COMMAND:[heanet@ /]# show system/about In ShowSoftware: [heanet@ /]# show system/about : missed cmd(s): export_settings,show_settings : missed cmd(s): export_settings,show_settings : End of run not found : End of run not found My reading of the above is that the module in question can properly understand the output received from the "show system/about" command and therefore stops and doesn't run the subsequent command. I would like to either get this sorted using pre-existing modules (probably not possible) or create a new perl module specific to zpe (happy to share with the community for others to use if needed). For completeness, he's a snip of the outputs received in each of the commands I'm looking to run: [heanet@ /]# show system/about/ system: Nodegrid Gate SR licenses: 25 software: vX.X.X (Sep 9 2021 - 09:39:02) cpu: Intel(R) Atom(TM) CPU C3538 @ 2.10GHz cpu_cores: 4 bogomips_per_core: 4200.00 serial_number: XXX uptime: 2 days, 23 hours, 49 minutes model: GateSR part_number: GSR-T8-BASE bios_version: 90816T00 psu: 2 revision tag: Initial Config 2021-01-18 11:03:08.917159 bios sed compatible: no ssd sed compatible: yes [heanet@ /]# export_settings /settings/auditing/destinations/email email_port=25 /settings/auditing/destinations/email password=******** /settings/auditing/destinations/email confirm_password=******** /settings/auditing/destinations/email start_tls=yes This is something that has been bugging me for a while so any help would be much appreciated! Regards, -- Mick O?Donovan Senior Network Engineer HEAnet CLG Ireland's National Education and Research Network 1st Floor | 5 George's Dock | IFSC | Dublin D01 X8N7 | Ireland +353 1 6609040 | mick.odonovan at heanet.ie | www.heanet.ie Registered in Ireland, No. 275301 | CRA No. 20036270 From heas at shrubbery.net Fri Oct 15 16:40:10 2021 From: heas at shrubbery.net (heasley) Date: Fri, 15 Oct 2021 16:40:10 +0000 Subject: [rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices In-Reply-To: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> References: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> Message-ID: Fri, Oct 15, 2021 at 02:59:01PM +0000, Mick O'Donovan: > rancid at rancid-staging:~/bin$ diff rancid zperancid > 140a141,143 > > # I don't care if it sees "exit" > > $clean_run = 1; > > > > ^^^ It was recommended to me several weeks back to make this change but I can't for the life of me remember why. IMO, it is part of the conversation and is further confirmation that was normal. Various devices have had cli bugs over time. Does not hurt to remove it for debugging. > rancid -d -t zpe > loadtype: device type zpe > loadtype: found device type zpe in /etc/rancid/rancid.types.base > executing zpelogin -t 90 -c"show system/about;export_settings;show_settings" > PROMPT MATCH: \[heanet@ /\]# I'm curious about the redacted bit; if it contains regex atoms that were not escaped by the login or perl script, that could be the problem. > HIT COMMAND:[heanet@ /]# show system/about > In ShowSoftware: [heanet@ /]# show system/about > : missed cmd(s): export_settings,show_settings > : missed cmd(s): export_settings,show_settings > : End of run not found > : End of run not found > > My reading of the above is that the module in question can properly understand the output received from the "show system/about" command and therefore stops and doesn't run the subsequent command. I would like to either get this sorted using pre-existing modules (probably not possible) or create a new perl module specific to zpe (happy to share with the community for others to use if needed). > I would first verify that the login script is running successfully. eval `rancid -C -t zpe` >& raw Look at the raw file to ensure that it has collected the complete output, not prematurely sent commands, etc - ie: it looks normal. My guess is that it is not matching the prompts promptly and sending command prematurely. Look for them [heanet@ /]# show system/about/ [heanet@ /]# export_settings [heanet@ /]# show_settings [heanet@ /]# exit if the regex match in the perl module is not correct, it might not be matching the prompt and therefore ShowSoftware() might be eating too much of the input - ie: the entire input. From mick.odonovan at heanet.ie Fri Oct 15 19:10:45 2021 From: mick.odonovan at heanet.ie (Mick O'Donovan) Date: Fri, 15 Oct 2021 19:10:45 +0000 Subject: [rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices In-Reply-To: References: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> Message-ID: <9ED90C4A-A1DA-4C26-9727-C5BA44842092@heanet.ie> ?On 15/10/2021, 17:40, "heasley" wrote: IMO, it is part of the conversation and is further confirmation that was normal. Various devices have had cli bugs over time. Does not hurt to remove it for debugging. By this do you mean to leave the original file alone or my version is fine? Sorry excuse my ignorance here. > rancid -d -t zpe > loadtype: device type zpe > loadtype: found device type zpe in /etc/rancid/rancid.types.base > executing zpelogin -t 90 -c"show system/about;export_settings;show_settings" > PROMPT MATCH: \[heanet@ /\]# I'm curious about the redacted bit; if it contains regex atoms that were not escaped by the login or perl script, that could be the problem. My apologies, this was a bit overly paranoid on my part. The is simply the test host FQDN or hostname. > HIT COMMAND:[heanet@ /]# show system/about > In ShowSoftware: [heanet@ /]# show system/about > : missed cmd(s): export_settings,show_settings > : missed cmd(s): export_settings,show_settings > : End of run not found > : End of run not found > > My reading of the above is that the module in question can properly understand the output received from the "show system/about" command and therefore stops and doesn't run the subsequent command. I would like to either get this sorted using pre-existing modules (probably not possible) or create a new perl module specific to zpe (happy to share with the community for others to use if needed). > I would first verify that the login script is running successfully. eval `rancid -C -t zpe` >& raw Look at the raw file to ensure that it has collected the complete output, not prematurely sent commands, etc - ie: it looks normal. My guess is that it is not matching the prompts promptly and sending command prematurely. Look for them [heanet@ /]# show system/about/ [heanet@ /]# export_settings [heanet@ /]# show_settings [heanet@ /]# exit if the regex match in the perl module is not correct, it might not be matching the prompt and therefore ShowSoftware() might be eating too much of the input - ie: the entire input. Something must be up alright, here's the contents of the raw file that was created... === Error: Usage: /usr/bin/zpelogin [-dhSV] [-m|M] [-autoenable] [-noenable] [-c command] [-Evar=x] [-e enable-password] [-f cloginrc-file] [-p user-password] [-r passphrase] [-s script-file] [-t timeout] [-u username] [-v vty-password] [-w enable-username] [-x command-file] [-y ssh_cypher_type] router [router...] === Any ideas? Mick From heas at shrubbery.net Fri Oct 15 19:15:58 2021 From: heas at shrubbery.net (heasley) Date: Fri, 15 Oct 2021 19:15:58 +0000 Subject: [rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices In-Reply-To: <9ED90C4A-A1DA-4C26-9727-C5BA44842092@heanet.ie> References: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> <9ED90C4A-A1DA-4C26-9727-C5BA44842092@heanet.ie> Message-ID: Fri, Oct 15, 2021 at 07:10:45PM +0000, Mick O'Donovan: > IMO, it is part of the conversation and is further confirmation that was > normal. Various devices have had cli bugs over time. Does not hurt to > remove it for debugging. > > By this do you mean to leave the original file alone or my version is fine? Sorry excuse my ignorance here. Leave the modification for testing, but to be pedantic, try to restore the check once everything else is working. > Something must be up alright, here's the contents of the raw file that was created... > > === > Error: Usage: /usr/bin/zpelogin [-dhSV] [-m|M] [-autoenable] [-noenable] [-c command] [-Evar=x] [-e enable-password] [-f cloginrc-file] [-p user-password] [-r passphrase] [-s script-file] [-t timeout] [-u username] [-v vty-password] [-w enable-username] [-x command-file] [-y ssh_cypher_type] router [router...] > === > > Any ideas? my mistake; the hostname is missing, whatever it is: eval `rancid -C -t zpe ` >& raw From mick.odonovan at heanet.ie Fri Oct 15 19:34:17 2021 From: mick.odonovan at heanet.ie (Mick O'Donovan) Date: Fri, 15 Oct 2021 19:34:17 +0000 Subject: [rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices In-Reply-To: References: <7F239A31-6214-412E-9750-FADF9647A5A5@heanet.ie> <9ED90C4A-A1DA-4C26-9727-C5BA44842092@heanet.ie> Message-ID: ?On 15/10/2021, 20:16, "heasley" wrote: CAUTION[External]: This email originated from outside of the organisation. Do not click on links or open the attachments unless you recognise the sender and know the content is safe. Fri, Oct 15, 2021 at 07:10:45PM +0000, Mick O'Donovan: > IMO, it is part of the conversation and is further confirmation that was > normal. Various devices have had cli bugs over time. Does not hurt to > remove it for debugging. > > By this do you mean to leave the original file alone or my version is fine? Sorry excuse my ignorance here. Leave the modification for testing, but to be pedantic, try to restore the check once everything else is working. > Something must be up alright, here's the contents of the raw file that was created... > > === > Error: Usage: /usr/bin/zpelogin [-dhSV] [-m|M] [-autoenable] [-noenable] [-c command] [-Evar=x] [-e enable-password] [-f cloginrc-file] [-p user-password] [-r passphrase] [-s script-file] [-t timeout] [-u username] [-v vty-password] [-w enable-username] [-x command-file] [-y ssh_cypher_type] router [router...] > === > > Any ideas? my mistake; the hostname is missing, whatever it is: eval `rancid -C -t zpe ` >& raw The raw file is flawless! This is most frustrating ? The raw file shows: 1. the login 2. command 1 being run 3. the command 1 output (in full and as expected) 4. command 2 being run (I've reduced it to just two commands - "show system/about" and "export_settings") 5. the command 2 output (in full and as expected) 6. the exit being issued and successfully exiting Mick From mducharme at gmail.com Tue Oct 12 01:28:39 2021 From: mducharme at gmail.com (Michael Ducharme) Date: Mon, 11 Oct 2021 18:28:39 -0700 Subject: [rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4 Message-ID: Hello, I just wanted to let you know - on the MikroTik forum I am seeing reports that RANCID is no longer working to back up RouterOS versions 6.49 and 7.1rc3 and 7.1rc4. The commands still run and there were no documented changes to the console or SSH on the MikroTik side recently, so I'm not sure why this is happening suddenly. I was trying to go through the code to see what the problem might be, but could not find anything. Please see this post for details on the error: https://forum.mikrotik.com/viewtopic.php?p=885246#p885246 I also tried loading up the output of the working 6.48.4 vs non-working 6.49 into a hex editor to see if there were any unexpected characters being added that might be confusing RANCID but did not find anything of note. It looks pretty much the same to me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heas at shrubbery.net Fri Oct 15 20:20:58 2021 From: heas at shrubbery.net (heasley) Date: Fri, 15 Oct 2021 20:20:58 +0000 Subject: [rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4 In-Reply-To: References: Message-ID: Mon, Oct 11, 2021 at 06:28:39PM -0700, Michael Ducharme: > Hello, > > I just wanted to let you know - on the MikroTik forum I am seeing reports > that RANCID is no longer working to back up RouterOS versions 6.49 and > 7.1rc3 and 7.1rc4. The commands still run and there were no documented > changes to the console or SSH on the MikroTik side recently, so I'm not > sure why this is happening suddenly. I was trying to go through the code to > see what the problem might be, but could not find anything. > > Please see this post for details on the error: > https://forum.mikrotik.com/viewtopic.php?p=885246#p885246 Care to the attached patch? > I also tried loading up the output of the working 6.48.4 vs non-working > 6.49 into a hex editor to see if there were any unexpected characters being > added that might be confusing RANCID but did not find anything of note. It > looks pretty much the same to me. I have access to only one Mikrotik and its running an older O/S. I've tested the patch against it. -------------- next part -------------- A non-text attachment was scrubbed... Name: mt7.diff Type: text/x-diff Size: 1535 bytes Desc: not available URL: From mducharme at gmail.com Fri Oct 15 20:39:18 2021 From: mducharme at gmail.com (Michael Ducharme) Date: Fri, 15 Oct 2021 13:39:18 -0700 Subject: [rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4 In-Reply-To: References: Message-ID: Hello, I had a look at your patch and I'm not sure that would fix the issue. Also show-sensitive only works with v7 and above and throws an error on RouterOS v6. Someone on the MikroTik forums found that there is no longer a newline being generated after the output so the regexp doesn't match and so RANCID no longer identifies the end of the command. You can see more detail here: https://forum.mikrotik.com/viewtopic.php?t=179233#p885616 They came up with this patch to fix it and I confirmed that it works with RouterOS v6.49 and v7. However I haven't tested with older RouterOS versions, and I don't know if it might break something else: --- /usr/libexec/rancid/mtrancid-orig 2021-10-14 03:44:22.102333666 +0200+++ /usr/libexec/rancid/mtrancid 2021-10-13 07:16:22.567538444 +0200@@ -348,7 +348,7 @@ $clean_run=0; last; }- while (/\s*($cmds_regexp)\s*$/) {+ while (/\s*($cmds_regexp)\s*/) { $cmd = $1; if (!defined($prompt)) { $prompt = "\] > "; # crude but effective On Fri, Oct 15, 2021 at 1:20 PM heasley wrote: > Mon, Oct 11, 2021 at 06:28:39PM -0700, Michael Ducharme: > > Hello, > > > > I just wanted to let you know - on the MikroTik forum I am seeing reports > > that RANCID is no longer working to back up RouterOS versions 6.49 and > > 7.1rc3 and 7.1rc4. The commands still run and there were no documented > > changes to the console or SSH on the MikroTik side recently, so I'm not > > sure why this is happening suddenly. I was trying to go through the code > to > > see what the problem might be, but could not find anything. > > > > Please see this post for details on the error: > > https://forum.mikrotik.com/viewtopic.php?p=885246#p885246 > > Care to the attached patch? > > > I also tried loading up the output of the working 6.48.4 vs non-working > > 6.49 into a hex editor to see if there were any unexpected characters > being > > added that might be confusing RANCID but did not find anything of note. > It > > looks pretty much the same to me. > > I have access to only one Mikrotik and its running an older O/S. I've > tested the patch against it. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From heas at shrubbery.net Fri Oct 15 20:56:24 2021 From: heas at shrubbery.net (heasley) Date: Fri, 15 Oct 2021 20:56:24 +0000 Subject: [rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4 In-Reply-To: References: Message-ID: Fri, Oct 15, 2021 at 01:39:18PM -0700, Michael Ducharme: > Hello, > > I had a look at your patch and I'm not sure that would fix the issue. Also > show-sensitive only works with v7 and above and throws an error on RouterOS > v6. > > Someone on the MikroTik forums found that there is no longer a newline > being generated after the output so the regexp doesn't match and so RANCID > no longer identifies the end of the command. You can see more detail here: > https://forum.mikrotik.com/viewtopic.php?t=179233#p885616 ah, thats a separate problem. thats fun. without looking-up that esc code, looks like some fancy cmdline hanlding. Maybe this will avoid that stupidity? diff --git a/lib/routeros.pm.in b/lib/routeros.pm.in index 3b1b7dae..4ab9730e 100644 --- a/lib/routeros.pm.in +++ b/lib/routeros.pm.in @@ -23,6 +23,8 @@ use rancid @VERSION@; # load-time initialization sub import { + $ENV{'TERM'} = "vt100"; + $timeo = 90; # mtlogin timeout in seconds 0; or "network" or "dumb", if it has either in its termcap. > They came up with this patch to fix it and I confirmed that it works with > RouterOS v6.49 and v7. However I haven't tested with older RouterOS > versions, and I don't know if it might break something else: it could match other output unintentionally - maybe. > --- /usr/libexec/rancid/mtrancid-orig 2021-10-14 > 03:44:22.102333666 +0200+++ /usr/libexec/rancid/mtrancid > 2021-10-13 07:16:22.567538444 +0200@@ -348,7 +348,7 @@ > $clean_run=0; > last; > } > - while (/\s*($cmds_regexp)\s*$/) { > + while (/\s*($cmds_regexp)\s*/) { > $cmd = $1; > if (!defined($prompt)) { > $prompt = "\] > "; # crude but effective From mducharme at gmail.com Sun Oct 17 00:35:16 2021 From: mducharme at gmail.com (Michael Ducharme) Date: Sat, 16 Oct 2021 17:35:16 -0700 Subject: [rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4 In-Reply-To: References: Message-ID: Hello, Unfortunately, that does not fix it, and neither does "network" or "dumb". Something that I might suggest is that you install the free CHR (cloud hosted router) as a VM rather easily, as long as you have a hypervisor, and test against that. On Fri, Oct 15, 2021 at 1:56 PM heasley wrote: > Fri, Oct 15, 2021 at 01:39:18PM -0700, Michael Ducharme: > > Hello, > > > > I had a look at your patch and I'm not sure that would fix the issue. > Also > > show-sensitive only works with v7 and above and throws an error on > RouterOS > > v6. > > > > Someone on the MikroTik forums found that there is no longer a newline > > being generated after the output so the regexp doesn't match and so > RANCID > > no longer identifies the end of the command. You can see more detail > here: > > https://forum.mikrotik.com/viewtopic.php?t=179233#p885616 > > ah, thats a separate problem. thats fun. without looking-up that esc > code, looks like some fancy cmdline hanlding. Maybe this will avoid > that stupidity? > > diff --git a/lib/routeros.pm.in b/lib/routeros.pm.in > index 3b1b7dae..4ab9730e 100644 > --- a/lib/routeros.pm.in > +++ b/lib/routeros.pm.in > @@ -23,6 +23,8 @@ use rancid @VERSION@; > > # load-time initialization > sub import { > + $ENV{'TERM'} = "vt100"; > + > $timeo = 90; # mtlogin timeout in seconds > > 0; > > or "network" or "dumb", if it has either in its termcap. > > > They came up with this patch to fix it and I confirmed that it works with > > RouterOS v6.49 and v7. However I haven't tested with older RouterOS > > versions, and I don't know if it might break something else: > > it could match other output unintentionally - maybe. > > > --- /usr/libexec/rancid/mtrancid-orig 2021-10-14 > > 03:44:22.102333666 +0200+++ /usr/libexec/rancid/mtrancid > > 2021-10-13 07:16:22.567538444 +0200@@ -348,7 +348,7 @@ > > $clean_run=0; > > last; > > } > > - while (/\s*($cmds_regexp)\s*$/) { > > + while (/\s*($cmds_regexp)\s*/) { > > $cmd = $1; > > if (!defined($prompt)) { > > $prompt = "\] > "; # crude but effective > -------------- next part -------------- An HTML attachment was scrubbed... URL: From GeertJan.deGroot at xs4all.nl Sun Oct 31 22:36:14 2021 From: GeertJan.deGroot at xs4all.nl (Geert Jan de Groot) Date: Sun, 31 Oct 2021 23:36:14 +0100 Subject: [rancid] Rancid in FreeBSD ports break on FreeBSD 13.0 Message-ID: <0b574d12-5705-d422-3fb3-1f28d1d1cf0e@xs4all.nl> Hi, Perhaps I should not report this because the current version of Rancid is 3.1, but the version in FreeBSD pkg is still 2.3.8. Anyway.. With the upgrade to FreeBSD 13.0, this old version of Rancid broke. Root cause seems to be the use of "diff -u -4" in control-rancid. I'm not sure what '-4' does; could not find it in the man pages of diff. Anyway, omitting it makes things work again. I should just install from the repository, but "not today". Geert Jan *** control_rancid.SAV Sun Apr 3 14:32:28 2016 --- control_rancid Sun Oct 31 16:36:14 2021 *************** *** 199,213 **** tr '[A-Z]' '[a-z]' | sort -u > routers.db cut -d: -f1,2 routers.db > routers.all.new if [ ! -f routers.all ] ; then touch routers.all; fi ! diff -u -4 routers.all routers.all.new > /dev/null 2>&1; RALL=$? perl5 -F: -ane '{$F[2] =~ s/\s*\$//; ($F[0] =~ tr at A-Z@a-z@, print $_) if ($F[2] !~ /^up$/i);}' routers.db > routers.down.new if [ ! -f routers.down ] ; then touch routers.down; fi ! diff -u -4 routers.down routers.down.new > /dev/null 2>&1; RDOWN=$? perl5 -F: -ane '{$F[2] =~ s/\s*\$//; ($F[0] =~ tr at A-Z@a-z@, print "$F[0]:$F[1]\n") if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new if [ ! -f routers.up ] ; then touch routers.up; fi ! diff -u -4 routers.up routers.up.new > /dev/null 2>&1; RUP=$? if [ $RALL -ne 0 -o $RDOWN -ne 0 -o $RUP -ne 0 ] ; then ( --- 199,213 ---- tr '[A-Z]' '[a-z]' | sort -u > routers.db cut -d: -f1,2 routers.db > routers.all.new if [ ! -f routers.all ] ; then touch routers.all; fi ! diff -u routers.all routers.all.new > /dev/null 2>&1; RALL=$? perl5 -F: -ane '{$F[2] =~ s/\s*\$//; ($F[0] =~ tr at A-Z@a-z@, print $_) if ($F[2] !~ /^up$/i);}' routers.db > routers.down.new if [ ! -f routers.down ] ; then touch routers.down; fi ! diff -u routers.down routers.down.new > /dev/null 2>&1; RDOWN=$? perl5 -F: -ane '{$F[2] =~ s/\s*\$//; ($F[0] =~ tr at A-Z@a-z@, print "$F[0]:$F[1]\n") if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new if [ ! -f routers.up ] ; then touch routers.up; fi ! diff -u routers.up routers.up.new > /dev/null 2>&1; RUP=$? if [ $RALL -ne 0 -o $RDOWN -ne 0 -o $RUP -ne 0 ] ; then (