1

请帮忙理解。我在场外找到了关于更新 RRDTool 基础的简单脚本。

但对我来说,需要为所有服务器创建一个 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