- 论坛徽章:
- 0
|
(1)我们需要修改squid
vi /etc/squid/squid.conf
acl snmppublic snmp_community public (设置snmp监控的共同体为public)
snmp_port 3401(设置snmp监控端口)
snmp_access allow snmppublic all(允许所有的计算机访问snmppublic)
然后从新启动squid /etc/rc.d/init.d/squid restart
(2)把/etc/squid/mib.txt 复制到/etc/mrtg/squid.mib
cp /etc/squid/mib.txt /etc/mrtg/squid.mib
(3)然后修改/etc/mrtg/mrtg.cfg
加入LoadMIBs: /etc/mrtg/squid.mib
(4)在/etc/mrtg/mrtg.cfg加入如下
Target[proxy-hit]: cacheHttpHits&cacheServerRequests:public@x.x.x.x:3401(x.x.x.x为你机器的IP地址)
MaxBytes[proxy-hit]: 100000
Title[proxy-hit]: HTTP Hits
PageTop[proxy-hit]: <H1>proxy Cache Statistics: HTTP Hits/Requests</H1>
<TABLE>
<TR><TD>System:</TD><TD>redhat.grandunion.com.cn</TD></TR>
<TR><TD>Maintainer:</TD><TD>Serassio Guido</TD></TR>
<TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
</TABLE>
Suppress[proxy-hit]: y
LegendI[proxy-hit]: HTTP hits
LegendO[proxy-hit]: HTTP requests
Legend1[proxy-hit]: HTTP hits
Legend2[proxy-hit]: HTTP requests
YLegend[proxy-hit]: perminute
ShortLegend[proxy-hit]: req/min
Options[proxy-hit]: nopercent, perminute, dorelpercent, unknaszero
Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@x.x.x.x:3401(x.x.x.x为你机器的IP地址)
MaxBytes[proxy-srvkbinout]: 2000(这儿为你的真实网络带宽xxxK)
Title[proxy-srvkbinout]: Cache Server Traffic In/Out
PageTop[proxy-srvkbinout]: <H1>Cache Statistics: Server traffic volume (In/Out)</H1>
<TABLE>
<TR><TD>System:</TD><TD>redhat.grandunion.com.cn</TD></TR>
<TR><TD>Maintainer:</TD><TD>Serassio Guido</TD></TR>
<TR><TD>Description:</TD><TD>Squid Proxy server</TD></TR>
</TABLE>
Suppress[proxy-srvkbinout]: y
LegendI[proxy-srvkbinout]: Traffic In
LegendO[proxy-srvkbinout]: Traffic Out
Legend1[proxy-srvkbinout]: Traffic In
Legend2[proxy-srvkbinout]: Traffic Out
YLegend[proxy-srvkbinout]: per minute
ShortLegend[proxy-srvkbinout]: b/min
kMG[proxy-srvkbinout]: k,M,G,T
kilo[proxy-srvkbinout]: 1024
Options[proxy-srvkbinout]: nopercent, perminute, unknaszero
保存文件,并运行mrtg mrtg.cfg
然后出现了下面的报错信息
ossim: /var/www/mrtg/192.168.10.110# env LANG=C /usr/bin/mrtg /var/www/mrtg/192.168.10.110/192.168.10.110
Unknown SNMP var cacheUptime
at /usr/bin/mrtg line 2207
Unknown SNMP var cacheSoftware
at /usr/bin/mrtg line 2207
Unknown SNMP var cacheVersionId
at /usr/bin/mrtg line 2207
Use of uninitialized value $ret[-2] in concatenation (.) or string at /usr/bin/mrtg line 2226.
Use of uninitialized value $ret[-1] in concatenation (.) or string at /usr/bin/mrtg line 2226.
请大虾帮忙解决一下 |
|