networking-forum.com
Community BlogCommunity Wiki * Register  * Search  * Login
View unanswered postsView active topics

All times are UTC - 6 hours [ DST ]



Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: Rancid Hepl
PostPosted: Thu Apr 26, 2012 1:26 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
so one of my first tasks at the new job is to setup a rancid box running under fedora.
anywhoo, I've got the beast installed and can log into router, except that
when the script logs in, noting happens, it just sits there at the device prompt

what am I missing???

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Thu Apr 26, 2012 1:54 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Sat Dec 19, 2009 11:52 pm
Posts: 1161
Location: Central Florida
Certs: CCNP, JNCIA, MCSA
Are you executing the 'clogin' command or are you running 'rancid-run'?


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Thu Apr 26, 2012 1:56 pm 
Offline
Ultimate Member
Ultimate Member

Joined: Sat Oct 09, 2010 2:13 pm
Posts: 592
Certs: CCNA
.cloginrc handles the login username/password/enable password. If your sure it's getting by those prompts, I'd make sure the user running "rancid-run" has access to everything under /bin of your rancid install. I know that /bin/clogin in particular handles cisco logins and running commands, and acts somewhat as the backend for .cloginrc.

Also not sure what version of perl you're using, but the whole thing is run through the perl interpreter. Not sure what version it needs, but the fact it has to be compatible is a given.

I have a fedora 14 box with the default perl 5.12.4 that runs rancid.


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Thu Apr 26, 2012 2:40 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
yeah, clogin, duh.

when I run the rancid-run, and view the logs
I get a message that no version exists,
when I try to run cvs add x.x.x.x program says
use -d command option or
no CVSROOT specified


hummm..

Code:
cvs add: in directory .:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
cvs commit: cannot open CVS/Entries for reading: No such file or directory
cvs commit: nothing known about `x.x.x.x'
cvs [commit aborted]: correct above errors first!
Added x.x.x.x

cvs status: cannot open CVS/Entries for reading: No such file or directory
cvs status: use `cvs add' to create an entry for 10,1,24.240
cvs add: in directory .:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
cvs added missing router x.x.x.x


