Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Hack job to put stuff into RRD
- # TH 20121212 v0.1
- cd /usr/local/sbin/proxy-stats/
- #define array of servers and objects we are collecting
- servers=(10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4)
- while(true) ;do
- for i in ${servers[@]}; do
- stats=`curl -s http://255.255.255.253/mwgstats -x $i:80|grep URL\'s|egrep -o [0-9].*`
- echo $stats |awk -v host=$i '{system ("rrdtool update "host".rrd N:"$1":"$2":"$3":"$4":"$5":"$6":"$7":"$8":"$9":"$10":"$11":"$12 )}'
- done
- sleep 300
- echo `date` >/var/log/mwg.log
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement