Discussion:
[rancid] Adding JunOS Commands
Baird, Josh
2015-10-05 15:00:13 UTC
Permalink
Hi,

I use configuration groups in JunOS, so I would like to add 'show configuration | display inheritance no comments' to the list of commands that gets executed against Juniper devices. Can someone point me in the right direction?

Thanks,

Josh
heasley
2015-10-05 15:22:45 UTC
Permalink
Mon, Oct 05, 2015 at 03:00:13PM +0000, Baird, Josh:
> Hi,
>
> I use configuration groups in JunOS, so I would like to add 'show configuration | display inheritance no comments' to the list of commands that gets executed against Juniper devices. Can someone point me in the right direction?

use rancid 3.2, see rancid.type.conf(5).
Baird, Josh
2015-10-05 15:32:10 UTC
Permalink
Thanks, I copied the following block from /etc/rancid/rancid.types.base to /etc/rancid/rancid.types.conf:

juniper;script;rancid -t juniper
juniper;login;jlogin
juniper;module;junos
juniper;inloop;junos::inloop
juniper;command;junos::ShowChassisClocks;show chassis clocks
juniper;command;junos::ShowChassisEnvironment;show chassis environment
juniper;command;junos::ShowChassisFirmware;show chassis firmware
juniper;command;junos::ShowChassisFpcDetail;show chassis fpc detail
juniper;command;junos::ShowChassisHardware;show chassis hardware detail
juniper;command;junos::ShowChassisHardware;show chassis hardware models
juniper;command;junos::ShowChassisRoutingEngine;show chassis routing-engine
juniper;command;junos::ShowChassisSCB;show chassis scb
juniper;command;junos::ShowChassisSCB;show chassis sfm detail
juniper;command;junos::ShowChassisSCB;show chassis ssb
juniper;command;junos::ShowChassisSCB;show chassis feb detail
juniper;command;junos::ShowChassisSCB;show chassis feb
juniper;command;junos::ShowChassisSCB;show chassis cfeb
juniper;command;junos::ShowChassisAlarms;show chassis alarms
juniper;command;junos::ShowSystemLicense;show system license
juniper;command;junos::ShowSystemBootMessages;show system boot-messages
juniper;command;junos::ShowSystemCoreDumps;show system core-dumps
juniper;command;junos::ShowVersion;show version detail
juniper;command;junos::ShowConfiguration;show configuration

Then, I added the following line to the bottom of /etc/rancid/rancid.types.conf:

juniper;command;junos::ShowConfigurationOmit;show configuration | display omit

Does this look correct? The new command is not being ran.

Thanks,

Josh

> -----Original Message-----
> From: heasley [mailto:***@shrubbery.net]
> Sent: Monday, October 05, 2015 11:23 AM
> To: Baird, Josh
> Cc: rancid-***@shrubbery.net
> Subject: Re: [rancid] Adding JunOS Commands
>
> Mon, Oct 05, 2015 at 03:00:13PM +0000, Baird, Josh:
> > Hi,
> >
> > I use configuration groups in JunOS, so I would like to add 'show
> configuration | display inheritance no comments' to the list of commands
> that gets executed against Juniper devices. Can someone point me in the
> right direction?
>
> use rancid 3.2, see rancid.type.conf(5).
heasley
2015-10-05 15:39:14 UTC
Permalink
Mon, Oct 05, 2015 at 03:32:10PM +0000, Baird, Josh:
> Thanks, I copied the following block from /etc/rancid/rancid.types.base to /etc/rancid/rancid.types.conf:
>
> juniper;script;rancid -t juniper
> juniper;login;jlogin
> juniper;module;junos
> juniper;inloop;junos::inloop
> juniper;command;junos::ShowChassisClocks;show chassis clocks
> juniper;command;junos::ShowChassisEnvironment;show chassis environment
> juniper;command;junos::ShowChassisFirmware;show chassis firmware
> juniper;command;junos::ShowChassisFpcDetail;show chassis fpc detail
> juniper;command;junos::ShowChassisHardware;show chassis hardware detail
> juniper;command;junos::ShowChassisHardware;show chassis hardware models
> juniper;command;junos::ShowChassisRoutingEngine;show chassis routing-engine
> juniper;command;junos::ShowChassisSCB;show chassis scb
> juniper;command;junos::ShowChassisSCB;show chassis sfm detail
> juniper;command;junos::ShowChassisSCB;show chassis ssb
> juniper;command;junos::ShowChassisSCB;show chassis feb detail
> juniper;command;junos::ShowChassisSCB;show chassis feb
> juniper;command;junos::ShowChassisSCB;show chassis cfeb
> juniper;command;junos::ShowChassisAlarms;show chassis alarms
> juniper;command;junos::ShowSystemLicense;show system license
> juniper;command;junos::ShowSystemBootMessages;show system boot-messages
> juniper;command;junos::ShowSystemCoreDumps;show system core-dumps
> juniper;command;junos::ShowVersion;show version detail
> juniper;command;junos::ShowConfiguration;show configuration
>
> Then, I added the following line to the bottom of /etc/rancid/rancid.types.conf:
>
> juniper;command;junos::ShowConfigurationOmit;show configuration | display omit
>
> Does this look correct? The new command is not being ran.

