1

理解するのを手伝ってください。RRDTool ベースの更新に関する簡単なスクリプトをオフサイトで見つけました。

しかし、私にとっては、すべてのサーバーに対して 1 つの rrd ベースを作成する必要があります。最善の方法を理解し、これを行う方法をいくつか教えてください。すべてのサーバーからデータを rrdtool ベースに送信して更新しますか? または、サーバーからすべてのデータを取得して、rrdtool をローカル レベルで更新しようとしますか?

 #!/bin/sh
 a=0
 while [ "$a" == 0 ]; do
 snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
     total_mem=`awk 'BEGIN {tot_mem=0}
                           { if ($NF == "KBytes")
                             {tot_mem=tot_mem+$(NF-1)}
                           }
                     END {print tot_mem}' snmp_reply`
     # I can use N as a replacement for the current time
     rrdtool update target.rrd N:$total_mem
     # sleep until the next 300 seconds are full
     perl -e 'sleep 300 - time % 300'
 done # end of while loop
4

0 に答える 0