Skip to content

Commit dadf97b

Browse files
committed
python module for squid proxy metrics
1 parent d6af823 commit dadf97b

5 files changed

Lines changed: 739 additions & 0 deletions

File tree

squid/README.mkdn

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
squid
2+
========
3+
4+
Python module for ganglia 3.1.
5+
6+
This module uses squidclient to get statistics from a running squid proxy.
7+
It attempts to parse the output into key/value pairs, it will need to be
8+
updated if new metrics are added to squidclient. The metric names are based
9+
on those returned by the squid snmp module, new ones were created with
10+
similar names where there were values in the output that didn't map directly
11+
to existing snmp metrics.
12+
13+
It has been tested on squid 2.6 and 2.7, I believe it should work on 3.1
14+
as well.
15+
16+
## NOTES
17+
The user running gmond will need to have the rights to run
18+
"squidclient mgr:info".
19+
20+
The python module may be run as a standalone script to see the
21+
metrics that generated when included into gmond.
22+
23+
## AUTHOR
24+
25+
Author: Daniel Rich <drich [at] employees [dot] org>
26+

squid/conf.d/squid.pyconf

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
#/* squid server metrics */
2+
#
3+
modules {
4+
module {
5+
name = "squid"
6+
language = "python"
7+
}
8+
}
9+
10+
collection_group {
11+
collect_every = 30
12+
time_threshold = 60
13+
metric {
14+
name = squid_cacheVersionId
15+
title = 'Cache Software Version'
16+
}
17+
metric {
18+
name = squid_cacheSysVMsize
19+
title = 'Storage Mem size in KB'
20+
}
21+
metric {
22+
name = squid_cacheMemUsage
23+
title = 'Total memory accounted for KB'
24+
}
25+
metric {
26+
name = squid_cacheSysPageFaults
27+
title = 'Page faults with physical i/o'
28+
}
29+
metric {
30+
name = squid_cacheCpuTime
31+
title = 'Amount of cpu seconds consumed'
32+
}
33+
metric {
34+
name = squid_cacheCpuUsage
35+
title = 'The percentage use of the CPU'
36+
}
37+
metric {
38+
name = squid_cacheCpuUsage_5
39+
title = 'The percentage use of the CPU - 5 min'
40+
}
41+
metric {
42+
name = squid_cacheCpuUsage_60
43+
title = 'The percentage use of the CPU - 60 min'
44+
}
45+
metric {
46+
name = squid_cacheMaxResSize
47+
title = 'Maximum Resident Size in KB'
48+
}
49+
metric {
50+
name = squid_cacheNumObjCount
51+
title = 'Number of objects stored by the cache'
52+
}
53+
metric {
54+
name = squid_cacheNumObjCountMemObj
55+
title = 'Number of memobjects stored by the cache'
56+
}
57+
metric {
58+
name = squid_cacheNumObjCountHot
59+
title = 'Number of hot objects stored by the cache'
60+
}
61+
metric {
62+
name = squid_cacheNumObjCountOnDisk
63+
title = 'Number of objects stored by the cache on-disk'
64+
}
65+
metric {
66+
name = squid_cacheCurrentUnusedFDescrCnt
67+
title = 'Available number of file descriptors'
68+
}
69+
metric {
70+
name = squid_cacheCurrentResFileDescrCnt
71+
title = 'Reserved number of file descriptors'
72+
}
73+
metric {
74+
name = squid_cacheCurrentFileDescrCnt
75+
title = 'Number of file descriptors in use'
76+
}
77+
metric {
78+
name = squid_cacheCurrentFileDescrMax
79+
title = 'Highest file descriptors in use'
80+
}
81+
metric {
82+
name = squid_cacheProtoClientHttpRequests
83+
title = 'Number of HTTP requests received'
84+
}
85+
metric {
86+
name = squid_cacheIcpPktsSent
87+
title = 'Number of ICP messages sent'
88+
}
89+
metric {
90+
name = squid_cacheIcpPktsRecv
91+
title = 'Number of ICP messages received'
92+
}
93+
metric {
94+
name = squid_cacheCurrentSwapSize
95+
title = 'Storage Swap size'
96+
}
97+
metric {
98+
name = squid_cacheClients
99+
title = 'Number of clients accessing cache'
100+
}
101+
metric {
102+
name = squid_cacheHttpAllSvcTime_5
103+
title = 'HTTP all service time - 5 min'
104+
}
105+
metric {
106+
name = squid_cacheHttpAllSvcTime_60
107+
title = 'HTTP all service time - 60 min'
108+
}
109+
metric {
110+
name = squid_cacheHttpMissSvcTime_5
111+
title = 'HTTP miss service time - 5 min'
112+
}
113+
metric {
114+
name = squid_cacheHttpMissSvcTime_60
115+
title = 'HTTP miss service time - 60 min'
116+
}
117+
metric {
118+
name = squid_cacheHttpNmSvcTime_5
119+
title = 'HTTP hit not-modified service time - 5 min'
120+
}
121+
metric {
122+
name = squid_cacheHttpNmSvcTime_60
123+
title = 'HTTP hit not-modified service time - 60 min'
124+
}
125+
metric {
126+
name = squid_cacheHttpHitSvcTime_5
127+
title = 'HTTP hit service time - 5 min'
128+
}
129+
metric {
130+
name = squid_cacheHttpHitSvcTime_60
131+
title = 'HTTP hit service time - 60 min'
132+
}
133+
metric {
134+
name = squid_cacheIcpQuerySvcTime_5
135+
title = 'ICP query service time - 5 min'
136+
}
137+
metric {
138+
name = squid_cacheIcpQuerySvcTime_60
139+
title = 'ICP query service time - 60 min'
140+
}
141+
metric {
142+
name = squid_cacheDnsSvcTime_5
143+
title = 'DNS service time - 5 min'
144+
}
145+
metric {
146+
name = squid_cacheDnsSvcTime_60
147+
title = 'DNS service time - 60 min'
148+
}
149+
metric {
150+
name = squid_cacheRequestHitRatio_5
151+
title = 'Request Hit Ratios - 5 min'
152+
}
153+
metric {
154+
name = squid_cacheRequestHitRatio_60
155+
title = 'Request Hit Ratios - 60 min'
156+
}
157+
metric {
158+
name = squid_cacheRequestByteRatio_5
159+
title = 'Byte Hit Ratios - 5 min'
160+
}
161+
metric {
162+
name = squid_cacheRequestByteRatio_60
163+
title = 'Byte Hit Ratios - 60 min'
164+
}
165+
metric {
166+
name = squid_cacheRequestMemRatio_5
167+
title = 'Memory Hit Ratios - 5 min'
168+
}
169+
metric {
170+
name = squid_cacheRequestMemRatio_60
171+
title = 'Memory Hit Ratios - 60 min'
172+
}
173+
metric {
174+
name = squid_cacheRequestDiskRatio_5
175+
title = 'Disk Hit Ratios - 5 min'
176+
}
177+
metric {
178+
name = squid_cacheRequestDiskRatio_60
179+
title = 'Disk Hit Ratios - 60 min'
180+
}
181+
metric {
182+
name = squid_cacheHttpNhSvcTime_5
183+
title = 'HTTP refresh hit service time - 5 min'
184+
}
185+
metric {
186+
name = squid_cacheHttpNhSvcTime_60
187+
title = 'HTTP refresh hit service time - 60 min'
188+
}
189+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"report_name" : "squid_5min_service_report",
3+
"report_type" : "standard",
4+
"title" : "Squid 5min Service Times",
5+
"vertical_label" : "seconds",
6+
"series" : [
7+
{ "metric" : "squid_cacheDnsSvcTime_5", "color": "3366ff", "label": "DNS", "line_width": "2", "type": "line" },
8+
{ "metric" : "squid_cacheHttpAllSvcTime_5", "color": "cc99ff", "label": "HTTP All", "line_width": "2", "type": "line" },
9+
{ "metric" : "squid_cacheHttpHitSvcTime_5", "color": "ff3366", "label": "HTTP Hit", "line_width": "2", "type": "line" },
10+
{ "metric" : "squid_cacheHttpMissSvcTime_5", "color": "00ff00", "label": "HTTP Miss", "line_width": "2", "type": "line" },
11+
{ "metric" : "squid_cacheHttpNhSvcTime_5", "color": "ff9999", "label": "HTTP Refresh", "line_width": "2", "type": "line" },
12+
{ "metric" : "squid_cacheHttpNmSvcTime_5", "color": "cc0000", "label": "HTTP not-mod", "line_width": "2", "type": "line" }
13+
]
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"report_name" : "squid_60min_service_report",
3+
"report_type" : "standard",
4+
"title" : "Squid 60 min Service Times",
5+
"vertical_label" : "seconds",
6+
"series" : [
7+
{ "metric" : "squid_cacheDnsSvcTime_60", "color": "3366ff", "label": "DNS", "line_width": "2", "type": "line" },
8+
{ "metric" : "squid_cacheHttpAllSvcTime_60", "color": "cc99ff", "label": "HTTP All", "line_width": "2", "type": "line" },
9+
{ "metric" : "squid_cacheHttpHitSvcTime_60", "color": "ff3366", "label": "HTTP Hit", "line_width": "2", "type": "line" },
10+
{ "metric" : "squid_cacheHttpMissSvcTime_60", "color": "00ff00", "label": "HTTP Miss", "line_width": "2", "type": "line" },
11+
{ "metric" : "squid_cacheHttpNhSvcTime_60", "color": "ff9999", "label": "HTTP Refresh", "line_width": "2", "type": "line" },
12+
{ "metric" : "squid_cacheHttpNmSvcTime_60", "color": "cc0000", "label": "HTTP not-mod", "line_width": "2", "type": "line" }
13+
]
14+
}

0 commit comments

Comments
 (0)