Sunday, September 23, 2012

RANCID  - linux is cool
i haven't got much linux experiences but here is the setup steps for me


sudo apt-get update

Adduser rancid
Sudo Apt-get install rancid cvsweb mutt postfix

Sudo nano /etc/rancid/rancid.conf
LIST_OF_GROUPS="brisbane"

Sudo nano /etc/aliases
rancid-brisbane: rancid
rancid-admin-brisbane: rancid
Rancid: myemail@mycompany.com
newaliases

Sudo Chown -R rancid /var/lib/rancid
Sudo Chmod -R 775 /var/lib/rancid
Sudo Chown rancid logs
Sudo Chmod 775 /var/lib/rancid/logs
Cd  /var/lib/rancid/logs
Sudo Chmod 775 .


/etc/postfix/main.cf
Add smtp.mycompany.com
postfix restart

Su rancid

/var/lib/rancid/bin/rancid-cvs

cd /var/lib/rancid/brisbane

nano router.db
IPADDRESS_OR_HOSTNAME:brand:up_or_down


nano /home/rancid/.cloginrc
add autoenable * 1
add method * telnet
add user 10.11.61.11 admin
add userpassword 10.11.61.11 passwordhere
add password IPADDRESS_OR_HOSTNAME LOGINPASSWORD ENABLEPASSWORD
add password OTHERIP_OR_HOSTNAME LOGINPASSWORD ENABLEPASSWORD


chmod 640 /home/rancid/.cloginrc
chown rancid /home/rancid/.cloginrc

####- no need usermod -a -G sudo rancid


Rancid-run

Check router config
/var/lib/rancid/CVS/brisbane/configs

Check rancid log
/var/lib/rancid/logs

> crontab -e
- Add this line:
*/30  *  *  *  *  /usr/lib/rancid/bin/rancid-run



Add the Web GUI:
apt-get install cvsweb
nano /etc/cvsweb/cvsweb.conf
Find "@CVSrepositories"
Add:
'rancid' => ['Rancid', '/var/lib/rancid/CVS'],
Save and Quit
Restart apache
apache2ctl restart
sudo ~rancid/bin/rancid-run (or, if in as root, rancid-run)
You can now open a web browser to http://IPOFSERVER/cgi-bin/cvsweb




Too Much Information:
If you feel like you only want to have the configuration files and not the proc info/mem info etc, just edit the following file:
nano /var/lib/rancid/bin/rancid
Search for "# Main"
Comment out lines you no longer wish to document
Save and Quit


No comments:

Post a Comment