|
Packit |
667938 |
=encoding utf8
|
|
Packit |
667938 |
=head1 NAME
|
|
Packit |
667938 |
|
|
Packit |
667938 |
mrtg-squid - using mrtg to monitor Squid
|
|
Packit |
667938 |
|
|
Packit |
667938 |
=head1 DESCRIPTION
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Squid 2.3 knows SNMP and you can therefore use mrtg to
|
|
Packit |
667938 |
monitor it quite easily.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
I have made some modifications to mrtg which simplify this.
|
|
Packit |
667938 |
My work is based on earlier modification made by:
|
|
Packit |
667938 |
matija.grabnar@arnes.si and kostas@nlanr.net.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
=head1 MODIFICATIONS
|
|
Packit |
667938 |
|
|
Packit |
667938 |
I added new code for displaying correct units to the
|
|
Packit |
667938 |
previous patches "perminute" and "perhour" ("option" tokens),
|
|
Packit |
667938 |
which allows other measurement in addition to "persecond".
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Then I created a new option token "dorelpercent" which
|
|
Packit |
667938 |
allows the calculation of the percentage of IN-stream / OUT-stream on
|
|
Packit |
667938 |
the fly and then displays it on a fixed scale from 0% to 100%. For my
|
|
Packit |
667938 |
requirements, this does good work. Maybe someone wants a floating
|
|
Packit |
667938 |
scale. It should not be a problem to implement it, too (but
|
|
Packit |
667938 |
give me an option to keep my fixed scale). If IN-stream is always
|
|
Packit |
667938 |
less than OUT-stream both lines (OUT-stream and relative percent)
|
|
Packit |
667938 |
are always displayed on top of IN-stream bulk. Otherwise this
|
|
Packit |
667938 |
option makes no sense. With this option you can display hitrates,
|
|
Packit |
667938 |
errorrates (for router monitoring: rel. droprates) easily now.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
If you use this options please consider that you need a 5th
|
|
Packit |
667938 |
colourname/value pair in your Colours statements!
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Due to some discussion on this list, I have implemented two
|
|
Packit |
667938 |
tokens too:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
"kilo" and "kMG"
|
|
Packit |
667938 |
|
|
Packit |
667938 |
"kilo" should contain the value of k (1000 or 1024), where 1000 is the
|
|
Packit |
667938 |
default.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
"kMG" is a comma separated list of multiplier prefixes, used
|
|
Packit |
667938 |
instead of "", "k", "M", "G", "T" on the MRTG display. Leave the
|
|
Packit |
667938 |
place free, if you want no prefix.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Also an incomplete list of OIDs for the new SQUID release is
|
|
Packit |
667938 |
added.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
You may need to turn on snmp_port in squid.conf to as it is disabled by default.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
I hope you enjoy it.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
=head1 CONFIG EXAMPLE
|
|
Packit |
667938 |
|
|
Packit |
667938 |
First load the squid mib
|
|
Packit |
667938 |
|
|
Packit |
667938 |
LoadMIBs: /usr/share/squid/mib.txt
|
|
Packit |
667938 |
|
|
Packit |
667938 |
You can measure responsetimes in ms and display it with MRTG
|
|
Packit |
667938 |
correctly with:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
kMG[measure-ms]: m,,k,M,G,T
|
|
Packit |
667938 |
short[measure-ms]: s
|
|
Packit |
667938 |
|
|
Packit |
667938 |
You can display now MB/s as 1024*1024 B/s with:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
kilo[volume]: 1024
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Assuming you're not running squid's SNMP on the default snmp port, you need
|
|
Packit |
667938 |
to include a port number in your target line:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@localhost:3401
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
A sample config for squid:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@proxy
|
|
Packit |
667938 |
Title[proxy-hit]: HTTP Hits
|
|
Packit |
667938 |
PageTop[proxy-hit]: proxy Cache Statistics: HTTP Hits / Requests
|
|
Packit |
667938 |
Suppress[proxy-hit]: y
|
|
Packit |
667938 |
LegendI[proxy-hit]: HTTP hits
|
|
Packit |
667938 |
LegendO[proxy-hit]: HTTP requests
|
|
Packit |
667938 |
Legend1[proxy-hit]: HTTP hits
|
|
Packit |
667938 |
Legend2[proxy-hit]: HTTP requests
|
|
Packit |
667938 |
YLegend[proxy-hit]: perminute
|
|
Packit |
667938 |
ShortLegend[proxy-hit]: req/min
|
|
Packit |
667938 |
Options[proxy-hit]: nopercent, perminute, dorelpercent
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@proxy
|
|
Packit |
667938 |
Title[proxy-srvkbinout]: Cache Server Traffic In / Out
|
|
Packit |
667938 |
PageTop[proxy-srvkbinout]: Cache Statistics: Server traffic volume (In/Out)
|
|
Packit |
667938 |
Suppress[proxy-srvkbinout]: y
|
|
Packit |
667938 |
LegendI[proxy-srvkbinout]: Traffic In
|
|
Packit |
667938 |
LegendO[proxy-srvkbinout]: Traffic Out
|
|
Packit |
667938 |
Legend1[proxy-srvkbinout]: Traffic In
|
|
Packit |
667938 |
Legend2[proxy-srvkbinout]: Traffic Out
|
|
Packit |
667938 |
YLegend[proxy-srvkbinout]: per minute
|
|
Packit |
667938 |
ShortLegend[proxy-srvkbinout]: b/min
|
|
Packit |
667938 |
kMG[proxy-srvkbinout]: k,M,G,T
|
|
Packit |
667938 |
kilo[proxy-srvkbinout]: 1024
|
|
Packit |
667938 |
Options[proxy-srvkbinout]: nopercent, perminute
|
|
Packit |
667938 |
|
|
Packit |
667938 |
=head1 AUTHOR
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Andreas Papst E<lt>andreas.papst@univie.ac.atE<gt>
|
|
Packit |
667938 |
Dirk-Lüder Kreie E<lt>deelkar@gmx.deE<gt>
|
|
Packit |
667938 |
Chris Chiappa E<lt>chris+debian@chiappa.netE<gt>
|