you must name it something else; the definition in rancid.types.base will
override it - this is intentional; its a clear signal to us that you have
altered things.

and, you must definte ShowConfigurationOmit the function somewhere and
import it. eg

myjuniper;module;junos
myjuniper;module;myjunos
...
myjuniper;command;myjunos::ShowConfigurationOmit;show configuration | display omit
Baird, Josh
2015-11-07 19:16:01 UTC
Permalink
Ok - I think I am misunderstanding.

My rancid.types.conf:

juniper2;script;rancid -t juniper
juniper2;login;jlogin
juniper2;module;junos2
juniper2;inloop;junos2::inloop
juniper2;command;junos2::ShowChassisClocks;show chassis clocks
juniper2;command;junos2::ShowChassisEnvironment;show chassis environment
juniper2;command;junos2::ShowChassisFirmware;show chassis firmware
juniper2;command;junos2::ShowChassisFpcDetail;show chassis fpc detail
juniper2;command;junos2::ShowChassisHardware;show chassis hardware detail
juniper2;command;junos2::ShowChassisHardware;show chassis hardware models
juniper2;command;junos2::ShowChassisRoutingEngine;show chassis routing-engine
juniper2;command;junos2::ShowChassisSCB;show chassis scb
juniper2;command;junos2::ShowChassisSCB;show chassis sfm detail
juniper2;command;junos2::ShowChassisSCB;show chassis ssb
juniper2;command;junos2::ShowChassisSCB;show chassis feb detail
juniper2;command;junos2::ShowChassisSCB;show chassis feb
juniper2;command;junos2::ShowChassisSCB;show chassis cfeb
juniper2;command;junos2::ShowChassisAlarms;show chassis alarms
juniper2;command;junos2::ShowSystemLicense;show system license
juniper2;command;junos2::ShowSystemBootMessages;show system boot-messages
juniper2;command;junos2::ShowSystemCoreDumps;show system core-dumps
juniper2;command;junos2::ShowVersion;show version detail
juniper2;command;junos2::ShowConfiguration;show configuration
juniper2;command;junos2::ShowConfigurationOmit;show configuration | display omit

My router.db:

hostname;juniper2;up

What am I missing here? I appreciate you trying to help.

Thanks