Code:
$ cvs add x.x.x.x
cvs add: No CVSROOT specified!  Please use the `-d' option
cvs [add aborted]: or set the CVSROOT environment variable.

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Thu Apr 26, 2012 11:14 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Sat Dec 19, 2009 11:52 pm
Posts: 1161
Location: Central Florida
Certs: CCNP, JNCIA, MCSA
Sounds like it hasn't created the CVSROOT directories.

Verify the following:

1. In /usr/local/rancid/etc/rancid.conf, verify that you've created the groups you want (default is 'networking-group' or something like that)
2. Run 'rancid-cvs.' This will created the directories in /usr/local/rancid/var
3. Go to /usr/local/rancid/var/group_name, edit the 'router.db' file, and add your router's IP in the format of "x.x.x.x:cisco:up"
4. Edit /usr/local/rancid/.cloginrc and add the config for your router's username/password and enable secret
5. Execute 'clogin x.x.x.x' and see if it can login to the router. If it can, then you know the credentials are right
6. Execute 'rancid-run group_name' and it'll run on the devices under the group you created.
7. If it fails, post the output of the log


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Fri Apr 27, 2012 9:44 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
killabee wrote:
Sounds like it hasn't created the CVSROOT directories.

Verify the following:

1. In /usr/local/rancid/etc/rancid.conf, verify that you've created the groups you want (default is 'networking-group' or something like that)
2. Run 'rancid-cvs.' This will created the directories in /usr/local/rancid/var
3. Go to /usr/local/rancid/var/group_name, edit the 'router.db' file, and add your router's IP in the format of "x.x.x.x:cisco:up"
4. Edit /usr/local/rancid/.cloginrc and add the config for your router's username/password and enable secret
5. Execute 'clogin x.x.x.x' and see if it can login to the router. If it can, then you know the credentials are right
6. Execute 'rancid-run group_name' and it'll run on the devices under the group you created.
7. If it fails, post the output of the log


did find a typo in the router.db file, fixed that
I don't think CVS is installed correctly

var/log says
Code:
cvs status: cannot open CVS/Entries for reading: No such file or directory
cvs status: nothing known about x.x.x.x
cvs add: in directory .:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
cvs added missing router x.x.x.x


I manually created the CVS/Entries directory, but message still persists.

when I run the rancid-cvs, I get no STDOUT just a prompt back,
the installer docs I'm using shows a CVS checkout and add of router.db

installer document ref:
http://www.linuxhomenetworking.com/wiki ... ith_Rancid

-- added

my group is netadm,

in /usr/local/var/netadm/configs there is a file named x.x.x.x with a file size of 0

--- added

so what I think all I need to do is get
/usr/local/var/netadm/
/usr/local/var/netadm/configs

in the CVS repository.

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Fri Apr 27, 2012 11:56 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Sat Dec 19, 2009 11:52 pm
Posts: 1161
Location: Central Florida
Certs: CCNP, JNCIA, MCSA
You shouldn't have to manually create any directories. Once you define the groups in rancid.conf file and run 'rancid-cvs,' RANCID will create the folders. RANCID will manage the CVS too. Also, rather than checking the file system to validate whether RANCID is creating the devices, check the web interface. IMO, the file system hierarchy and permissions for RANCID is a bit confusing.

So if you go to http://serverip/viewvc, you should see a folder for the group, and under that a link showing the IP for the router. If you see that, then RANCID is properly creating the directories and managing the CVS. Next step is to get it to login to routers/switches.


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Mon Apr 30, 2012 2:33 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
so I found some document, FAQ or HOW-TO something like that
that directed me to remove the group directory and re-create it.
so that is what I did, seems to be a little farther along, still
getting broken pipe messages, but research shows that it could be
an issue with ACS and command rights. I'll have to look into that tomorrow.

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Tue May 01, 2012 1:42 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
so the shrubbery people helped me determine that the broken pipe issue was an authorization issue,
there was a command in the data collection that I was not authorized to use and the script kicked me out.

now off to setting up cvsweb and apache to get the gui goodies.

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 11:09 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
anyone have any good parsing scripts for
show cdp neighbors detail
or
show interface status?

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 11:17 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Fri Apr 25, 2008 2:16 pm
Posts: 1361
Location: Jacksonville, FL
Certs: CCNP, CCNA:Sec, MCSE
I made my RANCID show me all trunk links; its kinda like CDP, but without all the stupid phones/APs.

I added
{'show int status' => 'ShowIntTrunk'},

to my @commandtable

and then added:

sub ShowIntTrunk {
print STDERR " In ShowIntTrunk: $_" if ($debug);
my($lines) = 0;

while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
last if (/Usage/);
next if (/^(\s*|\s*$cmd\s*)$/);
next if (!/trunk/);
return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
if (/^(<-+ More -+>)/) {
my($len) = length($1);
s/^$1\s{$len}//;
}

/^No matching debug flags set$/ && next;
ProcessHistory("COMMENTS","keysort","J1","!INT: $_");
$lines++;
}
if ($lines) {
ProcessHistory("COMMENTS","keysort","J0","!\n");
}
return(0);
}


Now I get stuff like:

!INT: Te1/1 To CW-4900M-2:Ten1 connected trunk full 10G 10GBase-SR
!INT: Te1/3 To CW-N5K-1:Eth1/2 connected trunk full 10G 10GBase-SR
!INT: Te1/4 To CW-Admin:Ten1/0 connected trunk full 10G 10GBase-SR
!INT: Te1/5 To CW-IT:Ten1/0/1 connected trunk full 10G 10GBase-SR

in my RANCID, which tells me if trunks go offline, which was what I really cared about. Hope this helps...

_________________
"A problem well stated is a problem half solved". (Charles Kettering)


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 11:34 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
Dinger wrote:
# the pager can not be disabled per-session on the PIX



Thanks for that script

have you tried the 'pager line 0'
and 'no pager' commands

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 12:00 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Fri Apr 25, 2008 2:16 pm
Posts: 1361
Location: Jacksonville, FL
Certs: CCNP, CCNA:Sec, MCSE
Those comments were part of the template I used; I know you can turn off the pager via a config option, but I think they were referring to per-session (as opposed to globally, via the config)

_________________
"A problem well stated is a problem half solved". (Charles Kettering)


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 12:03 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Fri Apr 25, 2008 2:16 pm
Posts: 1361
Location: Jacksonville, FL
Certs: CCNP, CCNA:Sec, MCSE
actually 'terminal pager 0' from enable mode seems to turn off the Pager on ASA per-session, at least on 8.2 code.

_________________
"A problem well stated is a problem half solved". (Charles Kettering)


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 1:30 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Sat Dec 19, 2009 11:52 pm
Posts: 1161
Location: Central Florida
Certs: CCNP, JNCIA, MCSA
Sweet! That script looks handy.

Anyone have Rancid backing up F5s or the other devices that it supports?


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Wed May 02, 2012 1:38 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Fri Apr 25, 2008 2:16 pm
Posts: 1361
Location: Jacksonville, FL
Certs: CCNP, CCNA:Sec, MCSE
I backup two sets of F5 BigIP LTM units; originally running 9.x code, now running 10.2.x code.

_________________
"A problem well stated is a problem half solved". (Charles Kettering)


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Thu May 03, 2012 12:56 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
found this one today haven't tried it.
credit to Skye Hagen skyeh at uidaho.edu

Skye says:
...here is the code I used to
handle 'show cdp neighbor detail'. The top part is pretty standard for any
parsing routine, to skip the junk, and exit if we have hit the end of what
we are interested in. After than, I look for specific lines, looking for the
DeviceID, platform and interface. For the first two, I just store the data.
When I hit an interface line, I create a line in the RANCID output. When
done, I add a blank comment line to separated the CDP section from the next
part of the RANCID output. This produces lines like this...

!CDP: Device: hub001D3.csrv.uidaho.edu Platform: cisco WS-C2960G-48TC-L
Interface: GigabitEthernet2/14
!CDP: Device: lib6500.csrv.uidaho.edu Platform: cisco WS-C6509-E Interface:
GigabitEthernet3/1

Here is the code.
Code:
# This routine parses "show cdp neighbor detail"
sub ShowCDPDetail {
    print STDERR "    In ShowCDPDetail: $_" if ($debug);

    my($deviceID, $platform, $interface);
    while (<INPUT>) {
        tr/\015//d;
        last if (/^$prompt/);
        next if (/^(\s*|\s*$cmd\s*)$/);
        return(1) if (/Line has invalid autocommand /);
        return(1) if (/(Invalid (input|command) detected|Type help or )/i);
        # the pager can not be disabled per-session on the PIX
        if (/^(<-+ More -+>)/) {
            my($len) = length($1);
            s/^$1\s{$len}//;
        }

        if (/^Device ID: (.*)/) {
            $deviceID = $1;
            next;
        }

        if (/^Platform: ([^,]+)/) {
            $platform = $1;
            next;
        }

        /^Interface: (\S+),/ &&
            ProcessHistory("CDP","keysort","$deviceID $1",
                           "!CDP: Device: $deviceID Platform: $platform
Interface: $1\n") && next;
    }

    ProcessHistory("","","","!\n");
    return(0);

}

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
 Post subject: Re: Rancid Hepl
PostPosted: Fri May 11, 2012 8:46 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8260
Location: Frederick MD
Certs: Instanity
finally got it all working, both RANCID and CVSweb,

_________________
"If you're good at anticipating the human mind. It leaves nothing to chance."
-Jigsaw


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: stevester1 and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group