rrdtool create test.rrd --step 60 --start N DS:mem:GAUGE:60:U:U RRA:LAST:0.5:12:24 RRA:MAX:0.5:12:24 RRA:MIN:0.5:12:24 RRA:AVERAGE:0.5:12:24
#!/bin/bash
export PATH=/usr/local/rrdtool/bin/rrdtool:/usr/local/rrdtool/bin/rrdtool:/home/parallels/bin:/home/parallels/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$PATH
RRDTOOL='/usr/local/rrdtool/bin/rrdtool'
FILE='test.rrd'
COMMAND=`cat /proc/meminfo | grep MemFree | grep -oE '[0-9]+' | awk '{print $1}'`
$RRDTOOL updatev $FILE N:$COMMAND
echo $COMMAND >> log.txt
0-55/1 * * * * ./get_mem.sh
I tried to run from myself and from root (result is similar)
So, I try to fetch my values:
rrdtool fetch test.rrd AVERAGE -s 1509908400
(all fetch types show -nans)
dump is similar: screen
log.txt (just make sure): screen
What am I doing wrong?
You don't say how many data samples you have added; you'll need at least 13 to have any chance of anything other then NaN in your output.
You definitely have these problems --
I would suggest you create the RRD like this:
rrdtool create test.rrd --step 60 --start N \
DS:mem:GAUGE:120:0:U \
RRA:AVERAGE:0.5:1:24 \
RRA:LAST:0.5:12:24 RRA:MAX:0.5:12:24 \
RRA:MIN:0.5:12:24 RRA:AVERAGE:0.5:12:24