> -----Original Message-----
> From: Baird, Josh
> Sent: Monday, October 05, 2015 11:32 AM
> To: 'heasley'
> Cc: rancid-***@shrubbery.net
> Subject: RE: [rancid] Adding JunOS Commands
>
> Thanks, I copied the following block from /etc/rancid/rancid.types.base to
> /etc/rancid/rancid.types.conf:
>
> juniper;script;rancid -t juniper
> juniper;login;jlogin
> juniper;module;junos
> juniper;inloop;junos::inloop
> juniper;command;junos::ShowChassisClocks;show chassis clocks
> juniper;command;junos::ShowChassisEnvironment;show chassis
> environment juniper;command;junos::ShowChassisFirmware;show chassis
> firmware juniper;command;junos::ShowChassisFpcDetail;show chassis fpc
> detail juniper;command;junos::ShowChassisHardware;show chassis
> hardware detail juniper;command;junos::ShowChassisHardware;show
> chassis hardware models
> juniper;command;junos::ShowChassisRoutingEngine;show chassis routing-
> engine juniper;command;junos::ShowChassisSCB;show chassis scb
> juniper;command;junos::ShowChassisSCB;show chassis sfm detail
> juniper;command;junos::ShowChassisSCB;show chassis ssb
> juniper;command;junos::ShowChassisSCB;show chassis feb detail
> juniper;command;junos::ShowChassisSCB;show chassis feb
> juniper;command;junos::ShowChassisSCB;show chassis cfeb
> juniper;command;junos::ShowChassisAlarms;show chassis alarms
> juniper;command;junos::ShowSystemLicense;show system license
> juniper;command;junos::ShowSystemBootMessages;show system boot-
> messages juniper;command;junos::ShowSystemCoreDumps;show system
> core-dumps juniper;command;junos::ShowVersion;show version detail
> juniper;command;junos::ShowConfiguration;show configuration
>
> Then, I added the following line to the bottom of
> /etc/rancid/rancid.types.conf:
>
> juniper;command;junos::ShowConfigurationOmit;show configuration |
> display omit
>
> Does this look correct? The new command is not being ran.
>
> Thanks,
>
> Josh
>
> > -----Original Message-----
> > From: heasley [mailto:***@shrubbery.net]
> > Sent: Monday, October 05, 2015 11:23 AM
> > To: Baird, Josh
> > Cc: rancid-***@shrubbery.net
> > Subject: Re: [rancid] Adding JunOS Commands
> >
> > Mon, Oct 05, 2015 at 03:00:13PM +0000, Baird, Josh:
> > > Hi,
> > >
> > > I use configuration groups in JunOS, so I would like to add 'show
> > configuration | display inheritance no comments' to the list of
> > commands that gets executed against Juniper devices. Can someone
> > point me in the right direction?
> >
> > use rancid 3.2, see rancid.type.conf(5).
Heasley
2015-11-07 22:54:56 UTC
Permalink
> Am 07.11.2015 um 11:16 schrieb Baird, Josh <***@follett.com>:
>
> Ok - I think I am misunderstanding.
>
> My rancid.types.conf:
>
> juniper2;script;rancid -t juniper

juniper2;script;rancid -t juniper2

> juniper2;login;jlogin
> juniper2;module;junos2

Not junos2, unless youve written your own pm. You can also import junos and your own pm so as not to duplicate functions

Otherwise, you havent said what is not working.

