[rrd-users] Second opinion ...

Simon Hobson linux at thehobsons.co.uk
Sat Nov 17 09:25:20 CET 2007

Marc T. Kaplan wrote:

>      I am trying to understand a few things regarding RRD. I was
>started on a project with RRD to average the users across our server
>cluster to check (I guess) that we have balanced the load across the
>system. I am running a RRD that is to update the DS's once a day with
>the returned values of the user polling script.
>     Where I am lost is that I created a RRD that has a step of 36400
>(1 day) and 12 DS's that are set at DS:one:GAUGE:36400:0:1000. The RRA
>is set as AVERAGE:0.5:1:365. If this is correct for setting up the RRD
>for once a day updates and is this normal? If it is then my problems
>are, I guess in the update itself.

Is that a typo - because one day is 86400

>    When I run my script to update the DS's I get ds[one] . last_ds =
>"UNKN" , yet I know there is data being polled, just not injected into
>the RRD. The update is as follows:
>     fileloc="/home/bin/usercount";
>one=$(grep one $fileloc | awk -F': ' '{print $2}'):\
>two=$(grep two $fileloc | awk -F': ' '{print $2}'):\
>three=$(grep three $fileloc | awk -F': ' '{print $2}'):\
>four=$(grep four $fileloc | awk -F': ' '{print $2}'):\
>five=$(grep five$fileloc | awk -F': ' '{print $2}'):\
>six=$(grep six $fileloc | awk -F': ' '{print $2}'):\
>seven=$(grep seven $fileloc | awk -F': ' '{print $2}'):\
>eight=$(grep eight $fileloc | awk -F': ' '{print $2}'):\
>nine=$(grep nine $fileloc | awk -F': ' '{print $2}'):\
>ten=$(grep ten $fileloc | awk -F': ' '{print $2}'):\
>eleven=$(grep eleven $fileloc | awk -F': ' '{print $2}'):\
>twelve=$(grep twelve $fileloc | awk -F': ' '{print $2}'):
>rrdtool update data2.rrd
>Will this even work .... I am not very educated in how RRD works yet
>but I am trying to learn and any help would be appreciated.

It's looks OK. One thing I would do is run this in debug mode (eg 
bash -x myscript) and check that the values are all there. One thing 
I notice is tha you are using 'now' as a time, this means your data 
will always be normalised unless you somehow manage to run the script 
exactly at midnight UTC.

Under these conditions, I'm not sure how many updates you'll need to 
do to have 'known' data returned.

You might find it easier to debug if you accellerate time a bit - eg 
build a test rrd file with (say) 10 minute 'days' (ie sample period 
of 600) so you can quickly feed in multiple updates and see what 

More information about the rrd-users mailing list