added apache 2.4 connections tracking
Costa Tsaousis (ktsaou) committed
Jan 23, 2016 at 14:16 UTC
05ec1a9b81f4b9fb93e5c45c76dc03e8191d77fb
1 file changed
+46
-1
charts.d/apache.chart.sh
+46
-1
@@ -21,8 +21,13 @@ apache_bytespersec=0
21
apache_bytesperreq=0
22
apache_busyworkers=0
23
apache_idleworkers=0
24
+apache_connstotal=0
25
+apache_connsasyncwriting=0
26
+apache_connsasynckeepalive=0
27
+apache_connsasyncclosing=0
28
29
apache_keys_detected=0
30
+apache_has_conns=0
31
apache_key_accesses=
32
apache_key_kbytes=
33
apache_key_reqpersec=
@@ -70,6 +75,15 @@ apache_detect() {
75
return 1
76
fi
77
78
+ if [ ! -z "${apache_key_connstotal}" \
79
+ -a ! -z "${apache_key_connsasyncwriting}" \
80
+ -a ! -z "${apache_key_connsasynckeepalive}" \
81
+ -a ! -z "${apache_key_connsasyncclosing}" \
82
+ ]
83
+ then
84
+ apache_has_conns=1
85
+ fi
86
+
87
return 0
88
}
89
@@ -111,6 +125,11 @@ apache_get() {
125
return 1
126
fi
127
128
+ apache_connstotal="${apache_response[${apache_key_connstotal}]}"
129
+ apache_connsasyncwriting="${apache_response[${apache_key_connsasyncwriting}]}"
130
+ apache_connsasynckeepalive="${apache_response[${apache_key_connsasynckeepalive}]}"
131
+ apache_connsasyncclosing="${apache_response[${apache_key_connsasyncclosing}]}"
132
+
133
return 0
134
}
135
@@ -145,10 +164,22 @@ CHART apache.bytespersec '' "apache Lifetime Avg. Bandwidth/s" "kilobits/s" apac
164
DIMENSION sent '' absolute 8 $[apache_decimal_detail * 1000]
165
CHART apache.requests '' "apache Requests" "requests/s" apache apache line 16001 $apache_update_every
166
DIMENSION requests '' incremental 1 1
148
-CHART apache.net '' "apache Bandwidth" "kilobits/s" apache apache area 16002 $apache_update_every
167
+CHART apache.net '' "apache Bandwidth" "kilobits/s" apache apache area 16003 $apache_update_every
168
DIMENSION sent '' incremental 8 1
169
EOF
170
171
+ if [ ${apache_has_conns} -eq 1 ]
172
+ then
173
+ cat <<EOF2
174
+CHART apache.connections '' "apache Connections" "connections" apache apache line 16002 $apache_update_every
175
+DIMENSION connections '' absolute 1 1
176
+CHART apache.conns_async '' "apache Async Connections" "connections" apache apache stacked 16004 $apache_update_every
177
+DIMENSION keepalive '' absolute 1 1
178
+DIMENSION closing '' absolute 1 1
179
+DIMENSION writing '' absolute 1 1
180
+EOF2
181
+ fi
182
+
183
return 0
184
}
185
@@ -187,5 +218,19 @@ SET busy = $[apache_busyworkers]
218
END
219
VALUESEOF
220
221
+ if [ ${apache_has_conns} -eq 1 ]
222
+ then
223
+ cat <<VALUESEOF2
224
+BEGIN apache.connections $1
225
+SET connections = $[apache_key_connstotal]
226
+END
227
+BEGIN apache.conns_async $1
228
+SET keepalive = $[apache_connsasynckeepalive]
229
+SET closing = $[apache_connsasyncwriting]
230
+SET writing = $[apache_connsasyncwriting]
231
+END
232
+VALUESEOF2
233
+ fi
234
+
235
return 0
236
}