Cacti each minute???

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

ben_c
Cacti User
Posts: 203
Joined: Mon May 14, 2007 8:12 pm
Location: Melbourne, Australia.

Post by ben_c »

hunteralpha wrote:mysql --user=root

use cacti;

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.
ben_c
Cacti User
Posts: 203
Joined: Mon May 14, 2007 8:12 pm
Location: Melbourne, Australia.

Post by ben_c »

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?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There's a related topic in the announcement forum. Please check this one
Reinhard
JMoMo
Cacti User
Posts: 60
Joined: Mon Nov 08, 2004 12:11 am

Re: Cacti each minute???

Post by JMoMo »

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;

Code: Select all

#!/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.

But whatever, don't listen to me. I'm an idiot.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests