Re: How to create a new Data Type and Consolidation Function?

Long <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Hi Tobi, Steve,

Thanks for answering so fast !

I'll use real rrdtool command with real parameters to illustrate my case to
make sure we all understand what I need. Hopefully we can come up with a
less complicated solution than creating a new Data Type and CF.

This is the "rrdtool create" command generated by Cacti from my configured
step size and retention period (rows):
/usr/bin/rrdtool create \
/path/file.rrd \
--step 60  \                      # polling every minute
DS:ds_name:COUNTER:120:0:U \
RRA:AVERAGE:0.5:1:2160 \          # RRA_1: 1 min average (1 step), 1.5 days
retention (2160 rows)
RRA:AVERAGE:0.5:5:2310 \          # RRA_2: 5 min average (5 steps), 8 days
retention (2310 rows)
RRA:AVERAGE:0.5:30:2020 \         # RRA_3: 30 min average (30 steps), 6
weeks retention (2020 rows)
RRA:AVERAGE:0.5:60:9380 \         # RRA_4: 1 hour average (60 steps), 13
months retention (9380 rows)
RRA:AVERAGE:0.5:720:1475 \        # RRA_5: 12 hours average (720 steps), 2
years retention (1475 rows)

For each of the RRA specified, Cacti will create different corresponding
"rrdtool graph" command (see at end). So I need a SUM-CF for each level of
consolidation, not a total for a whole day/week/month period (not a total
for the range of the produced graph).

Cacti simply generate a graph command for each RRA (see at end). As I zoom
in and out, Cacti simply re-generate the time range. The graph has to be
generated by RRDTool. So I can not hardcode any "multiply-back" value using
a CDEF (example multiple count/sec stored by 300 sec to get to total per 5
mins) because the zoom-in ranges are all dynamic by the viewer of the graph.

So my original idea to achieve what I need is to create a new Data Type that
has input COUNTER and stored the calculated value as difference (curr_val -
prev_val) and not as rate (curr_val - prev_val / step_size). Also create a
SUM CF that will add all the differences (PDP).

I am open for any other suggestions as I am clearly not expert at RRDTool
yet.

Here's the corresponding "rrdtool graph" command generated by Cacti:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-604800 \                 # This range is associated to RRA_3, at
this level of Consolidation, I want the total for each 30 mins, i.e
count/sec stored multiply by 60s*30steps
--end=-1800 \
--title=' title ' \
--rigid \
--base=1000 \
--height=150 \
--width=600 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='Count' \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/path/file.rrd":ds_name:AVERAGE \
AREA:a#96E78AFF:"Volume"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" 

--start=-14400 \                # This range is associated to RRA_1, at this
level of Consolidation, I want the total for each 1 mins, i.e count/sec
stored multiply by 60s*1steps
--end=-60 \

--start=-86400 \                # This range is associated to RRA_2, at this
level of Consolidation, I want the total for each 5 mins, i.e count/sec
stored multiply by 60s*5steps
--end=-300 \

--start=-2678400 \              # This range is associated to RRA_4, at this
level of Consolidation, I want the total for each 1 hour, i.e count/sec
stored multiply by 60s*60steps
--end=-3600 \ 

--start=-33053184 \             # This range is associated to RRA_5, at this
level of Consolidation, I want the total for each 12 hours, i.e count/sec
stored multiply by 60s*720steps
--end=-43200 \ 


Thanks,
Long
-- 
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/How-to-create-a-new-Data-Type-and-Consolidation-Function-tp5990330p5993380.html
Sent from the RRDtool Developers Mailinglist mailing list archive at Nabble.com.

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.