Problem with Counters and data from script

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

Moderators: Developers, Moderators

Post Reply
bubble1975
Posts: 6
Joined: Fri Oct 05, 2007 10:23 pm

Problem with Counters and data from script

Post by bubble1975 »

Greetings all!

I've got this weird problem... I have a script generating a number every five minutes that cacti polls, and I want the number to be graphed as a counter. i.e. the number is 50000 one minutes, then 5 minutes later, it is 150000, so I want the graph to show 100000 for that polling period, using counters, such that if it stays at 150000 the next 5 minutes the graph will show 0 because there was no incrementation on the counters. The data source and graph template have "counter" selected as data type instead of "gauge".

I got the script working fine, but when the number increments by 100000, the graph only shows a value of like 130 during that polling period. So it knows something happened but is reporting the wrong number. I double checked the real number posted by my script and it was correct, so it's not the script... Can anyone think of a reason why this might be happening?

Thanks so much in advance!

-bubble

PS- I can post any configuration necessary if anyone thinks it will help diagnose the problem.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please be aware that rrdtool COUNTER always stores rates, see http://www.vandenbogaerdt.nl for more explanation. So you have to use a CDEF=CURRENT_DATA_SOURCE,300,* to retrieve the "old" value if you want to graph a "per 5 minute" rate instead of a "per second rate"
Reinhard
bubble1975
Posts: 6
Joined: Fri Oct 05, 2007 10:23 pm

Post by bubble1975 »

Thanks, that's just what I needed, worked like a charm. I changed the CDEF value on the graph item to "Make per 5 minutes" and that fixed it!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests