2
我想設置一個RRD,但我似乎無法獲得數據庫來存儲任何值。RRDTool:不知道如何更新數據庫
下面是我創建我的數據庫:
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
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改變。
我一直堅持這一段時間了,任何幫助或提示都非常感謝。
丹佛