Automatic Network Configuration Version Control with Rancid and Procurve Switches
Rancid is a really handy bit of software that can automatically check for configuration changes of routers and switches, email notification of these changes whilst maintaining the history in SVN or CVS.
When I set this up it just worked for our Cisco switches however I intially had a problem with the Procurve Switches. After adding the switches to the router.db with the following syntax
switchhostname:hp:ip |
And then manually kicking off rancid with the command
./bin/rancid-run |
I noticed it took the command ages to run and not much happened. Examing the logs in /var/log/rancid/GroupName.Date I saw lots of errors with timeouts. Investigating further this was an issue with hpuifilter
Error: ssh failed: couldn't execute "hpuifilter": no such file or directory |
hpuifuilter is in the /rancid/bin/ folder however the path was not specified. With running Rancid on an Ubuntu 12.04 server I simply modified the global path in /etc/environment/ and after this it appeared to work a little better but still not pull in the config from the procurve switches.
I then tried a manual run of hlogin to see if it could simply pull the time from the switch with the command
./hlogin -c 'show time' switchhostname |
However this would not get past the Procurve welcome screen
A resolution to this is to specify autoenable in the .cloginrc file.
add password switchhostname {password} {enpassword} add autoenable switchhostname 1 |
After that simply set a cron job to run rancid-run at your preffered interval, configure postfix and your email groups and thats it. You will now have all the configuration history and automatically be emailed when there is any configuration change.