1MRTG-SQUID(1) mrtg MRTG-SQUID(1)
2
3
4
6 mrtg-squid - using mrtg to monitor Squid
7
9 Squid 2.3 knows SNMP and you can therefore use mrtg to monitor it quite
10 easily.
11
12 I have made some modifications to mrtg which simplify this. My work is
13 based on earlier modification made by: matija.grabnar@arnes.si and
14 kostas@nlanr.net.
15
17 I added new code for displaying correct units to the previous patches
18 "perminute" and "perhour" ("option" tokens), which allows other
19 measurement in addition to "persecond".
20
21 Then I created a new option token "dorelpercent" which allows the
22 calculation of the percentage of IN-stream / OUT-stream on the fly and
23 then displays it on a fixed scale from 0% to 100%. For my requirements,
24 this does good work. Maybe someone wants a floating scale. It should
25 not be a problem to implement it, too (but give me an option to keep my
26 fixed scale). If IN-stream is always less than OUT-stream both lines
27 (OUT-stream and relative percent) are always displayed on top of IN-
28 stream bulk. Otherwise this option makes no sense. With this option you
29 can display hitrates, errorrates (for router monitoring: rel.
30 droprates) easily now.
31
32 If you use this options please consider that you need a 5th
33 colourname/value pair in your Colours statements!
34
35 Due to some discussion on this list, I have implemented two tokens too:
36
37 "kilo" and "kMG"
38
39 "kilo" should contain the value of k (1000 or 1024), where 1000 is the
40 default.
41
42 "kMG" is a comma separated list of multiplier prefixes, used instead of
43 "", "k", "M", "G", "T" on the MRTG display. Leave the place free, if
44 you want no prefix.
45
46 Also an incomplete list of OIDs for the new SQUID release is added.
47
48 You may need to turn on snmp_port in squid.conf to as it is disabled by
49 default.
50
51 I hope you enjoy it.
52
54 First load the squid mib
55
56 LoadMIBs: /usr/share/squid/mib.txt
57
58 You can measure responsetimes in ms and display it with MRTG correctly
59 with:
60
61 kMG[measure-ms]: m,,k,M,G,T
62 short[measure-ms]: s
63
64 You can display now MB/s as 1024*1024 B/s with:
65
66 kilo[volume]: 1024
67
68 Assuming you're not running squid's SNMP on the default snmp port, you
69 need to include a port number in your target line:
70
71 Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@localhost:3401
72
73 A sample config for squid:
74
75 Target[proxy-hit]: cacheHttpHits&cacheProtoClientHttpRequests:public@proxy
76 Title[proxy-hit]: HTTP Hits
77 PageTop[proxy-hit]: <H2>proxy Cache Statistics: HTTP Hits / Requests</H2>
78 Suppress[proxy-hit]: y
79 LegendI[proxy-hit]: HTTP hits
80 LegendO[proxy-hit]: HTTP requests
81 Legend1[proxy-hit]: HTTP hits
82 Legend2[proxy-hit]: HTTP requests
83 YLegend[proxy-hit]: perminute
84 ShortLegend[proxy-hit]: req/min
85 Options[proxy-hit]: nopercent, perminute, dorelpercent
86
87 Target[proxy-srvkbinout]: cacheServerInKb&cacheServerOutKb:public@proxy
88 Title[proxy-srvkbinout]: Cache Server Traffic In / Out
89 PageTop[proxy-srvkbinout]: <H2>Cache Statistics: Server traffic volume (In/Out) </H2>
90 Suppress[proxy-srvkbinout]: y
91 LegendI[proxy-srvkbinout]: Traffic In
92 LegendO[proxy-srvkbinout]: Traffic Out
93 Legend1[proxy-srvkbinout]: Traffic In
94 Legend2[proxy-srvkbinout]: Traffic Out
95 YLegend[proxy-srvkbinout]: per minute
96 ShortLegend[proxy-srvkbinout]: b/min
97 kMG[proxy-srvkbinout]: k,M,G,T
98 kilo[proxy-srvkbinout]: 1024
99 Options[proxy-srvkbinout]: nopercent, perminute
100
102 Andreas Papst <andreas.papst@univie.ac.at> Dirk-LXder Kreie
103 <deelkar@gmx.de> Chris Chiappa <chris+debian@chiappa.net>
104
105
106
1072.17.10 2022-01-19 MRTG-SQUID(1)