From peacefull64 at hotmail.fr Sat Jan 23 22:20:13 2021 From: peacefull64 at hotmail.fr (Dede .) Date: Sat, 23 Jan 2021 22:20:13 +0000 Subject: [rancid] Adding JunOS Commands in configure mode Message-ID: Hi, I need to run "show | compare" in JunOS by entering in configure mode, so I would like to add this command to the list of commands that gets executed against Juniper devices. At first I tried to edit directly the files "junos.pm", "jrancid" and "rancid.types.base" but without success. After several searches on the internet and here I found some interesting information. https://shrubbery.net/pipermail/rancid-discuss/2015-October/008716.html https://shrubbery.net/pipermail/rancid-discuss/2016-September/009251.html https://shrubbery.net/pipermail/rancid-discuss/2009-October/004326.html So I don't override commands from the base types file and copy them from rancid.types.base to rancid.types.conf and rename them. Of course without forgetting to update the "router.db" file with the value jlocal and copy /usr/local/libexec/rancid/jrancid to /usr/local/libexec/rancid/jlocal (I use FreeBSD OS). Example conf: jlocal;script;rancid -t jlocal jlocal;login;jlogin jlocal;module;junos jlocal;inloop;junos::inloop jlocal;command;junos::ShowChassisClocks;show chassis clocks jlocal;command;junos::ShowChassisEnvironment;show chassis environment jlocal;command;junos::ShowChassisFirmware;show chassis firmware jlocal;command;junos::ShowChassisFpcDetail;show chassis fpc detail jlocal;command;junos::ShowChassisHardware;show chassis hardware detail jlocal;command;junos::ShowChassisHardware;show chassis hardware models jlocal;command;junos::ShowChassisRoutingEngine;show chassis routing-engine jlocal;command;junos::ShowChassisSCB;show chassis scb jlocal;command;junos::ShowChassisSCB;show chassis sfm detail jlocal;command;junos::ShowChassisSCB;show chassis ssb jlocal;command;junos::ShowChassisSCB;show chassis feb detail jlocal;command;junos::ShowChassisSCB;show chassis feb jlocal;command;junos::ShowChassisSCB;show chassis cfeb jlocal;command;junos::ShowChassisAlarms;show chassis alarms jlocal;command;junos::ShowSystemLicense;show system license jlocal;command;junos::ShowSystemBootMessages;show system boot-messages jlocal;command;junos::ShowSystemCoreDumps;show system core-dumps jlocal;command;junos::ShowVersion;show version detail jlocal;command;junos::ShowConfiguration;show configuration So far everything works fine, but if I add the additional lines for my commands in "rancid.types.conf" it doesn't work anymore. jlocal;command;junos::RunConfigure;configure jlocal;command;junos::ShowCompare;show | compare jlocal;command;junos::RunExit;exit I also tried to add the commands in the @commandtable array and also to modify the variable $prompt in order to take the '#' of the configure mode. $prompt = ($_ =~ /^([^>]+>)/)[0]; ===> $prompt = ($_ =~ /^([^>|^#]+[>|#])/)[0]; Can someone please explain to me how I can set this up? Thank you. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From emille at abccommunications.com Sun Jan 24 16:14:13 2021 From: emille at abccommunications.com (Emille Blanc) Date: Sun, 24 Jan 2021 16:14:13 +0000 Subject: [rancid] Adding JunOS Commands in configure mode In-Reply-To: References: Message-ID: Does it have to be done from configure mode? Would 'show configuration | compare rollback 0' >From normal mode suffice? Thinking for the sake of simplicity. But looks like you are on the right track to me Sent from my BlackBerry ? the most secure mobile device ? via the TELUS Network From: peacefull64 at hotmail.fr Sent: January 24, 2021 8:10 AM To: rancid-discuss at www.shrubbery.net Subject: [rancid] Adding JunOS Commands in configure mode Hi, I need to run "show | compare" in JunOS by entering in configure mode, so I would like to add this command to the list of commands that gets executed against Juniper devices. At first I tried to edit directly the files "junos.pm", "jrancid" and "rancid.types.base" but without success. After several searches on the internet and here I found some interesting information. https://shrubbery.net/pipermail/rancid-discuss/2015-October/008716.html https://shrubbery.net/pipermail/rancid-discuss/2016-September/009251.html https://shrubbery.net/pipermail/rancid-discuss/2009-October/004326.html So I don't override commands from the base types file and copy them from rancid.types.base to rancid.types.conf and rename them. Of course without forgetting to update the "router.db" file with the value jlocal and copy /usr/local/libexec/rancid/jrancid to /usr/local/libexec/rancid/jlocal (I use FreeBSD OS). Example conf: jlocal;script;rancid -t jlocal jlocal;login;jlogin jlocal;module;junos jlocal;inloop;junos::inloop jlocal;command;junos::ShowChassisClocks;show chassis clocks jlocal;command;junos::ShowChassisEnvironment;show chassis environment jlocal;command;junos::ShowChassisFirmware;show chassis firmware jlocal;command;junos::ShowChassisFpcDetail;show chassis fpc detail jlocal;command;junos::ShowChassisHardware;show chassis hardware detail jlocal;command;junos::ShowChassisHardware;show chassis hardware models jlocal;command;junos::ShowChassisRoutingEngine;show chassis routing-engine jlocal;command;junos::ShowChassisSCB;show chassis scb jlocal;command;junos::ShowChassisSCB;show chassis sfm detail jlocal;command;junos::ShowChassisSCB;show chassis ssb jlocal;command;junos::ShowChassisSCB;show chassis feb detail jlocal;command;junos::ShowChassisSCB;show chassis feb jlocal;command;junos::ShowChassisSCB;show chassis cfeb jlocal;command;junos::ShowChassisAlarms;show chassis alarms jlocal;command;junos::ShowSystemLicense;show system license jlocal;command;junos::ShowSystemBootMessages;show system boot-messages jlocal;command;junos::ShowSystemCoreDumps;show system core-dumps jlocal;command;junos::ShowVersion;show version detail jlocal;command;junos::ShowConfiguration;show configuration So far everything works fine, but if I add the additional lines for my commands in "rancid.types.conf" it doesn't work anymore. jlocal;command;junos::RunConfigure;configure jlocal;command;junos::ShowCompare;show | compare jlocal;command;junos::RunExit;exit I also tried to add the commands in the @commandtable array and also to modify the variable $prompt in order to take the '#' of the configure mode. $prompt = ($_ =~ /^([^>]+>)/)[0]; ===> $prompt = ($_ =~ /^([^>|^#]+[>|#])/)[0]; Can someone please explain to me how I can set this up? Thank you. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peacefull64 at hotmail.fr Sun Jan 24 19:26:47 2021 From: peacefull64 at hotmail.fr (Dede .) Date: Sun, 24 Jan 2021 20:26:47 +0100 Subject: [rancid] =?iso-8859-1?q?Re=A0=3A__Adding_JunOS_Commands_in_confi?= =?iso-8859-1?q?gure_mode?= References: Message-ID: An HTML attachment was scrubbed... URL: From peacefull64 at hotmail.fr Sun Jan 24 19:29:22 2021 From: peacefull64 at hotmail.fr (Dede .) Date: Sun, 24 Jan 2021 20:29:22 +0100 Subject: [rancid] =?iso-8859-1?q?Re=A0=3A__Adding_JunOS_Commands_in_confi?= =?iso-8859-1?q?gure_mode?= References: Message-ID: An HTML attachment was scrubbed... URL: From emille at abccommunications.com Mon Jan 25 02:48:27 2021 From: emille at abccommunications.com (Emille Blanc) Date: Mon, 25 Jan 2021 02:48:27 +0000 Subject: [rancid] =?windows-1252?q?Re=A0=3A__Adding_JunOS_Commands_in_con?= =?windows-1252?q?figure_mode?= In-Reply-To: References: , Message-ID: Aha, I better understand your use case now. I didn't realize you were looking for uncommitted changes. Sent from my BlackBerry ? the most secure mobile device ? via the TELUS Network From: peacefull64 at hotmail.fr Sent: January 24, 2021 11:26 AM To: emille at abccommunications.com; rancid-discuss at www.shrubbery.net Subject: Re : [rancid] Adding JunOS Commands in configure mode Yes, it's must be done from configure mode because is not the same information. For example, in operational mode, you can compare the active configuration to a previously committed configuration by using the following commands: > show configuration | compare revision revision-id > show configuration | compare rollback rollback-number Similarly in configuration mode, you can compare the candidate configuration to a previously committed configuration by using the following commands: > show | compare revision revision-id > show | compare rollback rollback-number https://www.juniper.net/documentation/en_US/junos/topics/task/operational/junos-xml-protocol-requesting-configuration-comparison.html Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peacefull64 at hotmail.fr Mon Jan 25 08:02:56 2021 From: peacefull64 at hotmail.fr (Dede .) Date: Mon, 25 Jan 2021 08:02:56 +0000 Subject: [rancid] =?windows-1252?q?Re=A0=3A__Adding_JunOS_Commands_in_con?= =?windows-1252?q?figure_mode?= In-Reply-To: References: , , Message-ID: Yes exactly, because there was a case of an electrical crash and it committed the standby conf that someone hadn't finished and it was a bad conf The idea is to track the possible conf in standby so that in case of a crash we are a little more certain. For this I need to enter configure mode to execute the command: "show | compare" ________________________________ De : Emille Blanc Envoy? : lundi 25 janvier 2021 02:48 ? : Dede . ; rancid-discuss at www.shrubbery.net Objet : Re: Re : [rancid] Adding JunOS Commands in configure mode Aha, I better understand your use case now. I didn't realize you were looking for uncommitted changes. Sent from my BlackBerry ? the most secure mobile device ? via the TELUS Network From: peacefull64 at hotmail.fr Sent: January 24, 2021 11:26 AM To: emille at abccommunications.com; rancid-discuss at www.shrubbery.net Subject: Re : [rancid] Adding JunOS Commands in configure mode Yes, it's must be done from configure mode because is not the same information. For example, in operational mode, you can compare the active configuration to a previously committed configuration by using the following commands: > show configuration | compare revision revision-id > show configuration | compare rollback rollback-number Similarly in configuration mode, you can compare the candidate configuration to a previously committed configuration by using the following commands: > show | compare revision revision-id > show | compare rollback rollback-number https://www.juniper.net/documentation/en_US/junos/topics/task/operational/junos-xml-protocol-requesting-configuration-comparison.html Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggiesen at giesen.me Fri Jan 29 22:34:33 2021 From: ggiesen at giesen.me (Gary T. Giesen) Date: Fri, 29 Jan 2021 17:34:33 -0500 Subject: [rancid] proxy-login rancid collection In-Reply-To: References: <20150325161446.GF45425@shrubbery.net> <6b2d-5eb9aa00-3-7202978@143392629> <20200513192150.GJ66669@shrubbery.net> Message-ID: <569397e4-ac69-d5ee-3c61-8136e5e9e33b@giesen.me> I'm circling back to this as I thought I had another option that didn't pan out ($$$). Have you had any opportunity to make progress on this? I also run multi-context ASAs as well as Firepower devices so being able to execute arbitrary commands would be better. That being said, for 95% of what I'm going to use this for, only being able to execute clogin scripts would be fine. We currently run the usercmd patch but hoping for something a little cleaner (and the curly braces are giving me heartburn, thanks to trying to generate the configs using jinja) Cheers, GTG On 2020-06-24 7:55 p.m., Lance Vermilion wrote: > Another use case is when trying to get a text based backup on newer > devices managed by the FMC. You ssh to the FireOS Linux portion and > then go into a support she'll to get access to the ASA CLI where you > can get access to the config. This config provides a quick small file > so you can do searches in configs. > > There are also cases in certain environments where a customer might > only allow you direct access to certain devices and then expects you > to jump through to other devices. > > On Wed, May 13, 2020, 12:21 PM heasley > wrote: > > Mon, May 11, 2020 at 03:39:19PM -0400, Gary T. Giesen: > > > > Did this ever get implemented? I have looked through a bunch of > release notes and mail list archives but I could not find any > further mention of it. > > I have nothing usable yet.? I will work on that next.? There are > two hack > that were contributed on the ML that might suit you for the immediate. > > > Thanks, > > > > GTG > > > > On Wednesday, March 25, 2015 12:14 EDT, heasley > > wrote: > > ?Many have asked for this and it will probably be the primary > addition to > > rancid 3.3, but I do not have a use for it, so although I've > digested most > > of the maillist discussion on the topic ('out of band access > script change', > > 'download configs from on router through another', etc), I'm not > sure that > > I'd include all the relevant features, therefore i want to > solicit input. > > > > I am tempted to limit the utility to executing other login > scripts, ie: > > the assumption that it through a device supported by one of > rancid's login > > scripts, rather than an arbitrary unix command. > > > > Please feel free to reply to me directly or to the list. > > _______________________________________________ > > Rancid-discuss mailing list > > Rancid-discuss at shrubbery.net > > http://www.shrubbery.net/mailman/listinfo/rancid-discuss > > > > > > > > > _______________________________________________ > 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: