diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-10-20 22:04:28 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-10-20 22:04:28 +0300 |
commit | addb52bb18ba356fc1cb5888b1fe5b809137346d (patch) | |
tree | 61f3294473d70f9f96e2e302837ff844a70e3207 /charts.d/squid.chart.sh | |
parent | c6d3138cc7ddb21bac33df2fc9f16c6e76ff1426 (diff) |
better log management for charts.d.plugin - fixes #1144
Diffstat (limited to 'charts.d/squid.chart.sh')
-rwxr-xr-x | charts.d/squid.chart.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/charts.d/squid.chart.sh b/charts.d/squid.chart.sh index 3e72ba6df5..4b4d43ae1f 100755 --- a/charts.d/squid.chart.sh +++ b/charts.d/squid.chart.sh @@ -9,7 +9,7 @@ squid_priority=60000 squid_get_stats_internal() { local host="$1" port="$2" url="$3" - squidclient -h $host -p $port $url + run squidclient -h $host -p $port $url } squid_get_stats() { @@ -29,13 +29,13 @@ squid_autodetect() { squid_host="$host" squid_port="$port" squid_url="$url" - echo >&2 "squid: found squid at '$host:$port' with url '$url'" + debug "found squid at '$host:$port' with url '$url'" return 0 fi done done - echo >&2 "squid: cannot find squid running in localhost. Please set squid_url='url' and squid_host='IP' and squid_port='PORT' in $confd/squid.conf" + error "cannot find squid running in localhost. Please set squid_url='url' and squid_host='IP' and squid_port='PORT' in $confd/squid.conf" return 1 } @@ -53,7 +53,7 @@ squid_check() { local x="$(squid_get_stats | grep client_http.requests)" if [ ! $? -eq 0 -o -z "$x" ] then - echo >&2 "squid: cannot fetch URL '$squid_url' by connecting to $squid_host:$squid_port. Please set squid_url='url' and squid_host='host' and squid_port='port' in $confd/squid.conf" + error "cannot fetch URL '$squid_url' by connecting to $squid_host:$squid_port. Please set squid_url='url' and squid_host='host' and squid_port='port' in $confd/squid.conf" return 1 fi |