Chris,<div><br></div><div>I would get a debug statement in the PERL to see what the environment is there. There are many ways of doing that. PATHs can also be set up in rancid.conf.</div><div><br></div><div>My main experience is with Solaris and RANCID so I am not expert on CENT OS (Like Redhat Enterprise Linux?). As a rule, to make code portable, never rely on the crontab path as a lot off *nix's do not support it!</div>
<div><br></div><div>Good luck!</div><div><br></div><div>Now, remember to nock off work before Christmas shopping has been done by your significant other!</div><div><br></div><div>Cheers,</div><div><br></div><div>Bob</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 12 December 2012 04:18, Chris Hunt <span dir="ltr"><<a href="mailto:dharmachris@gmail.com" target="_blank">dharmachris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello All,<br>
I'm having some trouble getting rancid to work properly after<br>
migrating to CentOS 5.8. I can successfully run it from the BASH while<br>
logged in as the rancid user:<br>
!<br>
[rancid@noc ~]$ clogin -c 'show version' <a href="http://router-2.example.com" target="_blank">router-2.example.com</a><br>
<a href="http://router-2.example.com" target="_blank">router-2.example.com</a><br>
spawn ssh -c 3des -x -l nocservices <a href="http://router-2.example.com" target="_blank">router-2.example.com</a><br>
...<br>
router-2>enable<br>
Password:<br>
router-2#<br>
router-2#terminal length 0<br>
router-2#show version<br>
Cisco IOS Software, 7200 Software ....<br>
Technical Support: <a href="http://www.cisco.com/techsupport" target="_blank">http://www.cisco.com/techsupport</a><br>
Copyright (c) 1986-2006 by Cisco Systems, Inc.<br>
...<br>
router-2 uptime is 3 years, 17 weeks, 3 days, 22 hours, 46 minutes<br>
...<br>
3 FastEthernet interfaces<br>
1 Virtual Private Network (VPN) Module<br>
125K bytes of NVRAM.<br>
<br>
62976K bytes of ATA PCMCIA card at slot 1 (Sector size 512 bytes).<br>
4096K bytes of Flash internal SIMM (Sector size 256K).<br>
Configuration register is 0x2102<br>
<br>
router-2#<br>
[rancid@noc ~]$ rancid -d <a href="http://router-2.example.com" target="_blank">router-2.example.com</a><br>
executing clogin -t 90 -c"show version;show redundancy secondary;show<br>
idprom backplane;show install active;show env all;show rsp<br>
chassis-info;show gsr chassis;show diag chassis-info;show boot;show<br>
bootvar;show variables boot;show flash;dir /all nvram:;dir /all<br>
bootflash:;dir /all slot0:;dir /all disk0:;dir /all slot1:;dir /all<br>
disk1:;dir /all slot2:;dir /all disk2:;dir /all harddisk:;dir /all<br>
harddiska:;dir /all harddiskb:;dir /all sup-bootflash:;dir /all<br>
sup-microcode:;dir /all slavenvram:;dir /all slavebootflash:;dir /all<br>
slaveslot0:;dir /all slavedisk0:;dir /all slaveslot1:;dir /all<br>
slavedisk1:;dir /all slaveslot2:;dir /all slavedisk2:;dir /all<br>
slavesup-bootflash:;dir /all sec-nvram:;dir /all sec-bootflash:;dir /all<br>
sec-slot0:;dir /all sec-disk0:;dir /all sec-slot1:;dir /all<br>
sec-disk1:;dir /all sec-slot2:;dir /all sec-disk2:;show controllers;show<br>
controllers cbus;show diagbus;show diag;show module;show spe<br>
version;show c7200;show inventory raw;show vtp status;show vlan;show<br>
vlan-switch;show debug;more system:running-config;show<br>
running-config;write term" <a href="http://router-2.example.com" target="_blank">router-2.example.com</a><br>
PROMPT MATCH: router-2#<br>
HIT COMMAND:router-2#show version<br>
In ShowVersion: router-2#show version<br>
TYPE = 7200<br>
HIT COMMAND:router-2#show redundancy secondary<br>
In ShowRedundancy: router-2#show redundancy secondary<br>
HIT COMMAND:router-2#show idprom backplane<br>
In ShowIDprom: router-2#show idprom backplane<br>
....<br>
HIT COMMAND:router-2#write term<br>
In WriteTerm: router-2#write term<br>
!<br>
<br>
But when run from the rancid user' crontab, it fails saying "The<br>
following routers have not been successfully contacted for more than 4<br>
hours." then lists the router. The logfile shows:<br>
sh: clogin: command not found<br>
!<br>
<a href="http://router-2.example.com" target="_blank">router-2.example.com</a>: missed cmd(s): dir /all slavedisk2:,show rsp<br>
chassis-info,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr<br>
chassis,dir /all sec-nvram:,show diag chassis-info,dir /all disk2:,dir<br>
/all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all<br>
disk0:,show install active,show bootvar,dir /all slaveslot0:,dir /all<br>
sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all<br>
sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all<br>
harddiskb:,show variables boot,show boot,show inventory raw,dir /all<br>
slavedisk1:,show env all,show module,show controllers,show diagbus,more<br>
system:running-config,dir /all slavedisk0:,show debug,show idprom<br>
backplane,dir /all bootflash:,dir /all sec-slot0:,dir /all<br>
sec-disk1:,write term,show vtp status,dir /all sup-bootflash:,dir /all<br>
slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show<br>
vlan,dir /all slavebootflash:,show controllers cbus,dir /all<br>
slaveslot1:,dir /all nvram:,show version,show vlan-switch,show<br>
redundancy secondary,show running-config,show c7200,dir /all slot1:<br>
<a href="http://router-2.example.com" target="_blank">router-2.example.com</a>: End of run not found<br>
!<br>
<br>
I suspected a path issue, so I added the path to the crontab file:<br>
<br>
#<br>
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/var/rancid:/usr/local/rancid/bin:/usr/libexec/rancid:.<br>
SHELL=/bin/bash<br>
*/5 * * * * rancid-run -m <a href="mailto:me@example.com">me@example.com</a><br>
#<br>
<br>
Can someone please hit me with a clue bat?<br>
<br>
Cheers,<br>
-Chris<br>
_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br>
</blockquote></div><br></div>