> juniper2;inloop;junos2::inloop
> juniper2;command;junos2::ShowChassisClocks;show chassis clocks
> juniper2;command;junos2::ShowChassisEnvironment;show chassis environment
> juniper2;command;junos2::ShowChassisFirmware;show chassis firmware
> juniper2;command;junos2::ShowChassisFpcDetail;show chassis fpc detail
> juniper2;command;junos2::ShowChassisHardware;show chassis hardware detail
> juniper2;command;junos2::ShowChassisHardware;show chassis hardware models
> juniper2;command;junos2::ShowChassisRoutingEngine;show chassis routing-engine
> juniper2;command;junos2::ShowChassisSCB;show chassis scb
> juniper2;command;junos2::ShowChassisSCB;show chassis sfm detail
> juniper2;command;junos2::ShowChassisSCB;show chassis ssb
> juniper2;command;junos2::ShowChassisSCB;show chassis feb detail
> juniper2;command;junos2::ShowChassisSCB;show chassis feb
> juniper2;command;junos2::ShowChassisSCB;show chassis cfeb
> juniper2;command;junos2::ShowChassisAlarms;show chassis alarms
> juniper2;command;junos2::ShowSystemLicense;show system license
> juniper2;command;junos2::ShowSystemBootMessages;show system boot-messages
> juniper2;command;junos2::ShowSystemCoreDumps;show system core-dumps
> juniper2;command;junos2::ShowVersion;show version detail
> juniper2;command;junos2::ShowConfiguration;show configuration
> juniper2;command;junos2::ShowConfigurationOmit;show configuration | display omit
>
> My router.db:
>
> hostname;juniper2;up
>
> What am I missing here? I appreciate you trying to help.
>
> Thanks
>
>> -----Original Message-----
>> From: Baird, Josh
>> Sent: Monday, October 05, 2015 11:32 AM
>> To: 'heasley'
>> Cc: rancid-***@shrubbery.net
>> Subject: RE: [rancid] Adding JunOS Commands
>>
>> Thanks, I copied the following block from /etc/rancid/rancid.types.base to
>> /etc/rancid/rancid.types.conf:
>>
>> juniper;script;rancid -t juniper
>> juniper;login;jlogin
>> juniper;module;junos
>> juniper;inloop;junos::inloop
>> juniper;command;junos::ShowChassisClocks;show chassis clocks
>> juniper;command;junos::ShowChassisEnvironment;show chassis
>> environment juniper;command;junos::ShowChassisFirmware;show chassis
>> firmware juniper;command;junos::ShowChassisFpcDetail;show chassis fpc
>> detail juniper;command;junos::ShowChassisHardware;show chassis
>> hardware detail juniper;command;junos::ShowChassisHardware;show
>> chassis hardware models
>> juniper;command;junos::ShowChassisRoutingEngine;show chassis routing-
>> engine juniper;command;junos::ShowChassisSCB;show chassis scb
>> juniper;command;junos::ShowChassisSCB;show chassis sfm detail
>> juniper;command;junos::ShowChassisSCB;show chassis ssb
>> juniper;command;junos::ShowChassisSCB;show chassis feb detail
>> juniper;command;junos::ShowChassisSCB;show chassis feb
>> juniper;command;junos::ShowChassisSCB;show chassis cfeb
>> juniper;command;junos::ShowChassisAlarms;show chassis alarms
>> juniper;command;junos::ShowSystemLicense;show system license
>> juniper;command;junos::ShowSystemBootMessages;show system boot-
>> messages juniper;command;junos::ShowSystemCoreDumps;show system
>> core-dumps juniper;command;junos::ShowVersion;show version detail
>> juniper;command;junos::ShowConfiguration;show configuration
>>
>> Then, I added the following line to the bottom of
>> /etc/rancid/rancid.types.conf:
>>
>> juniper;command;junos::ShowConfigurationOmit;show configuration |
>> display omit
>>
>> Does this look correct? The new command is not being ran.
>>
>> Thanks,
>>
>> Josh
>>
>>> -----Original Message-----
>>> From: heasley [mailto:***@shrubbery.net]
>>> Sent: Monday, October 05, 2015 11:23 AM
>>> To: Baird, Josh
>>> Cc: rancid-***@shrubbery.net
>>> Subject: Re: [rancid] Adding JunOS Commands
>>>
>>> Mon, Oct 05, 2015 at 03:00:13PM +0000, Baird, Josh:
>>>> Hi,
>>>>
>>>> I use configuration groups in JunOS, so I would like to add 'show
>>> configuration | display inheritance no comments' to the list of
>>> commands that gets executed against Juniper devices. Can someone
>>> point me in the right direction?
>>>
>>> use rancid 3.2, see rancid.type.conf(5).
Baird, Josh
2015-11-08 19:19:25 UTC
Permalink
Ok - getting much further now. But, it seems that my new command is failing to run. I tried adding other commands as well:

switch.something.com: missed cmd(s): show configuration | display omit

I'm able to use jlogin to login to the device and manually execute the command(s) with no problem.

Thanks,

Josh
________________________________________
From: Heasley [***@shrubbery.net]
Sent: Saturday, November 07, 2015 4:54 PM
To: Baird, Josh
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] Adding JunOS Commands

> Am 07.11.2015 um 11:16 schrieb Baird, Josh <***@follett.com>:
>
> Ok - I think I am misunderstanding.
>
> My rancid.types.conf:
>
> juniper2;script;rancid -t juniper

juniper2;script;rancid -t juniper2

> juniper2;login;jlogin
> juniper2;module;junos2

Not junos2, unless youve written your own pm. You can also import junos and your own pm so as not to duplicate functions

Otherwise, you havent said what is not working.

