I have been using this to backup my Cacti installation weekly (/etc/cron.weekly/cactibackup):
Code: Select all
currentDatetime=`date +%Y%m%d%H%M`
backupDir=/var/backups
mysqldump -l --add-drop-table cacti -u cacti -pT4CkV985YM5V > $backupDir/$currentDatetime-cacti-mysql-backup.sql
gzip $backupDir/$currentDatetime-cacti-mysql-backup.sql
ls -1 /var/www/html/cacti/rra/*.rrd | awk '{print "rrdtool dump "$1" > "$1".xml"}' | sh -x
tar zcfpv $backupDir/$currentDatetime-cacti-config-backup.tgz /var/www/html/cacti/include/config.php /etc/snmp/snmpd.conf /etc/my.cnf /etc/httpd/conf.d/cacti.conf /etc/spine.conf /etc/php.ini /etc/php.d/mysql.ini /etc/php.d/snmp.ini /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/php.conf /var/www/html/cacti/rra/*.xml /var/www/html/cacti/scripts/* /var/www/html/cacti/plugins/* /var/www/html/cacti/resource/* --index-file=$backupDir/$currentDatetime-backup.log
rm /var/www/html/cacti/rra/*.xml
# to import the RRD data run the following commands:
# sudo rm /var/www/html/cacti/rra/*.rrd
# sudo ls -1 /var/www/html/cacti/rra/*.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sudo sh -x
# sudo rm /var/www/html/cacti/rra/*.xml
# sudo chown cacti:cacti *
Code: Select all
cacti-spine-0.8.7g.tar.gz
cacti-0.8.7g.tar.gz
cacti-plugin-0.8.7g-PA-v2.8.tar.gz
Code: Select all
sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
sudo yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server net-snmp net-snmp-utils rrdtool gcc mysql-devel net-snmp-devel
I can extract Cacti, the plugin architecture and make/install Spine, but am I missing anything? I'll continue this post as I go through the process. Hopefully at the end I'll have an easy to read how-to
Set our 3 new services to start automatically and start them:
Code: Select all
sudo /sbin/chkconfig httpd on
sudo /sbin/chkconfig snmpd on
sudo /sbin/chkconfig mysqld on
sudo /etc/init.d/httpd restart
sudo /etc/init.d/mysqld restart
sudo /etc/init.d/snmpd restart