summaryrefslogtreecommitdiffstats
path: root/charts.d/tomcat.chart.sh
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-05-23 20:23:57 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-05-23 20:23:57 +0300
commit17053582ff88c91b5692e7a54ec85ee6973b86d9 (patch)
tree2d2c00568a53bfd1f10b42dd10e6458c58d8cb4d /charts.d/tomcat.chart.sh
parenteb35d9fb315b26850c27643e8e6bf8dadb3dae6e (diff)
support custom curl options in charts.d plugins
Diffstat (limited to 'charts.d/tomcat.chart.sh')
-rwxr-xr-xcharts.d/tomcat.chart.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/charts.d/tomcat.chart.sh b/charts.d/tomcat.chart.sh
index f7809ddd31..b0eddc7f0d 100755
--- a/charts.d/tomcat.chart.sh
+++ b/charts.d/tomcat.chart.sh
@@ -6,6 +6,7 @@
# the URL to download tomcat status info
# usually http://localhost:8080/manager/status?XML=true
tomcat_url=""
+tomcat_curl_opts=""
# set tomcat username/password here
tomcatUser=""
@@ -64,7 +65,7 @@ tomcat_check() {
tomcat_get() {
# collect tomcat values
tomcat_port="$(IFS=/ read -ra a <<< "$tomcat_url"; hostport=${a[2]}; echo "${hostport#*:}")"
- mapfile -t lines < <(curl -u "$tomcatUser":"$tomcatPassword" -Ss "$tomcat_url" |\
+ mapfile -t lines < <(curl -u "$tomcatUser":"$tomcatPassword" -Ss ${tomcat_curl_opts} "$tomcat_url" |\
xmlstarlet sel \
-t -m "/status/jvm/memory" -v @free \
-n -m "/status/connector[@name='\"http-bio-$tomcat_port\"']/threadInfo" -v @currentThreadCount \