[rancid] Rancid-Run works great but cron doesn't.

Lee ler762 at gmail.com
Tue Nov 18 04:49:10 UTC 2014


> When cron runs it fails to connect to any router.

Probably because cron doesn't set up the full environment; I made a
wrapper that I start via cron:
$ cat rancidRun.sh
#!/bin/sh
#  call  rancid with all my doodads
#
# just in case I run it interactively
# clear all the debug envars
unset DEBUG
unset SHOWWARN
unset NOPIPE

if [ -z "$ALLDEV" ]; then
   # my .bashrc hasn't been called yet
   source ${HOME}/.bashrc
fi

rancid-run  $*

Regards,
Lee


On 11/17/14, Wesley Brown <wbrown at inline.com> wrote:
> Oh great rancid discussion list hear my plea,
>
> I have been beating my head against this problem for the last full day. If I
> go run /usr/local/rancid/bin/rancid-run, everything runs smooth. My rancid
> logs state all routers reached. However When cron runs it fails to connect
> to any router. All routers in this Rancid server are Juniper. Here are some
> of the log entries from a cron run.
>
> Trying to get all of the configs.
> Removed Switch Name: missed cmd(s): show chassis hardware detail
> Removed Switch Name: missed cmd(s): show chassis feb detail,show chassis
> firmware,show system boot-messages,show chassis fpc detail,show chassis
> hardware detail,show chassis routing-engine,show chassis environment,show
> system core-dumps$
> Removed Switch Name: missed cmd(s): show system boot-messages,show chassis
> hardware detail,show chassis routing-engine
> Removed Switch Name: missed cmd(s): show chassis sfm detail,show chassis feb
> detail,show chassis hardware detail,show system boot-messages,show chassis
> environment,show chassis fpc detail,show chassis routing-engine
> Removed Switch Name: missed cmd(s): show chassis ssb,show chassis sfm
> detail,show chassis feb,show chassis scb,show system license,show chassis
> fpc detail,show chassis alarms,show version detail,show chassis
> firmware,show chassis $
> Removed Switch Name: End of run not found
> #
> Removed Switch Name: missed cmd(s): show chassis environment,show chassis
> routing-engine,show chassis hardware detail,show chassis fpc detail,show
> system boot-messages,show chassis feb detail,show chassis sfm detail,show
> system core-dump$
> Removed Switch Name: missed cmd(s): show chassis firmware,show chassis
> environment,show chassis routing-engine,show chassis fpc detail,show chassis
> hardware detail,show chassis feb detail,show chassis sfm detail,show system
> core-dumps,sh$
> Removed Switch Name: missed cmd(s): show chassis hardware detail
> Removed Switch Name: missed cmd(s): show chassis routing-engine,show chassis
> hardware detail
> Removed Switch Name: missed cmd(s): show chassis routing-engine,show chassis
> hardware detail,show system boot-messages
> Removed Switch Name: missed cmd(s): show chassis routing-engine,show chassis
> hardware detail,show system boot-messages
> Removed Switch Name: missed cmd(s): show chassis hardware detail
> Removed Switch Name: missed cmd(s): show chassis clocks,show chassis sfm
> detail,show system core-dumps,show chassis feb detail,show chassis ssb,show
> chassis fpc detail,show system license,show chassis routing-engine,show
> chassis fe$
> Removed Switch Name: End of run not found
> #
>
>
> If I run:
> ./jlogin -t 120 -c"show chassis clocks;show chassis environment;show chassis
> firmware;show chassis fpc detail;show chassis hardware detail;show chassis
> routing-engine;show chassis scb;show chassis sfm detail;show chassis
> ssb;show chassis feb detail;show chassis feb;show chassis cfeb;show chassis
> alarms;show system license;show system boot-messages;show system
> core-dumps;show version detail;show configuration" Removed Switch Name
>
> Everything works great.
>
>
> If I run:
>  ./jrancid -d Removed Switch Name
>
> I get:
> executing echo jlogin -t 120 -c"show chassis clocks;show chassis
> environment;show chassis firmware;show chassis fpc detail;show chassis
> hardware detail;show chassis routing-engine;show chassis scb;show chassis
> sfm detail;show chassis ssb;show chassis feb detail;show chassis feb;show
> chassis cfeb;show chassis alarms;show system license;show system
> boot-messages;show system core-dumps;show version detail;show configuration"
> Removed Switch Name
> executing echo jlogin -t 120 -c"show chassis clocks;show chassis
> environment;show chassis firmware;show chassis fpc detail;show chassis
> hardware detail;show chassis routing-engine;show chassis scb;show chassis
> sfm detail;show chassis ssb;show chassis feb detail;show chassis feb;show
> chassis cfeb;show chassis alarms;show system license;show system
> boot-messages;show system core-dumps;show version detail;show configuration"
> Removed Switch Name
> sh: 1: jlogin: not found
> Removed Switch Name: missed cmd(s): show configuration,show chassis
> firmware,show chassis alarms,show chassis environment,show chassis feb,show
> chassis fpc detail,show chassis scb,show chassis routing-engine,show chassis
> sfm detail,show chassis cfeb,show chassis ssb,show version detail,show
> chassis hardware detail,show system core-dumps,show chassis clocks,show
> system boot-messages,show chassis feb detail,show system license
> Removed Switch Name: missed cmd(s): show configuration,show chassis
> firmware,show chassis alarms,show chassis environment,show chassis feb,show
> chassis fpc detail,show chassis scb,show chassis routing-engine,show chassis
> sfm detail,show chassis cfeb,show chassis ssb,show version detail,show
> chassis hardware detail,show system core-dumps,show chassis clocks,show
> system boot-messages,show chassis feb detail,show system license
> Removed Switch Name: End of run not found
> Removed Switch Name: End of run not found
> #
>
>
> Running: env NOPIPE=YES PATH=${PATH}:/usr/local/rancid/bin/ jrancid -d
> Removed Switch Name
>
> Gives me:
> executing echo jlogin -t 120 -c"show chassis clocks;show chassis
> environment;show chassis firmware;show chassis fpc detail;show chassis
> hardware detail;show chassis routing-engine;show chassis scb;show chassis
> sfm detail;show chassis ssb;show chassis feb detail;show chassis feb;show
> chassis cfeb;show chassis alarms;show system license;show system
> boot-messages;show system core-dumps;show version detail;show configuration"
> Removed Switch Name
> executing echo jlogin -t 120 -c"show chassis clocks;show chassis
> environment;show chassis firmware;show chassis fpc detail;show chassis
> hardware detail;show chassis routing-engine;show chassis scb;show chassis
> sfm detail;show chassis ssb;show chassis feb detail;show chassis feb;show
> chassis cfeb;show chassis alarms;show system license;show system
> boot-messages;show system core-dumps;show version detail;show configuration"
> Removed Switch Name
> PROMPT MATCH: inline at Removed Switch Name>
> HIT COMMAND:inline at Removed Switch Name> show chassis clocks
>     In ShowChassisClocks: inline at Removed Switch Name> show chassis clocks
> HIT COMMAND:inline at Removed Switch Name> show chassis environment
>     In ShowChassisEnvironment: inline at Removed Switch Name> show chassis
> environment
> HIT COMMAND:inline at Removed Switch Name> show chassis firmware
>     In ShowChassisFirmware: inline at Removed Switch Name> show chassis
> firmware
> HIT COMMAND:inline at Removed Switch Name> show chassis fpc detail
>     In ShowChassisFpcDetail: inline at Removed Switch Name> show chassis fpc
> detail
> HIT COMMAND:inline at Removed Switch Name> show chassis hardware detail
>     In ShowChassisHardware: inline at Removed Switch Name> show chassis
> hardware detail
> HIT COMMAND:inline at Removed Switch Name> show chassis routing-engine
>     In ShowChassisRoutingEngine: inline at Removed Switch Name> show chassis
> routing-engine
> HIT COMMAND:inline at Removed Switch Name> show chassis scb
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis scb
> HIT COMMAND:inline at Removed Switch Name> show chassis sfm detail
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis sfm detail
> HIT COMMAND:inline at Removed Switch Name> show chassis ssb
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis ssb
> HIT COMMAND:inline at Removed Switch Name> show chassis feb detail
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis feb detail
> HIT COMMAND:inline at Removed Switch Name> show chassis feb
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis feb
> HIT COMMAND:inline at Removed Switch Name> show chassis cfeb
>     In ShowChassisSCB: inline at Removed Switch Name> show chassis cfeb
> HIT COMMAND:inline at Removed Switch Name> show chassis alarms
>     In ShowChassisAlarms: inline at Removed Switch Name> show chassis alarms
> HIT COMMAND:inline at Removed Switch Name> show system license
>     In ShowSystemLicense: inline at Removed Switch Name> show system license
> HIT COMMAND:inline at Removed Switch Name> show system boot-messages
>     In ShowSystemBootMessages: inline at Removed Switch Name> show system
> boot-messages
> HIT COMMAND:inline at Removed Switch Name> show system core-dumps
>     In ShowSystemCoreDumps: inline at Removed Switch Name> show system
> core-dumps
> HIT COMMAND:inline at Removed Switch Name> show version detail
>     In ShowVersion: inline at Removed Switch Name> show version detail
> HIT COMMAND:inline at Removed Switch Name> show configuration
>     In ShowConfiguration: inline at Removed Switch Name> show configuration
>
>
> Im pretty new at working a rancid server, and have been looking around
> trying to figure out what is going on and how to fix it.  Can you please
> help?
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss


More information about the Rancid-discuss mailing list