Changing polling interval - now no graphs

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

Changing polling interval - now no graphs

Post by lonecrow »

I had been getting very high cpu and didn't know why. I am using cactiez. I turned boost on. Then while I was looking through the settings I realized the polling was set to 1 minute!! So I changed that obviously to 5 mins. But I left boost on. The cpu went back down to normal.

I come back the next day almost all the graphs are not working. Some of my custom graphs are. But the regular linux and unix template graphs for load average, or any snmp interface statistics will NOT work anymore.

I turned debug on the graph and here are the result of me trying to get interface stats on an ethernet device. (with xxx's added instead of actual info)

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="xxxxxx - Traffic - xxx.xxx.xxx.xxx (eth0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_in:AVERAGE \
DEF:b="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_in:LAST \
DEF:c="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_in:MIN \
DEF:d="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_in:MAX \
DEF:e="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_out:AVERAGE \
DEF:f="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_out:LAST \
DEF:g="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_out:MIN \
DEF:h="/var/www/html/rra/bella_bmu_traffic_in_689.rrd":traffic_out:MAX \
CDEF:cdefa=a,8,* \
CDEF:cdefb=b,8,* \
CDEF:cdefd=d,8,* \
CDEF:cdefe=e,8,* \
CDEF:cdeff=f,8,* \
CDEF:cdefh=h,8,* \
AREA:cdefa#00CF00FF:"Inbound" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97FF:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefh:MAX:"Maximum\:%8.2lf %s"
RRDTool Says:

OK

Anyone know why?

I tried putting everything back and still nothing.

the only other Thing I might have done was weeks earlier I added some Motorola templates and the cpu usage went real high after that so I removed them from the /scripts dir.. maybe I deleted something by accident?
lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

Post by lonecrow »

Also can someone post a directory listing of the scripts that should be in /scripts in a normal install? I want to compare to see if I'm missing something.
lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

Post by lonecrow »

anyone ? anyone?
khufure
Cacti User
Posts: 203
Joined: Wed Oct 24, 2007 5:47 pm
Location: San Francisco, CA
Contact:

Re: Changing polling interval - now no graphs

Post by khufure »

lonecrow wrote:Then while I was looking through the settings I realized the polling was set to 1 minute!! So I changed that obviously to 5 mins. But I left boost on. The cpu went back down to normal.
All your RRDs are configured for 1 minute interval. presumably your data templates are setup for 1 minute (120s heartbeat). This is not an easy fix.

Can you delete your graphs and create new ones? This would mean you lose your existing data. The other alternative is to dig deep into the internals of RRD and Cacti.

I don't advise this. It may break your install entirely. It worked for me one one cacti server. If you are stuck, be sure to back things up if you do want to try it. Again, I don't recommend it. You are better off archiving your old graphs and creating new ones.

1.) Do not ever change the step of an RRD. Don't do it! Export your data and import it to a new one instead. If you don't know what step is then I guess you weren't going to change it, anyway..

2.) From mysql connection already using your cacti db. You can use 600 here if you want, this is default. I like 1800. It needs to be at least 2x your step, which is usually 300.

Code: Select all

mysql> update data_template_rrd set rrd_heartbeat = 1800 where rrd_heartbeat = 120;
And then you need to fix your RRDs, too. here's a shell script I used. Place this in the $cacti/rra directory, change your rrdtool path, and pray.

Don't forget to match the heartbeat value to what you used above.

Code: Select all

#!/bin/bash
export rrdtool=/usr/local/rrdtool-1.2.27/bin/rrdtool
for rrdfile in `find . -name "*.rrd"`; do
    export DS=`${rrdtool} info ${rrdfile} | grep ds | grep heartbeat | awk -F '=' '{print $1}' | cut -c 4-50 | awk -F ']' '{print $1}'`
    for DATASOURCE in ${DS}; do
        ${rrdtool} tune ${rrdfile} --heartbeat ${DATASOURCE}:1800
        #rrdtool info ${rrdfile} | grep ds | grep heartbeat
    done
done
lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

Post by lonecrow »

I don't mind losing the data it is used for diagnosis and troubleshooting over shorter periods of time. I would rebuild the entire server if I didn't place some other important information in a postgresql database as well there.

Thanks for the information I'll give it a try and report back.

Some of the queries are not working either, which makes things odd.

There should be some sort of warning when you change the polling intervals in Cacti about existing graphs and such maybe..
lonecrow
Posts: 44
Joined: Tue Dec 11, 2007 9:49 am

Post by lonecrow »

Nope didnt work. Nothing will graph properly.. I think I might need to just reload it, since I'musing cactiez its pretty quick. Getting all the postgresql infomation off there that I store as well might be difficult though.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest