[rancid] Permissions and files

Ryan Milton rmilton at mvsusa.com
Thu Sep 12 20:45:03 UTC 2013


Ahhhhh! Ok now if I am a multi-vendor operation, some Juniper, some HP, Netscreen, Cisco, etc, how do I set so that the correct script runs for various device types? And would that be set in the chronjob the same way?

Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Hinote, Scotty (MSFC-IS40)[NICS] [mailto:willie.s.hinote at nasa.gov]
Sent: Thursday, September 12, 2013 4:39 PM
To: Ryan Milton; Aaron Dudek
Cc: rancid-discuss at shrubbery.net
Subject: RE: [rancid] Permissions and files

You should use the jlogin script for Juniper devices /usr/lib/rancid/bin/jlogin -f /var/lib/rancid/.cloginrc X.X.X.X.

From: Ryan Milton [mailto:rmilton at mvsusa.com]
Sent: Thursday, September 12, 2013 3:36 PM
To: Hinote, Scotty (MSFC-IS40)[NICS]; Aaron Dudek
Cc: rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: RE: [rancid] Permissions and files

Well, here is what I get, I am assuming its due to the fact that my equipment is Juniper:

rancid at ObserviumNYC:/var/lib/rancid$ /usr/lib/rancid/bin/clogin -f /var/lib/rancid/.cloginrc 94.XXX.11.1
94.XXX.11.1
spawn ssh -c 3des -x -l ryan 94.XXX.11.1
ryan at 94.229.11.1's<mailto:ryan at 94.229.11.1's> password:
--- JUNOS 9.3R4.4 built 2009-08-12 04:44:38 UTC
ryan at core1.ams1<mailto:ryan at core1.ams1>> enable
                 ^
unknown command.


ryan at core1.ams1<mailto:ryan at core1.ams1>>
Error: TIMEOUT reached
can not find channel named "exp6"
    while executing
"send "\r""
    ("foreach" body line 167)
    invoked from within
"foreach router [lrange $argv $i end] {
    set router [string tolower $router]
    # attempt at platform switching.
    set platform ""
    send_user ..."
    (file "/usr/lib/rancid/bin/clogin" line 778)



Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Hinote, Scotty (MSFC-IS40)[NICS] [mailto:willie.s.hinote at nasa.gov]
Sent: Thursday, September 12, 2013 4:29 PM
To: Ryan Milton; Aaron Dudek
Cc: rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: RE: [rancid] Permissions and files

If you SSH from your rancid server to the device that you are trying to backup as the rancid user that you have configured and execute a show running-config, do you receive any errors?

From: rancid-discuss-bounces at shrubbery.net<mailto:rancid-discuss-bounces at shrubbery.net> [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Ryan Milton
Sent: Thursday, September 12, 2013 2:32 PM
To: Aaron Dudek
Cc: rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] Permissions and files

OK, so now those permissions are fixed, I assume. That said, I still get nothing in that file when I just "rancid-run".

Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Aaron Dudek [mailto:adudek16 at gmail.com]
Sent: Thursday, September 12, 2013 3:15 PM
To: Ryan Milton
Cc: Heasley; rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] Permissions and files

>From Healey earlier..

Fix that. chown -R rancid /var/rancid

On Thu, Sep 12, 2013 at 2:58 PM, Ryan Milton <rmilton at mvsusa.com<mailto:rmilton at mvsusa.com>> wrote:
Ok,
I got you. Seems everything in /var/lib/rancid/bin is root:

rancid at ObserviumNYC:/var/log/rancid$ cd /var/lib/rancid/bin/
rancid at ObserviumNYC:/var/lib/rancid/bin$ ls -lt
-rwxr-xr-x 1 root root 67004 Mar  5  2012 rancid
-rwxr-xr-x 1 root root  4420 Mar  5  2012 rancid-cvs

Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Aaron Dudek [mailto:adudek16 at gmail.com<mailto:adudek16 at gmail.com>]
Sent: Thursday, September 12, 2013 2:52 PM

To: Ryan Milton
Cc: Heasley; rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] Permissions and files

Not what I meant.
su - rancid
then do
pwd
then
/var/lib/rancid/bin/rancid-run
Where did "/usr/bin/rancid-run" come from? Because that is different then what you were trying to run before.


On Thu, Sep 12, 2013 at 2:47 PM, Ryan Milton <rmilton at mvsusa.com<mailto:rmilton at mvsusa.com>> wrote:
Ok, so since I'm following various guides (mostly the "Ubuntu server install), I am assuming that the command is /usr/bin/rancid-run.


