[rrd-users] Fwd: only getting nan values
Jim Sher
rrdtool at blyzz.com
Thu May 26 13:59:33 CEST 2016
Hey Simon,
Thanks for your feedback.
RRD creating scripts here: *(NOTE! I've been chopping and changing the
scripts since yesterday when I composed the original email I sent earlier
to see if I could jiggle something loose :-) - no luck so far)*
>
> *#! /bin/bash*
>
>
>
>
>
> *rrdtool create data.rrd \--step '60' \'DS:datadown:COUNTER:120:0:U'
> \'DS:dataup:COUNTER:120:0:U' \'RRA:AVERAGE:0.5:1:2160'
> \'RRA:AVERAGE:0.5:60:14400' \'RRA:AVERAGE:0.5:1440:1825'*
>
>
>
>
>
>
> *#! /bin/bashrrdtool create load.rrd --start N --step 300
> \DS:load:GAUGE:1200:0.0:4.0 \RRA:AVERAGE:0.5:5m:10d \RRA:AVERAGE:0.5:1h:45d
> \RRA:AVERAGE:0.5:1d:5y \*
>
>
>
>
>
>
>
> *#! /bin/bashrrdtool create mem.rrd --start N --step 300
> \DS:mem:GAUGE:1200:0:100 \RRA:AVERAGE:0.5:5m:10d \RRA:AVERAGE:0.5:1h:45d
> \RRA:AVERAGE:0.5:1d:5y \*
>
>
>
>
>
>
> * #! /bin/bashrrdtool create pitemp.rrd --start N --step 300
> \DS:pitemp:GAUGE:1200:U:U \RRA:AVERAGE:0.5:5m:10d \RRA:AVERAGE:0.5:1h:45d
> \RRA:AVERAGE:0.5:1d:5y \*
>
And the relevant line o) my Crontab here:
** * * * * /usr/local/bin/system/getStats.sh*
>
As you can see I've changed it from 5 minutes to 1 minute.
Also I've changed the update script to include full path (because of cron):
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *#! /bin/bashLOAD=`cat /proc/loadavg | awk '{print $1}'`RXBYTES=`cat
> /sys/class/net/eth0/statistics/rx_bytes`TXBYTES=`cat
> /sys/class/net/eth0/statistics/tx_bytes`TEMP=`/opt/vc/bin/vcgencmd
> measure_temp|cut -c6-9`MEM=`free -b | grep Mem | awk '{print $4/$2 *
> 100.0}'`/usr/bin/rrdtool update /usr/local/bin/system/load.rrd
> N:$LOAD/usr/bin/rrdtool update /usr/local/bin/system/data.rrd -t
> datadown:dataup N:$RXBYTES:$TXBYTES/usr/bin/rrdtool update
> /usr/local/bin/system/pitemp.rrd N:$TEMP/usr/bin/rrdtool update
> /usr/local/bin/system/mem.rrd N:$MEMecho $LOADecho $RXBYTESecho
> $TXBYTESecho $TEMPecho $MEM*
>
As for rrdtool fetch, I can't seem to get the syntax to get any results
right :-(
Regards,
Jim
On 26 May 2016 at 12:20, Simon Hobson <linux at thehobsons.co.uk> wrote:
> Jim Sher <rrdtool at blyzz.com> wrote:
>
> > I'm using cron to run a script every 5 minutes to get some values and
> update the RRD files and then draw the graphs.
> > My script to populate the RRAs in the RRD:
> <snip>
> > But when I view the graphs (all of them are like the one below), all the
> values are not numbers (nan).
>
> Two common problems :
>
> 1) How long did you let your collection script run for ? One update is
> *NOT* sufficient to create any known values in the database.
>
> 2) Post the commands used to create the RRD files. A common mistake is to
> make heartbeat only 300s and update "every 5 minutes". "Every 5 minutes"
> often isn't "every 300s", especially when using "N" as the timestamp. If
> two updates are 301s apart, a heartbeat of 300s means "unknown" data will
> be stored.
>
> Try "rrdtool fetch" to see what's stored in the database - it's easier
> than trying to work out if it's the data or the graphing that's causing the
> problem.
>
> For reference, see http://rrdtool.vandenbogaerdt.nl
> In particular, "Rates, normalizing and consolidating" should make things a
> lot clearer.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20160526/6f9e0f5c/attachment.html>
More information about the rrd-users
mailing list