还可以通过http://mrtg.askwan.com/server-status?auto 获得一个面向机器可读的状态文件,这个也是本文脚本所需要的
这个将得到如下信息
Total Accesses: 129248
Total kBytes: 299497
CPULoad: 17.7033
Uptime: 1402
ReqPerSec: 92.1883
BytesPerSec: 218748
BytesPerReq: 2372.84
BusyWorkers: 246
IdleWorkers: 54
Scoreboard: _KK_K_KKKCKCK__K_KK_CCKCKK_KKKKKK_K_KKK
脚本:
下载文件 (已下载 119 次)
点击这里下载文件: apache.mrtg.zip
Target[askwan-apache1]: `/web/mrtg/bin/apache.mrtg.pl -url http://mrtg.askwan.com/server-status?auto -info BUSYSERVERS`
Options[askwan-apache1]: noo,gauge
Background[askwan-apache1]: #738AA6
Xsize[askwan-apache1]: 600
Ysize[askwan-apache1]: 200
Ytics[askwan-apache1]: 10
Title[askwan-apache1]: Busy Servers
PageTop[askwan-apache1]: <H1>Apache: Busy Servers</H1>
MaxBytes[askwan-apache1]: 20
YLegend[askwan-apache1]: BusyServers
ShortLegend[askwan-apache1]: BServers
Legend1[askwan-apache1]: Busy Workers
Legend3[askwan-apache1]: Workers Alive
LegendI[askwan-apache1]: BWorkers:
[img][attach]123[/attach][/img]
将target替换
/web/mrtg/bin/apache.mrtg.pl -url http://mrtg.askwan.com/server-status?auto -info BYTESPERREQ
/web/mrtg/bin/apache.mrtg.pl -url http://mrtg.askwan.com/server-status?auto -info CPULOAD
/web/mrtg/bin/apache.mrtg.pl -url http://mrtg.askwan.com/server-status?auto -info SERVERS
/web/mrtg/bin/apache.mrtg.pl -url http://mrtg.askwan.com/server-status?auto -info IDLESERVERS
并修改相关值 可以得到apache的各种状态信息