My graphs are broken images
Moderators: Developers, Moderators
My graphs are broken images
I'm working through moving Cacti from a sandbox environment to a production environment. I'm chronicling the effort here: http://forums.cacti.net/viewtopic.php?t=39367
In addition I applied the permissions listed in the documentation under the "upgrading cacti" section.
I can login and my devices all show up in the list. I can query them with SNMP and they return results, but when I go to view the graphs they all show up as broken images/red-x.
In addition I applied the permissions listed in the documentation under the "upgrading cacti" section.
I can login and my devices all show up in the list. I can query them with SNMP and they return results, but when I go to view the graphs they all show up as broken images/red-x.
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
I checked my RRD Tool version. It's 1.2 and my Cacti is setup for 1.2.
The RRD files do exist in /var/www/html/cacti/rra but they're not being updated. I'm guessing it's going to be a permissions issue.
They are cacti:root at present. Still digging ... thanks for the reply.
The RRD files do exist in /var/www/html/cacti/rra but they're not being updated. I'm guessing it's going to be a permissions issue.
They are cacti:root at present. Still digging ... thanks for the reply.
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
Code: Select all
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Build03 (RHEL 4) (vm02) - CPU Utilization - CPU0' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit='100' \
--lower-limit='0' \
--vertical-label='percent' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti/rra/build03_rhel_4_cpu_99.rrd":cpu:AVERAGE \
AREA:a#55009DFF:"CPU Utilization" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf\n"
RRDTool Says:
ERROR: This RRD was created on other architecture
This is either due to the CentOS 5.5 vs. RHEL 5.5, or more likely, because the original was captured in 32-bit and the new installation is 64-bit.
Thoughts?
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
Does this sound reasonable?
Code: Select all
So we need to export the files to xml and then reimport them:
rrdtool dump filename.rrd > filename.xml
rrdtool restore filename.xml > filename.rrd
But if you’ve got dozens, hundreds or even thousands of RRD files, doing them one by one is going to get tired, very quickly. So here we go:
oldcacti:/usr/share/cacti/site/rra/# ls -1 *.rrd | awk '{print "rrdtool dump "$1" > "$1".xml"}' | sh -x
scp *.xml root@newcacti:/usr/share/cacti/site/rra/
followed by:
newcacti:/usr/share/cacti/site/rra/# rm *.rrd
newcacti:/usr/share/cacti/site/rra/# ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sh -x
newcacti:/usr/share/cacti/site/rra/# rm *.xml
newcacti:/usr/share/cacti/site/rra/# chown www-data:www-data *
That should be it, the final chown ensures that Apache can actually open the files and present them. Assuming Cacti et al is configured right on newcacti, you should be seeing some pretty graphs
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
You know what they say about bellybuttons and opinions? Everybody has one; some stink more than others ...
What do you think about updating the documentation with regards to Cacti upgrading and/or backups with:
What do you think about updating the documentation with regards to Cacti upgrading and/or backups with:
Code: Select all
currentDatetime=`date +%Y%m%d%H%M`
backupDir=/var/backups
mysqldump -l --add-drop-table cacti -u cacti -pSOMEPASSWORD > $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 *
Last edited by bmote on Mon Aug 23, 2010 6:35 am, edited 1 time in total.
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
Hmmmm ... hadn't thought of environments outside of Linux.
Maybe, if at all, the change should be general guidance concerning what might change and how to dump the RRD files so they can be imported into any RRD environment?
The paths won't cross pollinate either. I know. Just hashing through ideas.
Thoughts?
Maybe, if at all, the change should be general guidance concerning what might change and how to dump the RRD files so they can be imported into any RRD environment?
Code: Select all
/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/*
Thoughts?
Bill Mote
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
blog: http://ThingsThatMakeMeMadAndHowToFixThem.blogspot.com
Who is online
Users browsing this forum: No registered users and 0 guests