Sunteți pe pagina 1din 1

Squid supports SNMP, so the only thing needed is a correct configuration, the fo

llowing example doesn't cover all needed MRTG configuration options, but only Sq
uid related things.For generic informations about MRTG configuration, please loo
k at www.mrtg.org.
⠀squid.conf:
⠀The following are the minimal changes needed in squid.conf:

acl snmppublic snmp_community public snmp_port 3401 snmp_access allow snmppublic


all (Here you can use any community name and any valid acl name)
⠀mrtg.cfg:
⠀Copy the mib.txt file from Squid in the mibs directory of your MRTG installation
⠀Add to Global Config Options of your mrtg.conf a line like the followig:
LoadMIBS: /usr/local/mrtg-2/mibs/squid.mib
(Here I have renamed mib.txt in squid.mib)
⠀Add targets like the following:
Target[proxy-hit]: cacheHttpHits&cacheServerRequests:public@proxy.sg.private:340
1 # If you are using Squid 2.6 or later, uncomment the following line #RouterNam
e[proxy-hit]: cacheUniqName MaxBytes[proxy-hit]: 100000 Title[proxy-hit]: HTTP H
its PageTop[proxy-hit]:
proxy Cache Statistics: HTTP Hits/Requests
<TABLE> <TR><TD>System:</TD><TD>proxy.sg.private</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-srvkbino
ut]: cacheServerInKb&cacheServerOutKb:public@proxy.sg.private:3401 # If you are
using Squid 2.6 or later, uncomment the following line #RouterName[proxy-srvkbin
out]: cacheUniqName MaxBytes[proxy-srvkbinout]: 76800 Title[proxy-srvkbinout]: C
ache Server Traffic In/Out PageTop[proxy-srvkbinout]:
Cache Statistics: Server traffic volume (In/Out)
<TABLE> <TR><TD>System:</TD><TD>proxy.sg.private</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]: Traf
fic 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
Here the proxy hostname is proxy.sg.private, with public SNMP community enabled
and SNMP listening on 3401 portPlease note the MaxBytes value (76800 KB/min) for
Cache Server Traffic In/Out: it depends from your Proxy network interface speed
.

from http://squid.acmeconsulting.it/mrtg.html
.

S-ar putea să vă placă și