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