RRDTOOL and custom data - rrdtool

I'm trying to use rrdtool to make some graphs. But it's not working as i wanted...
Here is the situation:
I have a file with data that are collected every 30 seconds but i can access this file only the day after. For example if i want to graph Tuesday data, i have to wait Wednesday morning.
So what i have done is to create a new database with these information:
rrdtool create filename.rrd --step '30' 'DS:t634:GAUGE:60:U:U' 'RRA:AVERAGE:0.5:1:1000'
collected data:
rrdtool update filename.rrd 1390231080:1
rrdtool update filename.rrd 1390231110:2
rrdtool update filename.rrd 1390231140:3
rrdtool update filename.rrd 1390231170:4
....
generated a graph:
rrdtool graph 'graph.png' --width '400' --height '100' 'DEF:T634=filename.rrd:t634:AVERAGE' 'LINE1:T634#0000FF:T634'
I have a graph with no line on it...
Is my rrd file creation false?
Thanks in advance for your help!

Your 'rrdtool graph' call does not specify a start and end time for the graph. The default is a 1day graph from the current time. If the data are historical, the most recent data point may be outside the default graph time window. Specify a start and end time point in your graph request.
You can verify that the data are in the RRD by using an 'rrdtool fetch' request.

I figured out the problem... There was too few data in the file and the graph offset time was too high...
Thanks a lot for your help!

Related

Check_Mk RRD File Average Value Mismatch

I am trying to pull the data from the Check Mk server RRD File for CPU and Memory. From that, am trying to find the MAX and Average value for the particular Host for 1 month period. For the maximum value, I have fetched the file from the Check_mk server using the RRD fetch command and I get the exact value when I compared the output in the check_mk graph but when I try to do the same for the Average value I get the wrong output which does not match the Check_mk graph value and RRD File raw value. Kindly refer to the attached images where I have verified the value for average manually by fetching the data but it shows the wrong output.
Hello #Steve shipway,
Please find the requested data.
1)Structure of RRD File. Attached the image.
2)We are not generating the graph from the Check_mk . We are generating the RRD File using rrdtool dump CPU_utilization.xml > /tmp/CPU_utilization1.xml rrdtool fetch CPU_utilization_user.rrd MAX -r 6h -s Starting Date-e ending date.
Share
enter image description here

How to understand --step option in RRD?

Am I correct that value of --step option is used solely for pre-calculating the data slots in RRD? Or does RRD somehow expect updates with interval specified with --step?
RRDtool will 're-sample' the data you provide to be in --step interval before continuing to process it. You can deliver as many updates as you wish. RRDtool will take them all into account when building the --step interval.

Can rrdtool store data for metrics, list of which changes over time, like, for example, top 10 processes consuming CPU?

We need to create a graph with top 10 items, which will change from time to time, for example - top 10 processes consuming CPU or any other top 10 items, we can generate values for on the monitored server, with possibility to have names of the items on the graph.
Please tell me, is there any way to store this information using rrdtool?
Thanks
If you want to store this kind of information with rrdtool, you will have to create a separate rrd database for each item, update them accordingly and finally generate charts picking the 10 'top' rrd files ...
In other words, quite a lot of the magic has to happen in the script you write around rrdtool ... rrdtool will take care of storing the time series data ...

RRDTool database definition and plotting the data -I need a second opinion

Here is what I am trying to achieve:
I read my data once a day (the exact time of the day is not very important).
I want to archive the values for this DS for two years back.
I need to be able to look back for 2 years and I need the value for every day
and I also need to see the weekly average
If I miss a reading for two consecutive days the data should be declared unknown
Here is what I am using for this:
rrdtool create Carsforsale.rrd --start 20130217 --step 86400 ^
DS:MidsizeCars:GAUGE:172800:U:U ^
DS:FullSizeCars:GAUGE:172800:U:U ^
RRA:AVERAGE:0:7:104^
RRA:LAST:0:7:1:720
I updated the above database with
rrdtool update Carsforsale.rrd 1361203200:554:791
rrdtool update Carsforsale.rrd 1361289600:556:795
The updated correspond to yesterday and the day before yesterday (18, 19 Feb)
I tried to plot the graphs for the above using this
rrdtool graph "Inventory.png" \
--start "20130217" \
--imgformat PNG --width 850 --height 400 \
DEF:MidsizeCars=Carsforsale.rrd:MidsizeCars:AVERAGE \
DEF:FullSizeCars=Carsforsale.rrd:FullSizeCars:AVERAGE \
AREA:MidsizeCars#0000FF:"MidsizeCars" \
AREA:FullSizeCars#FF004D:"FullSizeCars:STACK"'
And now here are the my questions:
are the step and the heart beat defined correctly for what I wantto do ?
Why are my graphs empty ?
Looking into the database with the freeware utility called RRD Editor I could see that the last values are stored in the MidSizeCars and FullSizecars but the only DS that contains a history of what has been loaded into the database is the archiving function LAST Am I supposed to plot LAST or Average to see the current values ?
Thanks
C
since you want to keep the data for two years at 1 day resolution, you have to setup an appropriate RRA for this purpose ... since this will only be about 730 values, I would not bother with setting up an extra consolidated RRA for the week. this will get calculated on the fly ...

