RRDTool獲取數據筆記

rrdtool update 語法    
rrdtool update filename [--template|-t ds-name[:dsname]...] N|timestamp:value[:value...]
filename RRD數據庫文件名稱
--template|-t ds-name[:ds-name] 要更新RRD數據庫中數據源的名稱,其中-t指定數據源的順序
N|timestamp:value[:value...] 時間:要更新的值,N表示當前時間。

案例:

rrdtool update test.rrd N:123456


可以利用bash腳本的RANDOM自動生成隨機數

#!/bin/bash
#
while true;do
        rrdtool update test.rrd N:$RANDOM
        sleep 5s
done


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章