diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-02-24 14:45:05 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-02-24 14:45:05 +0200 |
commit | 50a194f68c07aee6abdd9342fa97e3d4f4579f41 (patch) | |
tree | 68021692464c51dfd2ed1d26e999172f898cbee5 /charts.d/squid.chart.sh | |
parent | 9a5715d759a00571c0d146aa2cdfc591082ded57 (diff) |
now it checks for /counters and squid-internal-mgr/counters
Diffstat (limited to 'charts.d/squid.chart.sh')
-rwxr-xr-x | charts.d/squid.chart.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/charts.d/squid.chart.sh b/charts.d/squid.chart.sh index 7b3434e2b3..cd7d7ea1f6 100755 --- a/charts.d/squid.chart.sh +++ b/charts.d/squid.chart.sh @@ -2,11 +2,13 @@ squid_host="127.0.0.1" squid_port="3128" +squid_path="squid-internal-mgr/counters" +squid_path2="counters" squid_update_every=5 squid_get_stats() { nc $squid_host $squid_port <<EOF -GET cache_object://$squid_host:$squid_port/counters HTTP/1.0 +GET cache_object://$squid_host:$squid_port/$squid_path HTTP/1.0 EOF } @@ -16,8 +18,13 @@ squid_check() { local x=`squid_get_stats | grep client_http.requests` if [ ! $? -eq 0 -o -z "$x" ] then - 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" - return 1 + squid_path="$squid_path2" + x=`squid_get_stats | grep client_http.requests` + if [ ! $? -eq 0 -o -z "$x" ] + then + 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" + return 1 + fi fi return 0 |