am trying to get the speed and maximum values for all of my interface using rrdtool using rrdtool fetch ... etc but the max value is for the standard time
ex :
rrdtool fetch xxx.rrd MAX -r 7200 -s 1357041600 -e now
i just need to get the highest maximum value for 1 year
Use rrdtool graph VDEF and PRINT without giving any actual graphing commands. This will return the number you are looking for.
Related
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
First. I created a rrd database
$ rrdtool create test.rrd --start 1200000000 --step 300 DS:test_1:GAUGE:600:0:100 RRA:AVERAGE:0.5:1:12
Second. do some updates
$ rrdtool update test.rrd 1200000100:1
$ rrdtool update test.rrd 1200000400:3
$ rrdtool update test.rrd 1200000700:4
$ rrdtool update test.rrd 1200001000:5
Third. fetch data from test.rrd
$ rrdtool fetch test.rrd -r 300 -s 1200000000 -e 1200001000 AVERAGE
Why 1200000300 is 2.333?
This is caused by Data Normalisation. RRDTool will automatically adjust data to fit exactly on the time boundary of the defined Interval.
Although your data are spaced exactly at 300s intervals, the same as your defined Interval (step), unfortunately they are not on the actual boundaries.
The boundary is when time modulo step is equal to zero. In your case, that would be at time 1200000000 and not at 1200000100. Thus, the sample needs to be adjusted (one third of it allocated to the earlier interval, and two thirds to the later). This is further complicated because you are operating in Gauge mode whereas RRDTool works interpolates assuming a linear rate of change of the rate.
If you started your samples at time 1200000300 or at 1200000000 then you would see them stored exactly as given, because the normalisation step would become a null operation. Since you provide a Gauge sample at 1200000100 and 1200000400 , the stored value for 1200000300 will be two-thirds along a line joining the two sample: 1 + ( 3 - 1 ) x 0.666 = 2.333 which is what you are getting.
The tutorial by Alex van den Bogeardt here will explain it all to you.
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 ...
Why values used for updating a rrd are different than the fetches values
I used this for updating: 1353702000:2000
and I got this when I fetch: 1353702000: 1.6666666667e+00
Is there a way to get the number a entered?
Is there a way to format the timestamp and the numbers?
Details:
I created this database:
rrdtool create datafile.rrd DS:packets:ABSOLUTE:900:0:10000000 RRA:AVERAGE:0.5:1:9600 RRA:AVERAGE:0.5:4:9600 RRA:AVERAGE:0.5:24:6000
I updated the database with this timestamp and value:
rrdtool update datafile.rrd 1353702000:2000
I fetch de database with this
rrdtool fetch datafile.rrd AVERAGE -r 90 -s -1h
and I got this
1353700800: nan
1353701100: nan
1353701400: nan
1353701700: 1.6666666667e+00
1353702000: 1.6666666667e+00
1353702300: 3.3333333333e+00
1353702600: 3.3333333333e+00
1353702900: 6.6666666667e+00
1353703200: nan
1353703500: nan
1353703800: nan
1353704100: nan
1353704400: nan
Thanks
use GAUGE as Datastore Type, not ABSOLUTE
The reasons you get these values are twofold.
Firstly, you have type 'ABSOLUTE' for the data, which means that it will be divided by the time since the last update to give a per-second rate. If you want the value stored as-is, use type GAUGE. If the value is constantly increasing - such as with an SNMP network interface packet counter - then use COUNTER to get a rate of change.
Secondly, data normalisation. If the samples are not on the interval boundary (IE, timestamp mod 300 = 0 in this case) they will be adjusted to fit the time. To avoid this, submit the samples with timestamps on the interval boundary.
It seems that rrdtool comes with functionality to query a range of values at a certain resolution. But can I simply query the value for a certain point in time? How?
yes
rrdtool fetch -s $x -e $x+1 demo.rrd AVERAGE
will give you the values for a point in time.