| 1 | Advanced Registry Operations Curriculum |
|---|
| 2 | |
|---|
| 3 | Using Rancid - Part II |
|---|
| 4 | |
|---|
| 5 | 0. Become the RANCID user |
|---|
| 6 | |
|---|
| 7 | - Make sure you are the root user first. If not, then do: |
|---|
| 8 | |
|---|
| 9 | $ su - |
|---|
| 10 | |
|---|
| 11 | - To become the RANCID user do: |
|---|
| 12 | |
|---|
| 13 | # su -s /bin/bash rancid |
|---|
| 14 | |
|---|
| 15 | 1. Note the IP addresses for the routers |
|---|
| 16 | |
|---|
| 17 | 192.168.5.129 for group 1 or 192.168.5.161 for group 2 |
|---|
| 18 | |
|---|
| 19 | 2. Update /var/lib/rancid/.cloginrc |
|---|
| 20 | |
|---|
| 21 | Change the file to look like this: |
|---|
| 22 | |
|---|
| 23 | $ vi /var/lib/rancid/.cloginrc |
|---|
| 24 | |
|---|
| 25 | add user 192.168.5.* admin |
|---|
| 26 | add password 192.168.5.* GTcctld! GTcctld! |
|---|
| 27 | |
|---|
| 28 | (This tells RANCID that all hosts called "192.168.5.*" use the |
|---|
| 29 | same password and user -- no need to add every router by hand!) |
|---|
| 30 | |
|---|
| 31 | 3. Update the router.db |
|---|
| 32 | |
|---|
| 33 | $ vi /var/lib/rancid/all/router.db |
|---|
| 34 | |
|---|
| 35 | Add our other classroom router to the file. You should end up with: |
|---|
| 36 | |
|---|
| 37 | 192.168.5.129:cisco:up |
|---|
| 38 | 192.168.5.161:cisco:up |
|---|
| 39 | |
|---|
| 40 | (Note that "cisco" means this is Cisco equipment -- it tells Rancid |
|---|
| 41 | that we are expecting to talk to a Cisco device here. You can also |
|---|
| 42 | talk to Juniper, HP, ...) |
|---|
| 43 | |
|---|
| 44 | 4. Run rancid again: |
|---|
| 45 | |
|---|
| 46 | $ /usr/lib/rancid/bin/rancid-run |
|---|
| 47 | |
|---|
| 48 | (Should take a few seconds) |
|---|
| 49 | |
|---|
| 50 | 5. Check out the logs: |
|---|
| 51 | |
|---|
| 52 | $ cd /var/lib/rancid/logs |
|---|
| 53 | $ ls -l |
|---|
| 54 | |
|---|
| 55 | ... View the contents of the file: |
|---|
| 56 | |
|---|
| 57 | $ more all.* |
|---|
| 58 | |
|---|
| 59 | 6. Look at the configs |
|---|
| 60 | |
|---|
| 61 | $ cd /var/lib/rancid/all/configs |
|---|
| 62 | $ more 192.168.5.1* |
|---|
| 63 | |
|---|
| 64 | - If all went well, you can see the configs of ALL routers |
|---|
| 65 | |
|---|
| 66 | 7. Change the configuration on the router (change the description on |
|---|
| 67 | an interface, for example) |
|---|
| 68 | |
|---|
| 69 | 8. Run rancid again |
|---|
| 70 | |
|---|
| 71 | $ /usr/lib/rancid/bin/rancid-run |
|---|
| 72 | |
|---|
| 73 | 9. Play with clogin: |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | $ /usr/lib/rancid/bin/clogin -c "show clock" 192.168.5.129 192.168.5.161 |
|---|
| 77 | |
|---|
| 78 | - What do you notice ? |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | 10. Add the RANCID CVS repository in to CVSweb |
|---|
| 82 | |
|---|
| 83 | - Exit from the RANCID user: |
|---|
| 84 | |
|---|
| 85 | $ exit |
|---|
| 86 | |
|---|
| 87 | - Edit the file /etc/cvsweb/cvsweb.conf: |
|---|
| 88 | |
|---|
| 89 | # vi /etc/cvsweb/cvsweb.conf |
|---|
| 90 | |
|---|
| 91 | - Either above or below the line: |
|---|
| 92 | |
|---|
| 93 | 'nagios3' => ['AROC Nagios', '/home/tldadmin/cvs'], |
|---|
| 94 | |
|---|
| 95 | add a new line that reads: |
|---|
| 96 | |
|---|
| 97 | 'rancid' => ['Rancid Repository', '/var/lib/rancid/CVS'], |
|---|
| 98 | |
|---|
| 99 | - Save and exit |
|---|
| 100 | |
|---|
| 101 | - Open a web browser to the link: |
|---|
| 102 | |
|---|
| 103 | http://localhost/cgi-bin/cvsweb/ |
|---|
| 104 | |
|---|
| 105 | and select between the RANCID and the AROC Nagios3 configuration files CVS |
|---|
| 106 | repositories in the CVS Root drop-down list. |
|---|