rrdtool graph slightly different graph

First I will say that even after setting up a system where I register the each minute total of http responses (200, 301, 302, etc) and I'm able to know how is going on the performance speaking about users, it happens to me that my boss is getting me mad with something that i thing it is related with rrd internals, but supossedly i must solve that.
What I do with the rrdtool?:
After a minute (60 seconds) summarizing different http responses i insert the value with the time stamp into the rrd database.
This is the rrd file definition:
/usr/bin/rrdtool create file.rrd --start $_[7]-60 --step 60 DS:200:GAUGE:120:U:U DS:300:GAUGE:120:U:U DS:400:GAUGE:120:U:U DS:404:GAUGE:120:U:U DS:500:GAUGE:120:U:U DS:502:GAUGE:120:U:U DS:504:GAUGE:120:U:U RRA:AVERAGE:0.5:1:43200
As you can see in the RRA i save 43200 which means two week saving 60 seconds values.
The problem it comes when i draw, this is the command I use to draw the graph of the last 6 hours (Where $start is the start time, $time the end time and $rrd the rrd file)
{/usr/bin/rrdtool graph last6hours.png --units=si --alt-y-grid --start $start --end $time -o -S 60 --width 600 --height 200 --imgformat PNG DEF:200=$rrd:200:AVERAGE LINE1:200#006666:"200" DEF:300=$rrd:300:AVERAGE LINE1:300#FF00CC:\"301+302\" DEF:400=$rrd:400:AVERAGE LINE1:400#000000:\"400\" DEF:404=$rrd:404:AVERAGE LINE1:404#6666CC:\"404\" DEF:500=$rrd:500:AVERAGE LINE1:500#00FF66:\"500\" DEF:502=$rrd:502:AVERAGE LINE1:502#FF0000:\"502\" DEF:504=$rrd:504:AVERAGE LINE1:504#FF9900:\"504\";}
And this is the one I use to draw the las 12 hours:
{/usr/bin/rrdtool graph last12hours.png --units=si --alt-y-grid --start $start --end $time -o -S 60 --width 600 --height 200 --imgformat PNG DEF:200=$rrd:200:AVERAGE LINE1:200#006666:"200" DEF:300=$rrd:300:AVERAGE LINE1:300#FF00CC:\"301+302\" DEF:400=$rrd:400:AVERAGE LINE1:400#000000:\"400\" DEF:404=$rrd:404:AVERAGE LINE1:404#6666CC:\"404\" DEF:500=$rrd:500:AVERAGE LINE1:500#00FF66:\"500\" DEF:502=$rrd:502:AVERAGE LINE1:502#FF0000:\"502\" DEF:504=$rrd:504:AVERAGE LINE1:504#FF9900:\"504\";}
And now please look at the draws and see that into the first graph inside the red circle there's a descend of the responses 200 until 0, but into the graph of the last 12 hours the same descend it does not go until 0, so my boss is pressing me saying that the data is not real when it is, but the worst if that i know is real and is about rrdtool internals, but I doon't know how to solve it.
Any subjestion please?
this change is due to the fact that rrdtool is consolidating data, adapting it to the resolution of the chart you are drawing. Your initial chart shows high resolution data while the second chart covers a wider time range and thus shows several data points wrapped into one. consider the following:
original: 10,10,10,0,10,10
consolidated 2 to 1: 10,5,10
If you want to preserve extremes, you should setup a MIN and MAX RRA and use that for charting the extremes.
hth
tobi