diff options
author | Jeff Peeler <jpeeler@gmail.com> | 2016-04-04 14:35:01 -0400 |
---|---|---|
committer | Jeff Peeler <jpeeler@redhat.com> | 2016-04-04 14:54:28 -0400 |
commit | 2984fb9414b74e52423910a03356f6bb1381b404 (patch) | |
tree | 53f16c89a4e1fd7f1bdc8502c385822cb19d8264 /charts.d/squid.chart.sh | |
parent | a44f48981dba80bd4376226a7b30b3534660a855 (diff) |
Change squid polling to use squidclient
Use squidclient instead of manually aggregating data from netcat. This
should allow for a more supported and robust operation.
Diffstat (limited to 'charts.d/squid.chart.sh')
-rwxr-xr-x | charts.d/squid.chart.sh | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/charts.d/squid.chart.sh b/charts.d/squid.chart.sh index 6260ce97f7..5e1ebb0624 100755 --- a/charts.d/squid.chart.sh +++ b/charts.d/squid.chart.sh @@ -9,14 +9,7 @@ squid_priority=60000 squid_get_stats_internal() { local host="$1" port="$2" url="$3" - - nc -w $squid_timeout $host $port <<EOF -GET $url HTTP/1.0 -Host: $host:$port -Accept: */* -User-Agent: netdata (charts.d/squid.chart.sh) - -EOF + squidclient -h $host -p $port $url } squid_get_stats() { @@ -47,8 +40,8 @@ squid_autodetect() { } squid_check() { - require_cmd nc || return 1 - require_cmd sed || return 1 + require_cmd squidclient || return 1 + require_cmd sed || return 1 require_cmd egrep || return 1 if [ -z "$squid_host" -o -z "$squid_port" -o -z "$squid_url" ] |