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
我试图从我自己和root中运行(结果类似)
所以,我尝试获取我的值:
rrdtool fetch test.rrd AVERAGE -s 1509908400
(所有获取类型显示-nans)
转储类似:screen
log.txt(只需确保):screen
我做错了什么?
答案 0 :(得分:0)
您不会说您添加了多少数据样本;你的输出中至少需要13个才能获得NaN以外的任何东西。
你肯定有这些问题 -
我建议您像这样创建RRD:
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