Agenda: exercises-rancid-2.txt

File exercises-rancid-2.txt, 2.8 KB (added by admin, 9 years ago)
Line 
1Advanced Registry Operations Curriculum
2Using RANCID Part II
3
4Notes:
5------
6* Commands preceded with "$" imply that you should execute the command as
7  a general user - not as root.
8* Commands preceded with "#" imply that you should be working as root.
9* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
10  imply that you are executing commands on remote equipment, or within
11  another program.
12
13Exercises
14---------
15
160.      Become the RANCID user
17
18        - Make sure you are the root user first. If not, then do:
19       
20        $ su -
21       
22        - To become the RANCID user do:
23
24        # su -s /bin/bash rancid
25
261. Note the IP addresses for the routers
27
28        192.168.5.129 for group 1 or 192.168.5.161 for group 2
29
302. Update /var/lib/rancid/.cloginrc
31
32        Change the file to look like this:
33
34        $ vi /var/lib/rancid/.cloginrc
35
36        add user 192.168.5.* admin
37        add password 192.168.5.* GTcctld! GTcctld!
38
39        (This tells RANCID that all hosts called "192.168.5.*" use the
40        same password and user -- no need to add every router by hand!)
41
423. Update the router.db
43
44    $ vi /var/lib/rancid/all/router.db
45
46        Add our other classroom router to the file. You should end up with:
47
48        192.168.5.129:cisco:up
49        192.168.5.161:cisco:up
50
51        (Note that "cisco" means this is Cisco equipment -- it tells Rancid
52        that we are expecting to talk to a Cisco device here.  You can also
53        talk to Juniper, HP, ...)
54
554. Run rancid again:
56
57        $ /usr/lib/rancid/bin/rancid-run
58
59        (Should take a few seconds)
60
615. Check out the logs:
62
63        $ cd /var/lib/rancid/logs
64        $ ls -l
65
66        ... View the contents of the file:
67
68        $ more all.*
69
706. Look at the configs
71
72        $ cd /var/lib/rancid/all/configs
73        $ more 192.168.5.1*
74
75        - If all went well, you can see the configs of ALL routers
76
777. Change the configuration on the router (change the description on
78    an interface, for example)
79
808. Run rancid again
81
82        $ /usr/lib/rancid/bin/rancid-run
83
849. Play with clogin:
85
86        $  /usr/lib/rancid/bin/clogin -c "show clock" 192.168.5.129 192.168.5.161
87
88- What do you notice ?
89
90
9110. Add the RANCID CVS repository in to CVSweb
92
93        - First we install CVSweb:
94
95        # apt-get install cvsweb
96
9711. Edit the file /etc/cvsweb/cvsweb.conf
98
99        # vi /etc/cvsweb/cvsweb.conf
100
101        - Change the line:
102
103'local'   => ['Local Repository', '/var/lib/cvs'],
104
105        to
106
107'nagios3' => ['AROC Nagios', '/home/sysadmin/cvs'],
108
109        - Save and exit
110
11112. Fix a link:
112
113        # cd /var/www
114        # ln -s /usr/share/cvsweb .
115       
116        - Edit the file /etc/cvsweb/cvsweb.conf:
117
118        # vi /etc/cvsweb/cvsweb.conf
119
120        - Either above or below the line:
121
122'nagios3' => ['AROC Nagios', '/home/tldadmin/cvs'],
123
124        add a new line that reads:
125
126'rancid'   => ['Rancid Repository', '/var/lib/rancid/CVS'],
127
128        - Save and exit
129
130        - Open a web browser to the link:
131
132        http://MyMachine/cgi-bin/cvsweb/
133
134          and select between the RANCID and the AROC Nagios3 configuration files CVS
135          repositories in the CVS Root drop-down list.