summaryrefslogtreecommitdiffstats
path: root/charts.d/squid.chart.sh
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2017-01-24 15:21:09 +0000
committerLennart Weller <lhw@ring0.de>2017-01-24 15:21:09 +0000
commit3ed3b02ed96ddab1c084811f3579b3a2aec83e04 (patch)
tree7a61ab288ae47800c4f11be5677d6ad8288dcd98 /charts.d/squid.chart.sh
parentNew upstream version 1.4.0+dfsg (diff)
downloadnetdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.tar.xz
netdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.zip
New upstream version 1.5.0+dfsgupstream/1.5.0+dfsg
Diffstat (limited to 'charts.d/squid.chart.sh')
-rwxr-xr-xcharts.d/squid.chart.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/charts.d/squid.chart.sh b/charts.d/squid.chart.sh
index 3e72ba6df..2c19c35d5 100755
--- a/charts.d/squid.chart.sh
+++ b/charts.d/squid.chart.sh
@@ -1,5 +1,11 @@
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
squid_host=
squid_port=
squid_url=
@@ -9,7 +15,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 +35,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 +59,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