# [rrd-users] I need help with my rrd file

Andy Riebs andy.riebs at hp.com
Mon Sep 29 15:57:50 CEST 2008

```OK,

A few more problems here...

1. It's a good bet that the following isn't doing what you think it is:

>  a=0
>  while [ \$a!=0 ]; do

You probably meant to do

a=1
while [ \$a -ne 0 ]; do

Though I will concede that the following would also work:

a=1
while [ \$a !=  0 ]; do

or
a=0
while [ \$a = 0 ]; do

2. You appear to have the rrd set up for 300 second (5 minute) intervals;
for how long are you collecting your samples?  There are a couple of
conditions that you'll have to meet before useful results are available.

Consider the following times, in order, given your loop:

a. First sample is taken
b. First time()%300 threshold is passed; the
start of a measurement interval begins
c. Second time()%300 threshold is passed
d. Another sample is taken, rrd can now determine
the value for the interval from (b) to (c)

So, given your loop with samples every 30 seconds, it could take nearly 11
minutes before a single result can be reported:
- The interval between (a) and (b) could be as
much as 299 seconds
- The interval between (b) and (c) will be
exactly 300 seconds
- The interval between (c) and (d) could be as
much as 30 seconds

Make sense?
/andy

On Monday 29 September 2008 09:19:07 am alucard95 wrote:
> So, this is the final script which is running :
>
>  #!/bin/sh
>  a=0
>  while [ \$a!=0 ]; do
> input=\$(snmpget -Oqv -v2c -c public xxx.xxx.xxx.xxx
> 1.3.6.1.2.1.2.2.1.10.4)
>
> output=\$(snmpget -Oqv -v2c -c public xxx.xxx.xxx.xxx
> 1.3.6.1.2.1.2.2.1.16.4)
>
> echo \$input:\$output
>
> # I can use N as a replacement for the current time
> \$(rrdtool update /home/zabbix/switch.rrd N:\$input:\$output)
>
> # sleep 30 seconds
> sleep 30
>
> # end of while loop
> done
>
> the result of the echo is good, but the last problem (i hope :-() is
> when i do a rrd fetch, the result is :
>
> 1222693200: nan nan
> 1222693500: 0.0000000000e+00 0.0000000000e+00
> 1222693800: 0.0000000000e+00 0.0000000000e+00
> 1222694100: nan nan
>
> why it is not the good number??
> --
> View this message in context:
> http://n2.nabble.com/I-need-help-with-my-rrd-file-tp1120359p1125793.htm
>l Sent from the RRDtool Users Mailinglist mailing list archive at
> Nabble.com.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

--
Andy Riebs,  HP Scalable Computing and Infrastructure / Linux R&D
(w) andy.riebs at hp.com     Technology for better business outcomes
+1 (978) 748-0043 (Mon,Thu,Fri)
+1 (508) 467-3002 (Tue,Wed)
(h) andy at candooz.com  My opinions are not necessarily those of HP

```