Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Wed Nov 26, 2014 9:39 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Graphing a rolling average.
PostPosted: Mon May 08, 2006 12:20 pm 
Offline

Joined: Thu May 04, 2006 11:53 am
Posts: 14
I currently have a data source and graph that show the number of SMTP message delivered per second. I would like a graph that shows the number of messages delivered each hour. Is this possible. I looked at teh CDEF's but I have to admit I am kind of a new to Cacti.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 08, 2006 3:11 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Create a CDEF that looks like
Code:
cdef=CURRENT_DATA_SOURCE,3600,*
to multiply the current data source by 60*60 (seconds * minutes). Apply this new CDEF to the graphed items and the legends as well
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 08, 2006 5:34 pm 
Offline

Joined: Thu May 04, 2006 11:53 am
Posts: 14
Does that average out the last hour or just take the current value times 3600?

I don't think I explained myself very well. What I am looking for is a graph with the granularity of 1 hour.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 1:29 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Oops, I misunderstood. My CDEF will make the results read as "per hour" data instead of "per second".
So you want to poll and display not at standard 5 min interval but at 60 min interval? Or do you want to collect data still every 5 mins but average them out? Or do you want to have TREND information (introduced with rrdtool 1.2.x)?
The TREND thingy is easy, the rest can be done as well but requires some more planning
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 10:12 am 
Offline

Joined: Thu May 04, 2006 11:53 am
Posts: 14
Once again I hav e to admit my ignorance. I wanted to still collect the data every 5 minutes but wanted to average it out. I guess my confusing is coming from the TREND information you are talking about. I am not 100% what the difference is between an average and a trend. Thanks for your continued patient.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 11:52 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
The AVERAGE is computed by rrdtool automatically when "consolidating" data. E.g. rrdtool takes 6 values, adds them and divides them by 6. For the given timespan, this AVERAGE is the only value stored in the rrd file (e.g. covering 2 h).
The TREND is computed every 5 minutes (assuming standard rra definitions) and takes into account a configurable timespan of historical data (e.g. 30 minutes). The resulting value is printed into the graphs but not stored in the database.
Perhaps I'll post a screenshot this week
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 12:39 pm 
Offline

Joined: Thu May 04, 2006 11:53 am
Posts: 14
Thanks, that helps me understand the difference prefectly. How do I add the TREND line? I looked at the functions and I saw MIN, MAX, and Average.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 9:32 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Find example attached for Traffic Graph Template
The black LINE1 is TRENDed Traffic In/Out, respectively
The TREND CDEF for positive values works quite the same way (substitue -8 by 8 does the trick)
Reinhard


Attachments:
File comment: TREND in action
TREND.jpg
TREND.jpg [ 81.7 KiB | Viewed 3797 times ]
File comment: The Graph Template
Traffic.jpg
Traffic.jpg [ 204.84 KiB | Viewed 3797 times ]
File comment: The CDEF
(multiplying by 8 necessary for Bytes to Bits conversion only)

TREND-CDEF.jpg
TREND-CDEF.jpg [ 110.73 KiB | Viewed 3797 times ]

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 11:07 am 
Offline

Joined: Thu May 04, 2006 11:53 am
Posts: 14
Thanks again Mr lvm. :) hopefully I will be able to get a better understanding of Cacti and start helpling out instead of just asking questions?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 2:02 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Thank you for the flowers. But I learned this from the forums some months ago :wink:
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 08, 2008 8:16 pm 
Offline
Cacti User

Joined: Mon Mar 10, 2008 6:52 pm
Posts: 228
Location: Australia
Hmm, this is cool, but not without flaws.

Hourly is too fine to be useful for my graph of numbers of wireless users, so I want to see a moving 24 hour average.

The CDEF works but seems to break whenever you are displaying less than 24 hours worth of data, or rather not displaying more than 24 hours worth of data. So even on the daily graphs the moving average is not drawn.

Also when in list mode it seems to be broken for any of the time presets given.

Can anyone think of a workaround? I am considering creating a new data source that stores the moving average, then the value will be printable at any resolution.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 3:41 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
TREND was changed somehow in rrdtool 1.3.x
I did not yet check it out, I only saw this on rrdtool-users mailinglist.
Your first problem, not seeeing a 24h trend on a 24h graph is easily explained: The first trend is graphed only after an initial gap of TREND length.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 6:05 pm 
Offline
Cacti User

Joined: Mon Mar 10, 2008 6:52 pm
Posts: 228
Location: Australia
gandalf wrote:
TREND was changed somehow in rrdtool 1.3.x
I did not yet check it out, I only saw this on rrdtool-users mailinglist.
Your first problem, not seeeing a 24h trend on a 24h graph is easily explained: The first trend is graphed only after an initial gap of TREND length.
Reinhard


Yes, you can workaround this by changing your CDEF to 24 hours less one poller period.

There is a new TRENDNAN in rrdtool to ignore NANs and still calculate the trend, but perhaps you mean something else? I'll have a look at that list.

cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group