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/nginx.chart.sh | |
parent | c6d3138cc7ddb21bac33df2fc9f16c6e76ff1426 (diff) |
better log management for charts.d.plugin - fixes #1144
Diffstat (limited to 'charts.d/nginx.chart.sh')
-rwxr-xr-x | charts.d/nginx.chart.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/charts.d/nginx.chart.sh b/charts.d/nginx.chart.sh index a2a9b320fa..f0092fd074 100755 --- a/charts.d/nginx.chart.sh +++ b/charts.d/nginx.chart.sh @@ -20,7 +20,7 @@ nginx_reading=0 nginx_writing=0 nginx_waiting=0 nginx_get() { - nginx_response=($(curl -Ss ${nginx_curl_opts} "${nginx_url}")) + nginx_response=($(run curl -Ss ${nginx_curl_opts} "${nginx_url}")) [ $? -ne 0 -o "${#nginx_response[@]}" -eq 0 ] && return 1 if [ "${nginx_response[0]}" != "Active" \ @@ -34,7 +34,7 @@ nginx_get() { -o "${nginx_response[14]}" != "Waiting:" \ ] then - echo >&2 "nginx: Invalid response from nginx server: ${nginx_response[*]}" + error "Invalid response from nginx server: ${nginx_response[*]}" return 1 fi @@ -55,7 +55,7 @@ nginx_get() { -o -z "${nginx_waiting}" \ ] then - echo >&2 "nginx: empty values got from nginx server: ${nginx_response[*]}" + error "empty values got from nginx server: ${nginx_response[*]}" return 1 fi @@ -68,7 +68,7 @@ nginx_check() { nginx_get if [ $? -ne 0 ] then - echo >&2 "nginx: cannot find stub_status on URL '${nginx_url}'. Please set nginx_url='http://nginx.server/stub_status' in $confd/nginx.conf" + error "cannot find stub_status on URL '${nginx_url}'. Please set nginx_url='http://nginx.server/stub_status' in $confd/nginx.conf" return 1 fi |