summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-04-21 02:03:59 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-04-21 02:03:59 +0300
commitdb16450bd8ef9e93cd557d75e92cba5a87c1fb73 (patch)
treed2166b2f8b019be72b928d69909e37c922442cfd
parent37cb08efe88d63174877ebaa1868298e862caafd (diff)
added option -Ss to curl so that errors are logged
-rwxr-xr-xcharts.d/apache.chart.sh2
-rwxr-xr-xcharts.d/nginx.chart.sh2
-rwxr-xr-x[-rw-r--r--]charts.d/phpfpm.chart.sh2
-rwxr-xr-xcharts.d/tomcat.chart.sh8
4 files changed, 10 insertions, 4 deletions
diff --git a/charts.d/apache.chart.sh b/charts.d/apache.chart.sh
index 9b6d53b539..c0fd3dc30f 100755
--- a/charts.d/apache.chart.sh
+++ b/charts.d/apache.chart.sh
@@ -94,7 +94,7 @@ apache_detect() {
apache_get() {
local oIFS="${IFS}" ret
- IFS=$':\n' apache_response=($(curl -s "${apache_url}"))
+ IFS=$':\n' apache_response=($(curl -Ss "${apache_url}"))
ret=$?
IFS="${oIFS}"
diff --git a/charts.d/nginx.chart.sh b/charts.d/nginx.chart.sh
index a6795415b4..91f269be2f 100755
--- a/charts.d/nginx.chart.sh
+++ b/charts.d/nginx.chart.sh
@@ -19,7 +19,7 @@ nginx_reading=0
nginx_writing=0
nginx_waiting=0
nginx_get() {
- nginx_response=($(curl -s "${nginx_url}"))
+ nginx_response=($(curl -Ss "${nginx_url}"))
[ $? -ne 0 -o "${#nginx_response[@]}" -eq 0 ] && return 1
if [ "${nginx_response[0]}" != "Active" \
diff --git a/charts.d/phpfpm.chart.sh b/charts.d/phpfpm.chart.sh
index 4c54aa522e..60e6b2c102 100644..100755
--- a/charts.d/phpfpm.chart.sh
+++ b/charts.d/phpfpm.chart.sh
@@ -30,7 +30,7 @@ phpfpm_max_children_reached=0
phpfpm_slow_requests=0
phpfpm_get() {
url=$1
- phpfpm_response=($(curl -s "${url}"))
+ phpfpm_response=($(curl -Ss "${url}"))
[ $? -ne 0 -o "${#phpfpm_response[@]}" -eq 0 ] && return 1
if [[ "${phpfpm_response[0]}" != "pool:" \
diff --git a/charts.d/tomcat.chart.sh b/charts.d/tomcat.chart.sh
index 55476f425e..5ca85e8cf7 100755
--- a/charts.d/tomcat.chart.sh
+++ b/charts.d/tomcat.chart.sh
@@ -41,7 +41,13 @@ tomcat_check() {
tomcat_get() {
# Collect tomcat values
- mapfile -t lines < <(curl -s "$tomcat_url" | xmlstarlet sel -t -m "/status/jvm/memory" -v @free -n -m "/status/connector[@name='\"http-bio-8080\"']/threadInfo" -v @currentThreadCount -n -v @currentThreadsBusy -n -m "/status/connector[@name='\"http-bio-8080\"']/requestInfo" -v @requestCount -n -v @bytesSent -n -)
+ mapfile -t lines < <(curl -Ss "$tomcat_url" |\
+ xmlstarlet sel \
+ -t -m "/status/jvm/memory" -v @free \
+ -n -m "/status/connector[@name='\"http-bio-8080\"']/threadInfo" -v @currentThreadCount \
+ -n -v @currentThreadsBusy \
+ -n -m "/status/connector[@name='\"http-bio-8080\"']/requestInfo" -v @requestCount \
+ -n -v @bytesSent -n -)
tomcat_jvm_freememory="${lines[0]}"
tomcat_threads="${lines[1]}"