rancid at ObserviumNYC:/var/log/rancid$ vi MVSNetwork.20130912.144417
gives me:
starting: Thu Sep 12 14:44:17 EDT 2013



ending: Thu Sep 12 14:44:17 EDT 2013

Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Aaron Dudek [mailto:adudek16 at gmail.com<mailto:adudek16 at gmail.com>]
Sent: Thursday, September 12, 2013 2:22 PM
To: Ryan Milton
Cc: Heasley; rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>

Subject: Re: [rancid] Permissions and files

what happens when you just run it as the rancid user?

On Thursday, September 12, 2013, Ryan Milton wrote:
Ok, I have changed the ownership. I made a test config change on a device, ran rancid and exactly the same as:
sudo -i su -c /var/lib/rancid/bin/rancid-run -s /bin/bash -l rancid

gets me:

starting: Thu Sep 12 10:53:28 EDT 2013



ending: Thu Sep 12 10:53:28 EDT 2013

So, the config change doesn't show.

Regards,
Ryan Milton
MVS Network Manager
o: 201-447-1505 x124
c: 862-249-5230
www.mvsusa.com<http://www.mvsusa.com/>
[MVS final logo GOOD very small]

From: Heasley [mailto:heas at shrubbery.net]
Sent: Thursday, September 12, 2013 1:40 PM
To: Ryan Milton
Cc: rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] Permissions and files

Am Sep 12, 2013 um 16:59 schrieb Ryan Milton <rmilton at mvsusa.com<mailto:rmilton at mvsusa.com>>:



<image001.gif>

I don't know where to go on this. I can't tell if my Rancid configuration is even working. I'm at the point of testing rancid-run manually to see what happens. I am getting a combination of "Permission Denied" errors on the .cloginrc file, "End of Run Not found" errors, and some others that I excerpted below. That said, I have an example of the file in /var/log/rancid from today and from Friday:



sudo -i su -c /var/lib/rancid/bin/rancid-run -s /bin/bash -l rancid



gets me:



starting: Thu Sep 12 10:53:28 EDT 2013







ending: Thu Sep 12 10:53:28 EDT 2013



VS:



starting: Fri Sep 6 15:57:50 EDT 2013



/usr/lib/rancid/bin/control_rancid: 206: /usr/lib/rancid/bin/control_rancid: cannot create routers.db: Permission denied



Fix that. chown -R rancid /var/rancid





comm: file 2 is not in sorted order

comm: file 2 is not in sorted order

comm: file 2 is not in sorted order

cvs add: scheduling file `94.229.11.1' for addition

cvs add: use `cvs commit' to add this file permanently

/var/lib/rancid/CVS/MVSNetwork/configs/94.229.11.1<http://94.229.11.1>,v  <--  94.229.11.1

initial revision: 1.1

Added 94.229.11.1

cvs add: scheduling file `94.229.11.2' for addition

cvs add: use `cvs commit' to add this file permanently

/var/lib/rancid/CVS/MVSNetwork/configs/94.229.11.2<http://94.229.11.2>,v  <--  94.229.11.2

initial revision: 1.1

Added 94.229.11.2

cvs add: scheduling file `94.229.11.3' for addition

cvs add: use `cvs commit' to add this file permanently

/var/lib/rancid/CVS/MVSNetwork/configs/94.229.11.3<http://94.229.11.3>,v  <--  94.229.11.3

initial revision: 1.1

Added 94.229.11.3



***TRUNCATED***



94.229.11.2 jlogin error: Error: couldn't read file "/home/rancid/.cloginrc": permission denied

94.229.11.2<http://94.229.11.2>: missed cmd(s): show chassis alarms,show chassis hardware detail,show system license,show chassis scb,show chassis feb,show chassis routing-engine,show chassis firmware,show version detail,show chassis feb detail,show configuration,show system boot-messages,show chassis cfeb,show chassis clocks,show chassis sfm detail,show chassis ssb,show chassis fpc detail,show chassis environment,show system core-dumps

94.229.11.2<http://94.229.11.2>: End of run not found

94.229.11.3 jlogin error: Error: couldn't read file "/home/rancid/.cloginrc": permission denied<


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20130912/ea0dd200/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 2724 bytes
Desc: image003.jpg
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20130912/ea0dd200/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 2724 bytes
Desc: image004.jpg
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20130912/ea0dd200/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.jpg
Type: image/jpeg
Size: 2724 bytes
Desc: image005.jpg
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20130912/ea0dd200/attachment-0002.jpg>


More information about the Rancid-discuss mailing list