MRTG-SQUID(1)
πΈ MRTG-SQUID(1) πΈ
okay bestie, welcome to mrtg-squid β it's the mrtg manual page that teaches you how to monitor Squid and honestly? it's giving niche-but-iconic. π
β¨ NAME β¨
mrtg-squid β using mrtg to monitor Squid π¦
π DESCRIPTION π
so here's the tea: Squid 2.3 knows SNMP, which means you can point mrtg at it and monitor it super easily. no cap. π
the author made some modifications to mrtg to make this even simpler. their work is based on earlier modifications made by: matija.grabnar@arnes.si and kostas@nlanr.net. shoutout to the OGs π«Ά
π¦ MODIFICATIONS π¦
they added new code for displaying correct units to the previous patches perminute and perhour (those are "option" tokens, bestie), which lets you measure stuff in units other than just "persecond". periodt. β¨
then they created a new option token dorelpercent which lets you calculate the percentage of IN-stream / OUT-stream on the fly, and then displays it on a fixed scale from 0% to 100%. for their requirements this does good work. maybe someone wants a floating scale β it should not be a problem to implement it too (but give them an option to keep their fixed scale, okay? π). if IN-stream is always less than OUT-stream, both lines (OUT-stream and relative percent) are always displayed on top of IN-stream bulk. otherwise this option makes no sense. with this option you can display hitrates, errorrates (and for router monitoring: rel. droprates) easily now. π₯
β οΈ okay important: if you use this option, please consider that you need a 5th colourname/value pair in your Colours statements! don't forget it bestie π
due to some discussion on this list, they implemented two tokens too:
"kilo" and "kMG" π«
"kilo"should contain the value of k (1000or1024), where1000is the default."kMG"is a comma separated list of multiplier prefixes, used instead of"","k","M","G","T"on the MRTG display. leave the place free if you want no prefix.
also an incomplete list of OIDs for the new SQUID release is added. π
you may need to turn on snmp_port in squid.conf as it is disabled by default. π
they hope you enjoy it. π
π CONFIG EXAMPLE π
first, load the squid mib:
LoadMIBs: /usr/share/squid/mib.txt
you can measure responsetimes in ms and display it with MRTG correctly with:
kMG[measure-ms]: m,,k,M,G,T
short[measure-ms]: s
you can display now MB/s as 1024*1024 B/s with:
kilo[volume]: 1024
assuming you're not running squid's SNMP on the default snmp port, you need to include a port number in your target line:
Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@localhost:3401
a sample config for squid:
Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@proxy
Title[proxy-hit]: HTTP Hits
PageTop[proxy-hit]: <H2>proxy Cache Statistics: HTTP Hits / Requests</H2>
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
Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@proxy
Title[proxy-srvkbinout]: Cache Server Traffic In / Out
PageTop[proxy-srvkbinout]: <H2>Cache Statistics: Server traffic volume (In/Out) </H2>
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
π AUTHOR π
Andreas Papst <andreas.papst@univie.ac.at> Dirk-LXder Kreie <deelkar@gmx.de> Chris Chiappa <chris+debian@chiappa.net>
and that's the whole page bestie, we ate and left no crumbs πβ¨ this was mrtg version 2.17.10, dated 2022-01-19 β mwah, tysm for reading, iykyk πππ
π¦ where this page comes from
- alpine 3.22: mrtg-doc 2.17.10-r1 Β· GPL-2.0-or-later
- alpine 3.23: mrtg-doc 2.17.10-r1 Β· GPL-2.0-or-later
- alpine 3.24: mrtg-doc 2.17.10-r2 Β· GPL-2.0-or-later
- centos-stream 10: mrtg 2.17.10-13.el10 Β· GPL-2.0-or-later
- debian bookworm: mrtg 2.17.10-5+deb12u2 Β· GPL-2.0-or-later
- debian trixie: mrtg 2.17.10-13+deb13u2 Β· GPL-2.0-or-later
- fedora 43: mrtg 2.17.10-12.fc43 Β· GPL-2.0-or-later
- fedora 43: mrtg 2.17.10-13.fc43 Β· GPL-2.0-or-later
- fedora 44: mrtg 2.17.10-13.fc44 Β· GPL-2.0-or-later
- fedora 44: mrtg 2.17.10-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: mrtg 2.17.10
- nixpkgs unstable: mrtg 2.17.10
- ubuntu jammy: mrtg 2.17.10-3 Β· GPL-2.0-or-later
- ubuntu noble: mrtg 2.17.10-12 Β· GPL-2.0-or-later
- ubuntu questing: mrtg 2.17.10-13
- ubuntu resolute: mrtg 2.17.10-14 Β· GPL-2.0-or-later
- ubuntu stonking: mrtg 2.17.10-16 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms