Xymon Mailing List Archive search

CPU Graphs

4 messages in this thread

list James Wade · Tue, 6 Mar 2007 16:01:58 -0600 ·
Hello All,

 
I raised a question a month ago about less averaging

on the CPU graph. 

 
In the hobbitclient-sunos.sh I changed the vmstat to

take 15 second samples.

 
I have another question, Does the graph view average

the datapoints as well? Can I have it give me just the

raw datapoints in the graph?

 
Thanks.James
list Henrik Størner · Tue, 6 Mar 2007 23:10:52 +0100 ·
quoted from James Wade
On Tue, Mar 06, 2007 at 04:01:58PM -0600, James Wade wrote:
I raised a question a month ago about less averaging
on the CPU graph. 

In the hobbitclient-sunos.sh I changed the vmstat to
take 15 second samples.
That won't change anything, unless you also re-created the "vmstat.rrd"
files by hand and changed the RRD "step" setting so it knows that
updates appear with 15 second intervals. If you haven't, the extra
measurements are simply ignored.
quoted from James Wade
I have another question, Does the graph view average
the datapoints as well? Can I have it give me just the
raw datapoints in the graph?
RRD never stores raw datapoints - it is always normalized. You cannot
really feed updates to Hobbit or the RRD files at *exactly* the interval
you should; there will always be a slight jitter - maybe the interval
between two updates are 14.5 seconds, or 15.3 seconds, or even 17
seconds (if your system is busy). RRDtool therefore takes your data
and calculates what it would have been if you had been feeding the
update at exactly 15 second intervals - and this calculated value is the
one that is stored in the RRD file. See the "RRD Tutorial" at the RRD
website, http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html
The paragraph titled "Data Resampling" explains this.

And no, the graph view doesn't process the data in any way - all of that
is handled by RRDtool when the data is stored in the RRD file.


Henrik
list James Wade · Tue, 6 Mar 2007 16:27:57 -0600 ·
See below
quoted from Henrik Størner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Tuesday, March 06, 2007 4:11 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] CPU Graphs

On Tue, Mar 06, 2007 at 04:01:58PM -0600, James Wade wrote:
I raised a question a month ago about less averaging
on the CPU graph. 

In the hobbitclient-sunos.sh I changed the vmstat to
take 15 second samples.
That won't change anything, unless you also re-created the "vmstat.rrd"
files by hand and changed the RRD "step" setting so it knows that
updates appear with 15 second intervals. If you haven't, the extra
measurements are simply ignored.

--- Henrik, Can you point me in the direction of a "How To" on this,
So, I need to recreate the vmstat.rrd, but where or how do I change
the RRD "step" setting?  Is there a way to keep the old
data? 

Thanks for all the Help...James
list Henrik Størner · Wed, 7 Mar 2007 07:57:24 +0100 ·
quoted from James Wade
On Tue, Mar 06, 2007 at 04:27:57PM -0600, James Wade wrote:
Henrik, Can you point me in the direction of a "How To" on this,
So, I need to recreate the vmstat.rrd, but where or how do I change
the RRD "step" setting?  
You need to use the "rrdtool create" command to create a new RRD file
for your vmstat data. The "step" setting is one of the options for
this command.

Start by running "rrdtool info "~hobbit/data/rrd/SOMEHOST/vmstat.rrd",
this will dump all a long stream of data about how this rrd file is
setup. It goes like this:

   filename = "/var/lib/hobbit/rrd/localhost/vmstat.rrd"
   rrd_version = "0003"
   step = 300
   last_update = 1173248932
   ds[cpu_r].type = "GAUGE"
   ds[cpu_r].minimal_heartbeat = 600
   ds[cpu_r].min = 0.0000000000e+00
   ds[cpu_r].max = NaN
   ds[cpu_r].last_ds = "UNKN"
   ds[cpu_r].value = 0.0000000000e+00
   <snip lots more "ds" lines>
   rra[0].cf = "AVERAGE"
   rra[0].rows = 576
   rra[0].pdp_per_row = 1
   rra[0].xff = 5.0000000000e-01
   rra[0].cdp_prep[0].value = NaN
   rra[0].cdp_prep[0].unknown_datapoints = 0
   <snip lots more "rra" lines>

The "step" value is the interval between updates - this is the one
you want to change from "300" to "15".

The "ds" lines are the various data sets stored in the RRD file; some
RRD files only have one dataset, but vmstat has a lot. 

The "rra" lines define how the data is "consolidated", i.e. how 
granular you want your data as you go further back in time.


To create the RRD file, you must run a command like this:

   rrdtool create vmstat.rrd \
      --step 15 \
      DS:cpu_r:GAUGE:60:0:U \
      <more DS lines, one for each dataset> \
      RRA:AVERAGE:0.5:1:11520 \
      RRA:AVERAGE:0.5:20:2016 \
      <more RRA lines>

You build the "DS" lines from the rrdtool info "ds" data.
"cpu_r" is the dataset name, from the"ds[cpu_r]". "GAUGE"
is the "type" of the dataset. "60" is the "minimal_heartbeat",
which is usually a multiple of the "step" setting. It means that 
you must feed data into the RRD file at this interval for RRD
to regard the data as valid. "0" and "U" are the "min" and "max"
values for the dataset.

The "RRA" lines - "AVERAGE" is the "cf" value from the rrdtool info.
"0.5" you shouldn't change. "1" and "11520" are the "pdp_per_row"
and "rows" settings, and these must change. These two basically mean
that you will be storing "rows" data values, with a resolution of
(pdp_per_rows x step) granularity. So if the RRA is
      RRA:AVERAGE:0.5:1:11520
then you will use 1 reading (pdp) per dataitem you store - so this RRA
holds data with your 15 second interval - and you will store 11520
data values - which is equivalent to 15x11520 = 2 days of data. When you
go further back than the first 2 days, you will be seeing data from the
other RRA's, e.g. the next one
      RRA:AVERAGE:0.5:20:2016
uses 20 pdp's per value stored in the RRA, so each value from this RRA
is an average over 20 readings of data = (20 x 15) = 5 minute average 
value. Here I've chosen to store 2016 of these 5-minute averages, which 
is enough for 2016 x 5 minutes = 7 days.

You can build these RRA definitions any way you like, rrdtool will
automatically update all of them with the data that is fed into the
RRD file, and the graphs will automatically use the best RRA when you
view them.
Is there a way to keep the old data? 
Not automatically.


Regards,
Henrik