Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
update data_template_data set rrd_step=60 where rrd_step=300;
update data_template_rrd set rrd_heartbeat=120 where rrd_heartbeat=600;
exit
Do you still need to edit each data template in the Cacti console or this is all you'll need to do + crontab to get this working?
Edit : Seems the MySQL and crontab is all you need.
Edit2 : Speaking too soon is always dangerous, now any new devices I add are all nan'ing. Any idea why this would be, it's only happened since I did the mysql update changes.
Still having issues with gaps in graphs etc, would I need to do something apart from the mysql change such as an rrdtune to all current rrd files? How do I do this if so?
I realize this is an old thread. I had an old cacti instance where I wanted to update all of my stuff, and that would have been a lot of handy work. Here's some simple script that does it from a bash command line;
#!/bin/bash
#
MYSQLCMD='mysql -uroot -pPASSWORD cacti'
#select id from rra WHERE name="Hourly (1 Minute Average)";
#select distinct data_template_data_id from data_template_data_rra;
echo "update data_template_data set rrd_step=60 where rrd_step=300;" | $MYSQLCMD
echo "update data_template_rrd set rrd_heartbeat=120 where rrd_heartbeat=600;" | $MYSQLCMD
RRA1MINID=$(echo "select id from rra WHERE name=\"Hourly (1 Minute Average)\";" | $MYSQLCMD | egrep -v "^0$|^id$")
DATATEMPLATEID=$(echo "select distinct data_template_data_id from data_template_data_rra;" | $MYSQLCMD | egrep -v "^0$|^data_template_data_id$")
EACHITEM=($DATATEMPLATEID)
echo "Array processing..."
echo ""
for EACH in ${EACHITEM[@]}
do
echo "Fixing $EACH"
echo "insert into data_template_data_rra (data_template_data_id,rra_id) VALUES ($EACH,$RRA1MINID);" | $MYSQLCMD
echo "$EACH is fixed."
echo ""
done
echo ""
echo "Done."
exit 0
I didn't have to add the RRA since I already was running cacti version 0.8.7g on Debian (debian package). So, all that I needed to do was change the data templates.
As noted previously, your poller process must always now finish well under one minute, or else everything train wrecks. Check it by using the web UI at System Utilities -> View Cacti Log File. Look for something like this: "SYSTEM STATS: Time:4.8846". This means my poller finished in about five seconds. It is probably a good idea to make sure this is always under half the limit... which is 30 seconds.