@cryptotaxi247 / netdata-1 / commits / 50a194f68

now it checks for /counters and squid-internal-mgr/counters

Costa Tsaousis (ktsaou) committed Feb 24, 2015 at 14:45 UTC 50a194f68c07aee6abdd9342fa97e3d4f4579f41
1 file changed +10 -3
charts.d/squid.chart.sh
+10 -3
@@ -2,11 +2,13 @@
2
3 squid_host="127.0.0.1"
4 squid_port="3128"
5 +squid_path="squid-internal-mgr/counters"
6 +squid_path2="counters"
7 squid_update_every=5
8
9 squid_get_stats() {
10 nc $squid_host $squid_port <<EOF
9 -GET cache_object://$squid_host:$squid_port/counters HTTP/1.0
11 +GET cache_object://$squid_host:$squid_port/$squid_path HTTP/1.0
12
13 EOF
14 }
@@ -16,8 +18,13 @@ squid_check() {
18 local x=`squid_get_stats | grep client_http.requests`
19 if [ ! $? -eq 0 -o -z "$x" ]
20 then
19 - echo >&2 "squid: cannot fetch the counters from $squid_host:$squid_port. Please set squid_host='host' and squid_port='port' in $confd/squid.conf"
20 - return 1
21 + squid_path="$squid_path2"
22 + x=`squid_get_stats | grep client_http.requests`
23 + if [ ! $? -eq 0 -o -z "$x" ]
24 + then
25 + echo >&2 "squid: cannot fetch the counters from $squid_host:$squid_port. Please set squid_host='host' and squid_port='port' in $confd/squid.conf"
26 + return 1
27 + fi
28 fi
29
30 return 0