我正在尝试设置 RRD,但我似乎无法让数据库存储任何值。
以下是我创建数据库的方式:
rrdtool create test.rrd -s 60 \
DS:local_alloc_procs:GAUGE:10:0:U \
RRA:AVERAGE:0.5:1:10080
我有一个脚本,cron 每分钟运行一次来更新数据库:
* * * * * /home/A01113531/Documents/scripts/Cluster/rrdtool/updatescript
更新脚本:
#!/bin/bash
export LD_LIBRARY_PATH=/home/A01113531/rrdtool/lib:/rc/tools/free/redhat_6_x86_64/moab-7.0.1/lib:/rc/tools/free/redhat_6_x86_64/torque-4.1.2/lib:/rc/tools/free/redhat_6_x86_64/pbs-drmaa-1.0.12/lib:$LD_LIBRARY_PATH
export PATH=/home/A01113531/rrdtool/bin:/rc/tools/free/redhat_6_x86_64/moab-7.0.1/bin:/rc/tools/free/redhat_6_x86_64/torque-4.1.2/bin:/rc/tools/free/redhat_6_x86_64/pbs-drmaa-1.0.12/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH
export MOABHOMEDIR=/rc/moab/server
RRDTOOL='/home/A01113531/rrdtool/bin/rrdtool'
FILE='/home/A01113531/Documents/scripts/Cluster/rrdtool/test.rrd'
COMMAND=$(/home/A01113531/Documents/scripts/Cluster/rrdtool/parser.py -t cluster | grep LocalAllocProcs | awk '{print $2}')
$RRDTOOL update $FILE N:$COMMAND
这是 rrdtool 信息输出的输出:
filename = "test.rrd"
rrd_version = "0003"
step = 60
last_update = 1349364541
header_size = 584
ds[local_alloc_procs].index = 0
ds[local_alloc_procs].type = "GAUGE"
ds[local_alloc_procs].minimal_heartbeat = 10
ds[local_alloc_procs].min = 0.0000000000e+00
ds[local_alloc_procs].max = NaN
ds[local_alloc_procs].last_ds = "1217"
ds[local_alloc_procs].value = NaN
ds[local_alloc_procs].unknown_sec = 1
rra[0].cf = "AVERAGE"
rra[0].rows = 10080
rra[0].cur_row = 3827
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
从这里可以看出,last_ds 得到了一个有效数字,但由于某种原因,值没有从 NaN 更改。
我已经坚持了一段时间了,非常感谢任何帮助或提示。
丹佛