支持对服务器各种状态的
下面本人步骤,仅供参考!
squid安装完后,在mrtg配置中将/usr/local/squid/share/mib.txt载入
引用
cp /usr/local/squid/share/mib.txt /etc/mrtg/squid.mib
在mrtg配置文件mrtg.cfg文件中加入:
LoadMIBs: /etc/mrtg/squid.mib
并在squid配置文件中合适位置加入
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic all
【本文实现环境为内网中,严格的说,公网的话,很不安全,还是修改一下默认public 和all!】在/etc/mrtg/mrtg.cfg中加入:
Target[askwan-cache1]: cacheHttpHits&cacheServerRequests:public@192.168.1.217:3401
RouterName[askwan-cache1]: cacheUniqName
MaxBytes[askwan-cache1]: 100000
Title[askwan-cache1]: HTTP Hits
PageTop[askwan-cache1]:
Cache Statistics: HTTP Hits/Requests
Suppress[askwan-cache1]: y
LegendI[askwan-cache1]: HTTP hits
LegendO[askwan-cache1]: HTTP requests
Legend1[askwan-cache1]: HTTP hits
Legend2[askwan-cache1]: HTTP requests
YLegend[askwan-cache1]: perminute
ShortLegend[askwan-cache1]: req/min
Options[askwan-cache1]: nopercent,growright,perminute, dorelpercent, unknaszero
Target[proxy-askwan]: cacheServerInKb&cacheServerOutKb:public@192.168.1.217:3401
#RouterName[proxy-askwan]: cacheUniqName
MaxBytes[proxy-askwan]: 76800
Title[proxy-askwan]: Cache Server Traffic In/Out
PageTop[proxy-askwan]:
Cache Statistics: Server traffic volume (In/Out)
Suppress[proxy-askwan]: y
LegendI[proxy-askwan]: Traffic In
LegendO[proxy-askwan]: Traffic Out
Legend1[proxy-askwan]: Traffic In
Legend2[proxy-askwan]: Traffic Out
YLegend[proxy-askwan]: per minute
ShortLegend[proxy-askwan]: b/min
kMG[proxy-askwan]: k,M,G,T
kilo[proxy-askwan]: 1024
Options[proxy-askwan]: nopercent,growright, perminute, unknaszero
重新生成首页,重新执行env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg 三次
就可以得到图像了
同上,选取合适的target值和参数值,对其他的状态的监控都可以很容易做到
作者:@
地址:
阅读(967) | 评论(0) | 转发(0) |