]> arthur.barton.de Git - netdata.git/commitdiff
now it checks for /counters and squid-internal-mgr/counters
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 24 Feb 2015 12:45:05 +0000 (14:45 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 24 Feb 2015 12:45:05 +0000 (14:45 +0200)
charts.d/squid.chart.sh

index 7b3434e2b36e36403b643cbc5610b915fc47cd0f..cd7d7ea1f63472bd81e0550c9d0acb315aa94f14 100755 (executable)
@@ -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