> juniper2;inloop;junos2::inloop
> juniper2;command;junos2::ShowChassisClocks;show chassis clocks
> juniper2;command;junos2::ShowChassisEnvironment;show chassis environment
> juniper2;command;junos2::ShowChassisFirmware;show chassis firmware
> juniper2;command;junos2::ShowChassisFpcDetail;show chassis fpc detail
> juniper2;command;junos2::ShowChassisHardware;show chassis hardware detail
> juniper2;command;junos2::ShowChassisHardware;show chassis hardware models
> juniper2;command;junos2::ShowChassisRoutingEngine;show chassis routing-engine
> juniper2;command;junos2::ShowChassisSCB;show chassis scb
> juniper2;command;junos2::ShowChassisSCB;show chassis sfm detail
> juniper2;command;junos2::ShowChassisSCB;show chassis ssb
> juniper2;command;junos2::ShowChassisSCB;show chassis feb detail
> juniper2;command;junos2::ShowChassisSCB;show chassis feb
> juniper2;command;junos2::ShowChassisSCB;show chassis cfeb
> juniper2;command;junos2::ShowChassisAlarms;show chassis alarms
> juniper2;command;junos2::ShowSystemLicense;show system license
> juniper2;command;junos2::ShowSystemBootMessages;show system boot-messages
> juniper2;command;junos2::ShowSystemCoreDumps;show system core-dumps
> juniper2;command;junos2::ShowVersion;show version detail
> juniper2;command;junos2::ShowConfiguration;show configuration
> juniper2;command;junos2::ShowConfigurationOmit;show configuration | display omit
>
> My router.db:
>
> hostname;juniper2;up
>
> What am I missing here? I appreciate you trying to help.
>
> Thanks
>
>> -----Original Message-----
>> From: Baird, Josh
>> Sent: Monday, October 05, 2015 11:32 AM
>> To: 'heasley'
>> Cc: rancid-***@shrubbery.net
>> Subject: RE: [rancid] Adding JunOS Commands
>>
>> Thanks, I copied the following block from /etc/rancid/rancid.types.base to
>> /etc/rancid/rancid.types.conf:
>>
>> juniper;script;rancid -t juniper
>> juniper;login;jlogin
>> juniper;module;junos
>> juniper;inloop;junos::inloop
>> juniper;command;junos::ShowChassisClocks;show chassis clocks
>> juniper;command;junos::ShowChassisEnvironment;show chassis
>> environment juniper;command;junos::ShowChassisFirmware;show chassis
>> firmware juniper;command;junos::ShowChassisFpcDetail;show chassis fpc
>> detail juniper;command;junos::ShowChassisHardware;show chassis
>> hardware detail juniper;command;junos::ShowChassisHardware;show
>> chassis hardware models
>> juniper;command;junos::ShowChassisRoutingEngine;show chassis routing-
>> engine juniper;command;junos::ShowChassisSCB;show chassis scb
>> juniper;command;junos::ShowChassisSCB;show chassis sfm detail
>> juniper;command;junos::ShowChassisSCB;show chassis ssb
>> juniper;command;junos::ShowChassisSCB;show chassis feb detail
>> juniper;command;junos::ShowChassisSCB;show chassis feb
>> juniper;command;junos::ShowChassisSCB;show chassis cfeb
>> juniper;command;junos::ShowChassisAlarms;show chassis alarms
>> juniper;command;junos::ShowSystemLicense;show system license
>> juniper;command;junos::ShowSystemBootMessages;show system boot-
>> messages juniper;command;junos::ShowSystemCoreDumps;show system
>> core-dumps juniper;command;junos::ShowVersion;show version detail
>> juniper;command;junos::ShowConfiguration;show configuration
>>
>> Then, I added the following line to the bottom of
>> /etc/rancid/rancid.types.conf:
>>
>> juniper;command;junos::ShowConfigurationOmit;show configuration |
>> display omit
>>
>> Does this look correct? The new command is not being ran.
>>
>> Thanks,
>>
>> Josh
>>
>>> -----Original Message-----
>>> From: heasley [mailto:***@shrubbery.net]
>>> Sent: Monday, October 05, 2015 11:23 AM
>>> To: Baird, Josh
>>> Cc: rancid-***@shrubbery.net
>>> Subject: Re: [rancid] Adding JunOS Commands
>>>
>>> Mon, Oct 05, 2015 at 03:00:13PM +0000, Baird, Josh:
>>>> Hi,
>>>>
>>>> I use configuration groups in JunOS, so I would like to add 'show
>>> configuration | display inheritance no comments' to the list of
>>> commands that gets executed against Juniper devices. Can someone
>>> point me in the right direction?
>>>
>>> use rancid 3.2, see rancid.type.conf(5).
Heasley
2015-11-09 17:07:34 UTC
Permalink
Sun, Nov 08, 2015 at 07:19:25PM +0000, Baird, Josh:
> Ok - getting much further now. But, it seems that my new command is failing to run. I tried adding other commands as well:
>
> switch.something.com: missed cmd(s): show configuration | display omit
>
> I'm able to use jlogin to login to the device and manually execute the command(s) with no problem.

export NOPIPE=YES
rancid -t type -d host

will leave a host.raw file to help debug, such as seeing why the cmd is not
working.
Loading...