Observium Professional edition – rancid integration

Updates: 11/12/2014 – Latest revision of Observium Pro’s code for show rancid config has been rewritten without php-svn extension. If you have php-svn installed, it’s best to uninstall it – apt-get remove php5-svn ; service apache2 restart

Update: 12/1/2014 – Updated svn to subversion due to Mike Hammett’s feed back.

Update: 12/8/2014 – Updated cron find command.


So documentation on this one is a little weak.

Fortunately, this guy has blazed a trail for us.

Login and get ready!

apt-get install rancid subversion

We need to add a group for rancid to store configs in.

pico /etc/rancid/rancid.conf

Add this line:


Changes these two lines

RCSSYS=cvs; export RCSSYS


RCSSYS=svn; export RCSSYS

We need to create the folder structure.

su - rancid

We need to create a .cloginrc file.

pico /var/lib/rancid/.cloginrc

I’m backing up mostly Mikrotik devices so my config is a little different.

add user * rancid
add password * password
add identity * /var/lib/rancid/.ssh/id_dsa
add method * ssh
add noenable * {1}

Make sure you have your public key credentials in /var/lib/rancid/.ssh/

Test it out

/var/lib/rancid/bin/mtlogin router

Add www-data to rancid group

usermod -a -G rancid www-data

Update the Observium config

pico /opt/observium/config.php

Add these lines:

$config['rancid_configs'][]              = "/var/lib/rancid/observium/configs/";
$config['rancid_ignorecomments']        = 0;

Restart apache

/etc/init.d/apache2 restart

Check it out in Observium.

You should see a config tab with your configs there.

Screenshot 2014-10-23 14.54.08

Observium has a script which can generate the router.db config based on what’s in Observium.

rancid@observium:/opt/observium/scripts$ php generate-rancid.php 
# do not edit file directly!
#RANCID router.db autogenerated by 

Dump it in the config file with

php /opt/observium/scripts/generate-rancid.php > /var/lib/rancid/observium/router.db

We can add this in cron to do this automatically.

If you want rancid to back up daily, then add something like this to cron.

0 5 * * * /var/lib/rancid/bin/rancid-run
#hourly router dump
50 23 * * * /usr/bin/find /var/lib/rancid/logs -type f -mtime   +2 -exec rm {} \;

Leave a Reply

Your email address will not be published. Required fields are marked *