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