rrdtool 使用最后更新时间作为结束时间创建图形的命令行是什么?
What's the command line for rrdtool to create a graph using the last update time as the end time?
结束这个问题:
似乎可以让 rrdtool 计算 rrd 中最后一次更新的时间戳。如何在命令中使用它作为 "end" 时间?
即我想做这样的事情:
rrdtool graph img.png -a PNG -s e-600 -e LASTUPDATETIME -v "CPU Usage" \
--title "CPU Utilization" DEF:ds0a=node.rrd:ds0:AVERAGE \
DEF:ds1a=node.rrd:ds1:AVERAGE AREA:ds0a#35b73d:"User" \
LINE1:ds1a#0400ff:"System"
我试过 DEF、CDEF 和 VDEF 的问题,但无济于事:
rrdtool graph img.png -a PNG -v "CPU Usage" --title "CPU Utilization" \
DEF:data=node.rrd:x:AVERAGE CDEF:count=data,UN,UNKN,COUNT,IF \
VDEF:last=count,MAXIMUM \
DEF:ds0a=node.rrd:ds0:AVERAGE:start=end-600:end=last \
DEF:ds1a=node.rrd:ds1:AVERAGE:start=end-600:end=last \
AREA:ds0a#35b73d:"User" LINE1:ds1a#0400ff:"System"
这导致:
ERROR: end time: unparsable time: last
有什么想法吗?
在命令行上,你可以做
rrdtool graph img.png -a PNG -s e-600 -e `date +%s node.rrd` -v "CPU Usage" \
--title "CPU Utilization" DEF:ds0a=node.rrd:ds0:AVERAGE \
DEF:ds1a=node.rrd:ds1:AVERAGE AREA:ds0a#35b73d:User \
LINE1:ds1a#0400ff:System
结束这个问题:
似乎可以让 rrdtool 计算 rrd 中最后一次更新的时间戳。如何在命令中使用它作为 "end" 时间?
即我想做这样的事情:
rrdtool graph img.png -a PNG -s e-600 -e LASTUPDATETIME -v "CPU Usage" \
--title "CPU Utilization" DEF:ds0a=node.rrd:ds0:AVERAGE \
DEF:ds1a=node.rrd:ds1:AVERAGE AREA:ds0a#35b73d:"User" \
LINE1:ds1a#0400ff:"System"
我试过 DEF、CDEF 和 VDEF 的问题,但无济于事:
rrdtool graph img.png -a PNG -v "CPU Usage" --title "CPU Utilization" \
DEF:data=node.rrd:x:AVERAGE CDEF:count=data,UN,UNKN,COUNT,IF \
VDEF:last=count,MAXIMUM \
DEF:ds0a=node.rrd:ds0:AVERAGE:start=end-600:end=last \
DEF:ds1a=node.rrd:ds1:AVERAGE:start=end-600:end=last \
AREA:ds0a#35b73d:"User" LINE1:ds1a#0400ff:"System"
这导致:
ERROR: end time: unparsable time: last
有什么想法吗?
在命令行上,你可以做
rrdtool graph img.png -a PNG -s e-600 -e `date +%s node.rrd` -v "CPU Usage" \
--title "CPU Utilization" DEF:ds0a=node.rrd:ds0:AVERAGE \
DEF:ds1a=node.rrd:ds1:AVERAGE AREA:ds0a#35b73d:User \
LINE1:ds1a#0400ff:System