From mic.g2 at hotmail.fr Fri Dec 1 10:39:29 2023 From: mic.g2 at hotmail.fr (michael gauthier) Date: Fri, 1 Dec 2023 10:39:29 +0000 Subject: [rancid] Problem with Dell S4148F-ON Message-ID: Hello, I'm trying to integrate Dell switching S4148F-ON (Dell EMC Networking OS10 Enterprise) but whatever type I'm choosing I have error. With force10 type (alias to dnos9) rancid at vm:~$ NOPIPE=yes rancid -d -t force10 switch1 loadtype: device type force10 loadtype: found device type force10 at /etc/rancid/rancid.types.base:535 loadtype: found device type force10 aliased to dnos9 loadtype: device type dnos9 loadtype: found device type dnos9 at /etc/rancid/rancid.types.base:415 executing clogin -t 90 -c"show version;show bootvar;dir flash:;dir slot0:;show chassis;show system;show inventory;show vlan;show running" switch1 PROMPT MATCH: switch1# HIT COMMAND:switch1# show version In ShowVersion: switch1# show version HIT COMMAND:switch1# dir flash: In DirSlotN: switch1# dir flash: HIT COMMAND:switch1# dir slot0: In DirSlotN: switch1# dir slot0: HIT COMMAND:switch1# show chassis In ShowChassis: switch1# show chassis HIT COMMAND:switch1# show system In ShowChassis: switch1# show system switch1: missed cmd(s): show bootvar, show inventory, show vlan switch1: End of run not found switch1: clean_run is false switch1: found_end is false With dnos10: rancid at vm:~$ NOPIPE=yes rancid -d -t dnos10 switch1 loadtype: device type dnos10 loadtype: found device type dnos10 at /etc/rancid/rancid.types.base:432 executing hlogin -t 90 -c"terminal length 0;show system;show version;show inventory;show inventory media;show vlan;show running-configuration" switch1 switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory switch1: missed cmd(s): all commands switch1: End of run not found switch1: clean_run is false switch1: found_end is false I'm not an expert but I can try some tweak if you have an idea. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heas at shrubbery.net Fri Dec 1 15:43:17 2023 From: heas at shrubbery.net (heasley) Date: Fri, 1 Dec 2023 15:43:17 +0000 Subject: [rancid] Problem with Dell S4148F-ON In-Reply-To: References: Message-ID: Fri, Dec 01, 2023 at 10:39:29AM +0000, michael gauthier: > Hello, > > I'm trying to integrate Dell switching S4148F-ON (Dell EMC Networking OS10 Enterprise) but whatever type I'm choosing I have error. > > With dnos10: > > rancid at vm:~$ NOPIPE=yes rancid -d -t dnos10 switch1 > loadtype: device type dnos10 > loadtype: found device type dnos10 at /etc/rancid/rancid.types.base:432 > executing hlogin -t 90 -c"terminal length 0;show system;show version;show inventory;show inventory media;show vlan;show running-configuration" switch1 > switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory > switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory > switch1: missed cmd(s): all commands > switch1: End of run not found > switch1: clean_run is false > switch1: found_end is false > > I'm not an expert but I can try some tweak if you have an idea. dnos10 is what I would expect to use, not to say that the other type would not work, but I do not have much experience with dnos. however, the hlogin error is definitely a problem for your test. You must ensure that the location of hpuifilter is in your shell's PATH; rancid inherits this from its parent. If spawned by rancid-run, it will have read the rancid.conf, which sets PATH appropriately; you can do that too: . /path/to/rancid.conf rancid -d .... From mic.g2 at hotmail.fr Mon Dec 4 06:55:50 2023 From: mic.g2 at hotmail.fr (michael gauthier) Date: Mon, 4 Dec 2023 06:55:50 +0000 Subject: [rancid] Problem with Dell S4148F-ON In-Reply-To: References: Message-ID: Thanks for your help. Location of hpuifilter /usr/lib/rancid/bin/hpuifilter Extract of rancid.conf PATH=/usr/lib/rancid/bin:/usr/bin:/usr/sbin:/bin:/usr/local/bin; export PATH ________________________________ De : heasley Envoy? : vendredi 1 d?cembre 2023 16:43 ? : michael gauthier Cc : rancid-discuss at www.shrubbery.net Objet : Re: [rancid] Problem with Dell S4148F-ON Fri, Dec 01, 2023 at 10:39:29AM +0000, michael gauthier: > Hello, > > I'm trying to integrate Dell switching S4148F-ON (Dell EMC Networking OS10 Enterprise) but whatever type I'm choosing I have error. > > With dnos10: > > rancid at vm:~$ NOPIPE=yes rancid -d -t dnos10 switch1 > loadtype: device type dnos10 > loadtype: found device type dnos10 at /etc/rancid/rancid.types.base:432 > executing hlogin -t 90 -c"terminal length 0;show system;show version;show inventory;show inventory media;show vlan;show running-configuration" switch1 > switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory > switch1 hlogin error: Error: ssh failed: couldn't execute "hpuifilter": no such file or directory > switch1: missed cmd(s): all commands > switch1: End of run not found > switch1: clean_run is false > switch1: found_end is false > > I'm not an expert but I can try some tweak if you have an idea. dnos10 is what I would expect to use, not to say that the other type would not work, but I do not have much experience with dnos. however, the hlogin error is definitely a problem for your test. You must ensure that the location of hpuifilter is in your shell's PATH; rancid inherits this from its parent. If spawned by rancid-run, it will have read the rancid.conf, which sets PATH appropriately; you can do that too: . /path/to/rancid.conf rancid -d .... -------------- next part -------------- An HTML attachment was scrubbed... URL: From on at LEFerguson.com Wed Dec 6 18:00:08 2023 From: on at LEFerguson.com (on at LEFerguson.com) Date: Wed, 6 Dec 2023 18:00:08 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: I have several clients for whom I use rancid and they are all cisco. I have one who had a horrible mixture of D-Link, Cisco, Netgear, etc. Over years I modified, kludged, hacked and re-kludged rancid trying to make it workable. I'd like to bring them up to date, and honestly between legit changes from upstream and my mess I just want to start over. Also, they got rid of the 'etc' and D-Link and now just have half Netgear and half Cisco. The Netgear allows SSH and does a semi-similar show to ciscos, just... different. In some brief consultation with Google I found little, stumbled on where I had asked about this 6 years or so ago. Does anyone have workable configs for modern netgear stuff (the ones with real configs and current firmware, not all the home stuff)? My priority is that it not include changes that preclude easy upgrade of rancid, otherwise I'm going to tell them to stay on the old, or not do change control on Netgear. I just did a clean install on my home system, and I see nothing new in that regard, though more robust filters, etc. might actually make it practical with a different vendor's name. Linwood PS. Note to moderator - I accidentally sent this from a different email first, it went into needing approval - you can just delete or ignore that. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heas at shrubbery.net Wed Dec 6 20:51:30 2023 From: heas at shrubbery.net (heasley) Date: Wed, 6 Dec 2023 20:51:30 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Wed, Dec 06, 2023 at 06:00:08PM +0000, on at LEFerguson.com: > I have several clients for whom I use rancid and they are all cisco. > > I have one who had a horrible mixture of D-Link, Cisco, Netgear, etc. Over years I modified, kludged, hacked and re-kludged rancid trying to make it workable. > > I'd like to bring them up to date, and honestly between legit changes from upstream and my mess I just want to start over. Also, they got rid of the 'etc' and D-Link and now just have half Netgear and half Cisco. The Netgear allows SSH and does a semi-similar show to ciscos, just... different. > > In some brief consultation with Google I found little, stumbled on where I had asked about this 6 years or so ago. > > Does anyone have workable configs for modern netgear stuff (the ones with real configs and current firmware, not all the home stuff)? My priority is that it not include changes that preclude easy upgrade of rancid, otherwise I'm going to tell them to stay on the old, or not do change control on Netgear. > > I just did a clean install on my home system, and I see nothing new in that regard, though more robust filters, etc. might actually make it practical with a different vendor's name. I do not have any netgear devices. I'd make it work if I had one and I do need a 802.3bt switch; the (bloody expensive) M4250 supports ssh, but the docs talk more about the web intf than cli and it is not clear what is possible in the cli. If a model supports ssh, does it support configuration via the cli? Also, depending on what changes you made to the previous version, it might be possible to just use the module you changed as a different device type. From athompson at merlin.mb.ca Wed Dec 6 20:56:55 2023 From: athompson at merlin.mb.ca (Adam Thompson) Date: Wed, 6 Dec 2023 20:56:55 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: I happen to know the answer to that! The M4250 is CLI-manageable and configurable. The key term in Netgear-ese is "Fully Managed", which means full CLI, SNMP, as well as WebUI. Doesn't mean they didn't forget to include some feature or seventeen in the CLI, but it is supposed to be fully-manageable via SSH. Adam Thompson Consultant, Infrastructure Services MERLIN 100 - 135 Innovation Drive? Winnipeg, MB R3T 6A8? (204) 977-6824 or 1-800-430-6404 (MB only)? https://www.merlin.mb.ca? > -----Original Message----- > From: Rancid-discuss On > Behalf Of heasley > Sent: Wednesday, December 6, 2023 2:52 PM > To: on at LEFerguson.com > Cc: rancid-discuss at shrubbery.net > Subject: Re: [rancid] Netgear switches in 2023 (or 2024) > > Wed, Dec 06, 2023 at 06:00:08PM +0000, on at LEFerguson.com: > > I have several clients for whom I use rancid and they are all cisco. > > > > I have one who had a horrible mixture of D-Link, Cisco, Netgear, etc. Over > years I modified, kludged, hacked and re-kludged rancid trying to make it > workable. > > > > I'd like to bring them up to date, and honestly between legit changes from > upstream and my mess I just want to start over. Also, they got rid of the 'etc' > and D-Link and now just have half Netgear and half Cisco. The Netgear allows > SSH and does a semi-similar show to ciscos, just... different. > > > > In some brief consultation with Google I found little, stumbled on where I > had asked about this 6 years or so ago. > > > > Does anyone have workable configs for modern netgear stuff (the ones with > real configs and current firmware, not all the home stuff)? My priority is that > it not include changes that preclude easy upgrade of rancid, otherwise I'm > going to tell them to stay on the old, or not do change control on Netgear. > > > > I just did a clean install on my home system, and I see nothing new in that > regard, though more robust filters, etc. might actually make it practical with a > different vendor's name. > > I do not have any netgear devices. I'd make it work if I had one and I do > need a 802.3bt switch; the (bloody expensive) M4250 supports ssh, but the > docs talk more about the web intf than cli and it is not clear what is > possible in the cli. If a model supports ssh, does it support > configuration via the cli? > > Also, depending on what changes you made to the previous version, it might > be possible to just use the module you changed as a different device type. > > _______________________________________________ > Rancid-discuss mailing list > Rancid-discuss at www.shrubbery.net > https://www.shrubbery.net/mailman/listinfo/rancid-discuss From on at LEFerguson.com Thu Dec 7 03:02:37 2023 From: on at LEFerguson.com (on at LEFerguson.com) Date: Thu, 7 Dec 2023 03:02:37 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Yes, Netgear seems to have odd ideas of "managed", but the fully managed switches do seem recoverable from the prior saved show command. But I have, for example a GS728TPV2 which supports SH but is not fully managed, at least I do not think it is. It says it has "cloud management" which I do not use, but I can ssh to it and do a show run and get something that looks pretty realistic. I suspect though it is just one of many flavors for different switches (and software versions of switches). What I found though (and remember this was about 5 years ago) was I needed to tweak and change a lot of the code to handle spacing, premature end of files, special characters and such, I could not just string together modules in the rancid.types.conf file. And maybe I just didn't know how to do it well, and upgradably (is that a word?). Anyway, sounds like not a lot is there out of the box, that was my main question, to make sure I wasn't missing something. Thanks. Linwood -----Original Message----- From: Adam Thompson Sent: Wednesday, December 6, 2023 3:57 PM To: heasley ; on at LEFerguson.com Cc: rancid-discuss at shrubbery.net Subject: RE: [rancid] Netgear switches in 2023 (or 2024) I happen to know the answer to that! The M4250 is CLI-manageable and configurable. The key term in Netgear-ese is "Fully Managed", which means full CLI, SNMP, as well as WebUI. Doesn't mean they didn't forget to include some feature or seventeen in the CLI, but it is supposed to be fully-manageable via SSH. Adam Thompson Consultant, Infrastructure Services MERLIN 100 - 135 Innovation Drive? Winnipeg, MB R3T 6A8? (204) 977-6824 or 1-800-430-6404 (MB only)? https://www.merlin.mb.ca? > -----Original Message----- > From: Rancid-discuss On > Behalf Of heasley > Sent: Wednesday, December 6, 2023 2:52 PM > To: on at LEFerguson.com > Cc: rancid-discuss at shrubbery.net > Subject: Re: [rancid] Netgear switches in 2023 (or 2024) > > Wed, Dec 06, 2023 at 06:00:08PM +0000, on at LEFerguson.com: > > I have several clients for whom I use rancid and they are all cisco. > > > > I have one who had a horrible mixture of D-Link, Cisco, Netgear, etc. Over > years I modified, kludged, hacked and re-kludged rancid trying to make it > workable. > > > > I'd like to bring them up to date, and honestly between legit changes from > upstream and my mess I just want to start over. Also, they got rid of the 'etc' > and D-Link and now just have half Netgear and half Cisco. The Netgear allows > SSH and does a semi-similar show to ciscos, just... different. > > > > In some brief consultation with Google I found little, stumbled on where I > had asked about this 6 years or so ago. > > > > Does anyone have workable configs for modern netgear stuff (the ones with > real configs and current firmware, not all the home stuff)? My priority is that > it not include changes that preclude easy upgrade of rancid, otherwise I'm > going to tell them to stay on the old, or not do change control on Netgear. > > > > I just did a clean install on my home system, and I see nothing new in that > regard, though more robust filters, etc. might actually make it practical with a > different vendor's name. > > I do not have any netgear devices. I'd make it work if I had one and I do > need a 802.3bt switch; the (bloody expensive) M4250 supports ssh, but the > docs talk more about the web intf than cli and it is not clear what is > possible in the cli. If a model supports ssh, does it support > configuration via the cli? > > Also, depending on what changes you made to the previous version, it might > be possible to just use the module you changed as a different device type. > > _______________________________________________ > Rancid-discuss mailing list > Rancid-discuss at www.shrubbery.net > https://www.shrubbery.net/mailman/listinfo/rancid-discuss From heas at shrubbery.net Fri Dec 8 13:52:20 2023 From: heas at shrubbery.net (heasley) Date: Fri, 8 Dec 2023 13:52:20 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Wed, Dec 06, 2023 at 08:56:55PM +0000, Adam Thompson: > I happen to know the answer to that! The M4250 is CLI-manageable and configurable. The key term in Netgear-ese is "Fully Managed", which means full CLI, SNMP, as well as WebUI. Doesn't mean they didn't forget to include some feature or seventeen in the CLI, but it is supposed to be fully-manageable via SSH. Well, if anyone has one to which they can give me remote access to dev a module, lmk. From on at LEFerguson.com Fri Dec 8 14:50:41 2023 From: on at LEFerguson.com (on at LEFerguson.com) Date: Fri, 8 Dec 2023 14:50:41 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Do you need access, or output from all the show commands? I don't personally own a "fully managed" netgear, only a "cloud managed" which may be different (well, is different, it doesn't have user ID's for one thing, just a password). A client has many but is a government facility so that's not happening, but I can probably get all the show commands from one or more (+/- redacting passwords), and then test the result. I'd have to ask, but I realize that is not idea, so will see if anyone else volunteers. Linwood -----Original Message----- From: heasley Sent: Friday, December 8, 2023 8:52 AM To: Adam Thompson Cc: heasley ; on at LEFerguson.com; rancid-discuss at shrubbery.net Subject: Re: [rancid] Netgear switches in 2023 (or 2024) Wed, Dec 06, 2023 at 08:56:55PM +0000, Adam Thompson: > I happen to know the answer to that! The M4250 is CLI-manageable and configurable. The key term in Netgear-ese is "Fully Managed", which means full CLI, SNMP, as well as WebUI. Doesn't mean they didn't forget to include some feature or seventeen in the CLI, but it is supposed to be fully-manageable via SSH. Well, if anyone has one to which they can give me remote access to dev a module, lmk. From heas at shrubbery.net Fri Dec 8 15:30:47 2023 From: heas at shrubbery.net (heasley) Date: Fri, 8 Dec 2023 15:30:47 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Fri, Dec 08, 2023 at 02:50:41PM +0000, on at LEFerguson.com: > Do you need access, or output from all the show commands? > > I don't personally own a "fully managed" netgear, only a "cloud managed" which may be different (well, is different, it doesn't have user ID's for one thing, just a password). A client has many but is a government facility so that's not happening, but I can probably get all the show commands from one or more (+/- redacting passwords), and then test the result. I'd have to ask, but I realize that is not idea, so will see if anyone else volunteers. Best if I could access it myself, but if the login script was well tested, then just the complete transcript of the login might be enough. > Linwood > > > > -----Original Message----- > From: heasley > Sent: Friday, December 8, 2023 8:52 AM > To: Adam Thompson > Cc: heasley ; on at LEFerguson.com; rancid-discuss at shrubbery.net > Subject: Re: [rancid] Netgear switches in 2023 (or 2024) > > Wed, Dec 06, 2023 at 08:56:55PM +0000, Adam Thompson: > > I happen to know the answer to that! The M4250 is CLI-manageable and configurable. The key term in Netgear-ese is "Fully Managed", which means full CLI, SNMP, as well as WebUI. Doesn't mean they didn't forget to include some feature or seventeen in the CLI, but it is supposed to be fully-manageable via SSH. > > Well, if anyone has one to which they can give me remote access to dev a > module, lmk. From on at LEFerguson.com Fri Dec 8 15:34:46 2023 From: on at LEFerguson.com (on at LEFerguson.com) Date: Fri, 8 Dec 2023 15:34:46 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: > Best if I could access it myself, but if the login script was well tested, > then just the complete transcript of the login might be enough. Of course, fairly easy if I had one myself. Governments are kind of inflexible on security, especially today. I am unclear on terminology, and sure you don't mean just a login, but the output of a bunch of show commands? Is there a sequence I feed it or something that might give you what you want? (I can guess and just give the output of each show command it supports, but it sounds like you have something specific in mind). Linwood From heas at shrubbery.net Fri Dec 8 15:38:42 2023 From: heas at shrubbery.net (heasley) Date: Fri, 8 Dec 2023 15:38:42 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Fri, Dec 08, 2023 at 03:34:46PM +0000, on at LEFerguson.com: > I am unclear on terminology, and sure you don't mean just a login, but the output of a bunch of show commands? Is there a sequence I feed it or something that might give you what you want? (I can guess and just give the output of each show command it supports, but it sounds like you have something specific in mind). Right, so that I can see its behavior, the complete output from: loginscript -c 'cmd;cmd;...' hostname > output 2>&1 From on at LEFerguson.com Fri Dec 8 15:42:42 2023 From: on at LEFerguson.com (on at LEFerguson.com) Date: Fri, 8 Dec 2023 15:42:42 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: > Right, so that I can see its behavior, the complete output from: > loginscript -c 'cmd;cmd;...' hostname > output 2>&1 Perfect. And cmd are each show. Let me clear it with my contact there, but I think that will be OK. Linwood From heas at shrubbery.net Fri Dec 8 16:45:03 2023 From: heas at shrubbery.net (heasley) Date: Fri, 8 Dec 2023 16:45:03 +0000 Subject: [rancid] Netgear switches in 2023 (or 2024) In-Reply-To: References: Message-ID: Fri, Dec 08, 2023 at 03:42:42PM +0000, on at LEFerguson.com: > > > Right, so that I can see its behavior, the complete output from: > > loginscript -c 'cmd;cmd;...' hostname > output 2>&1 > > Perfect. And cmd are each show. Let me clear it with my contact there, but I think that will be OK. I have never used one of these, but yes, the commands would be a list of show or show-like commands. show version show license show bootimage show admin show vlans show hardware/chassis show optics show storage/disk show otherthingsofinterest somecommandthatdoesnotexit andgeneratesanerror show running-config Also need to know how to disable the pager at login (eg: term len 0) and disable syslog to the terminal (if that is a thing for that NOS) and which login script works with the device to login and become enabled. From jlewis at lewis.org Sun Dec 10 03:47:11 2023 From: jlewis at lewis.org (Jon Lewis) Date: Sat, 9 Dec 2023 22:47:11 -0500 (EST) Subject: [rancid] adding a "new" type for axos Message-ID: <3d930bb-05-a7e9-f921-a3385ef1d978@lewis.org> I'm trying to get rancid to backup Calix AXOS E7-2's. I've run into a snag with the end of run being properly recognized. I'm running rancid-3.13-1 on Ubuntu 22.04.03. I decided to try re-using the ios module for axos. I added this to rancid.types.conf: axos;script;rancid -t axos axos;login;clogin axos;module;ios axos;inloop;ios::inloop axos;command;ios::ShowVersion;show version axos;command;ios::WriteTerm;show running-config | nomore Since the axos "show running-config" output has no "end tag" to it; the output simply ends and you're returned to a prompt, I made the change below so that $found_end will be set to 1 for axos device types if some config was printed. I've verified this works and sets $found_end = 1. --- ios.pm.orig 2020-10-15 11:26:17.000000000 -0400 +++ ios.pm 2023-12-09 22:21:50.408683973 -0500 @@ -2787,7 +2794,7 @@ # The ContentEngine lacks a definitive "end of config" marker. If we # know that it is a CE, SAN, or NXOS and we have seen at least 5 lines # of write term output, we can be reasonably sure that we have the config. - if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS") && $linecnt > 5) { + if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS" || $devtype eq "axos") && $linecnt > 5) { $found_end = 1; return(0); } The problem I think I've run into is, the final exit isn't being recognized and $clean_run doesn't get set to 1, resulting in "End of run not found". Near the top of inloop in ios.pm, there's this bit of code: if (/[>#]\s?exit$/) { $clean_run = 1; last; } which seems like it should be matching, but is not. The last few lines of the raw file left by running rancid -d -t axos are: no shutdown ! some-device#exit Shared connection to X.X.X.X closed. In the raw file, exit is followed CRLF. ---------------------------------------------------------------------- Jon Lewis, MCP :) | I route Blue Stream Fiber, Sr. Neteng | therefore you are _________ http://www.lewis.org/~jlewis/pgp for PGP public key_________ From jlewis at lewis.org Mon Dec 11 04:18:53 2023 From: jlewis at lewis.org (Jon Lewis) Date: Sun, 10 Dec 2023 23:18:53 -0500 (EST) Subject: [rancid] adding a "new" type for axos In-Reply-To: <3d930bb-05-a7e9-f921-a3385ef1d978@lewis.org> References: <3d930bb-05-a7e9-f921-a3385ef1d978@lewis.org> Message-ID: <4b47166c-ea4e-cadb-2843-368c81c0b497@lewis.org> On Sat, 9 Dec 2023, Jon Lewis wrote: > --- ios.pm.orig 2020-10-15 11:26:17.000000000 -0400 > +++ ios.pm 2023-12-09 22:21:50.408683973 -0500 > @@ -2787,7 +2794,7 @@ > # The ContentEngine lacks a definitive "end of config" marker. If we > # know that it is a CE, SAN, or NXOS and we have seen at least 5 lines > # of write term output, we can be reasonably sure that we have the > # config. > - if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS") && $linecnt > 5) { > + if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS" || $devtype eq "axos") && $linecnt > 5) { > $found_end = 1; > return(0); > } I did some more debugging tonight, and see the problem now. I'm kind of curious out the CE/SAN/NXOS types get around this...but the problem is, with no clear end of config marker to the show running-config, the WriteTerm function doesn't stop processing input until it's read all of it. In WriteTerm, when last if (/^$prompt/); matches, the line matched has the exit command on it. So when processing is handed back to inloop, there's nothing left for it to process other than the "Shared connection to ... closed." message from ssh. Would it be an appropriate workaround for this to also set $clean_run = 1 in the above if statement at the end of WriteTerm...or make a new if statment just for $devtype axos that sets both $found_end and $clean_run? ---------------------------------------------------------------------- Jon Lewis, MCP :) | I route Blue Stream Fiber, Sr. Neteng | therefore you are _________ http://www.lewis.org/~jlewis/pgp for PGP public key_________ From heas at shrubbery.net Mon Dec 11 14:50:03 2023 From: heas at shrubbery.net (heasley) Date: Mon, 11 Dec 2023 14:50:03 +0000 Subject: [rancid] adding a "new" type for axos In-Reply-To: <4b47166c-ea4e-cadb-2843-368c81c0b497@lewis.org> References: <3d930bb-05-a7e9-f921-a3385ef1d978@lewis.org> <4b47166c-ea4e-cadb-2843-368c81c0b497@lewis.org> Message-ID: Sun, Dec 10, 2023 at 11:18:53PM -0500, Jon Lewis: > On Sat, 9 Dec 2023, Jon Lewis wrote: > > > --- ios.pm.orig 2020-10-15 11:26:17.000000000 -0400 > > +++ ios.pm 2023-12-09 22:21:50.408683973 -0500 > > @@ -2787,7 +2794,7 @@ > > # The ContentEngine lacks a definitive "end of config" marker. If we > > # know that it is a CE, SAN, or NXOS and we have seen at least 5 lines > > # of write term output, we can be reasonably sure that we have the > > # config. > > - if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS") && $linecnt > 5) { > > + if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS" || $devtype eq "axos") && $linecnt > 5) { > > $found_end = 1; > > return(0); > > } > > I did some more debugging tonight, and see the problem now. I'm kind of > curious out the CE/SAN/NXOS types get around this...but the problem is, with > no clear end of config marker to the show running-config, the WriteTerm > function doesn't stop processing input until it's read all of it. In > WriteTerm, when > > last if (/^$prompt/); > > matches, the line matched has the exit command on it. So when processing is > handed back to inloop, there's nothing left for it to process other than the > "Shared connection to ... closed." message from ssh. right, so when it returns, the 'exit' line should be re-evaluated in the top loop and clean_run will be set. There is some nuance, but all the other filter functions operate in the same manner. 94 TOP: while(<$INPUT>) { ... 102 while (/[>#]\s*($cmds_regexp)\s*$/) { 121 $rval = &{$commands{$cmd}}($INPUT, $OUTPUT, $cmd); 122 delete($commands{$cmd}); ... 127 } 128 if (/[>#]\s?exit$/) { <<<<<<<<<<<<<<<< 129 $clean_run = 1; 130 last; 131 } 132 } 133 } Are you certain that the exit prompt is exactly: some-device#exit there are no spaces or other garbage on the line? > Would it be an appropriate workaround for this to also set $clean_run = 1 in > the above if statement at the end of WriteTerm...or make a new if statment > just for $devtype axos that sets both $found_end and $clean_run? it should not be necessary. From jlewis at lewis.org Mon Dec 11 18:52:41 2023 From: jlewis at lewis.org (Jon Lewis) Date: Mon, 11 Dec 2023 13:52:41 -0500 (EST) Subject: [rancid] adding a "new" type for axos In-Reply-To: References: <3d930bb-05-a7e9-f921-a3385ef1d978@lewis.org> <4b47166c-ea4e-cadb-2843-368c81c0b497@lewis.org> Message-ID: On Mon, 11 Dec 2023, heasley wrote: > right, so when it returns, the 'exit' line should be re-evaluated in the > top loop and clean_run will be set. There is some nuance, but all the > other filter functions operate in the same manner. > > 94 TOP: while(<$INPUT>) { > ... > 102 while (/[>#]\s*($cmds_regexp)\s*$/) { > 121 $rval = &{$commands{$cmd}}($INPUT, $OUTPUT, $cmd); > 122 delete($commands{$cmd}); > ... > 127 } > 128 if (/[>#]\s?exit$/) { <<<<<<<<<<<<<<<< > 129 $clean_run = 1; > 130 last; > 131 } > 132 } > 133 } That's interesting. The rancid 3.13 I have from the Ubuntu rancid 3.13-1 package has that line 128 if statement up above the while loop that starts at line 102. So, this was fixed a couple of years ago. https://github.com/haussli/rancid/commit/f9c6dc261803a1340286d57ef4b16ac8900f7053 Now that I look, I see the Ubuntu (Debian?) rancid 3.13 package is based on at least a 3 year old snapshot of rancid. Is there any point in using such a package? It seems like we'd be far better off just using the latest from github, doing a configure and make install? Backporting that change does resolve the WriteTerm function not setting $clean_run issue. I still need this little tweak or something similar to deal with the no obvious end of config issue. @@ -2787,7 +2804,7 @@ # The ContentEngine lacks a definitive "end of config" marker. If we # know that it is a CE, SAN, or NXOS and we have seen at least 5 lines # of write term output, we can be reasonably sure that we have the config. - if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS") && $linecnt > 5) { + if (($type eq "CE" || $type eq "SAN" || $type eq "NXOS" || $devtype eq "axos") && $linecnt > 5) { $found_end = 1; return(0); } One solution I'd tested was TOP: tr/\015//d; + if (/^$prompt\s?exit/ && $devtype eq "axos" && $linecnt > 5) { + $found_end = 1; + $clean_run = 1; + return(0); ---------------------------------------------------------------------- Jon Lewis, MCP :) | I route Blue Stream Fiber, Sr. Neteng | therefore you are _________ http://www.lewis.org/~jlewis/pgp for PGP public key_________ From me at falz.net Fri Dec 29 16:07:47 2023 From: me at falz.net (Chris Wopat) Date: Fri, 29 Dec 2023 10:07:47 -0600 Subject: [rancid] Script to check for `wr mem` on rancid config files Message-ID: Just a quick note that we were looking for a quick script of "did someone forget to wr mem" on IOS devices. My google-fu struck out. Sharing a new script to do this: https://github.com/falz/misc-network-scripts/blob/main/rancid-check-wr-mem.py It should be pretty flexible. Toss a github issue up if it doesn't work right. Cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: