summaryrefslogtreecommitdiffstats
path: root/charts.d/tomcat.chart.sh
diff options
context:
space:
mode:
authorJorge Romero <Jorge.Romero@openbondx.com>2016-05-06 11:10:06 -0400
committerJorge Romero <Jorge.Romero@openbondx.com>2016-05-06 11:10:06 -0400
commite116f7a46d7d868c18c6db0f0c99f1316fd930ef (patch)
tree4d5729ca0086b5e97914267b0f9c5b5ef0132ad1 /charts.d/tomcat.chart.sh
parent48daed42d439941f09c58b1655ba26a78d3b1667 (diff)
Adding tomcat username/password to curl command
Diffstat (limited to 'charts.d/tomcat.chart.sh')
-rwxr-xr-xcharts.d/tomcat.chart.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/charts.d/tomcat.chart.sh b/charts.d/tomcat.chart.sh
index f5a4cb99ed..2458b984c4 100755
--- a/charts.d/tomcat.chart.sh
+++ b/charts.d/tomcat.chart.sh
@@ -6,6 +6,10 @@
# the URL to download tomcat status info
tomcat_url="http://localhost:8080/manager/status?XML=true"
+# set tomcat user/password here
+tomcatUser=""
+tomcatPassword=""
+
# _update_every is a special variable - it holds the number of seconds
# between the calls of the _update() function
tomcat_update_every=
@@ -41,7 +45,7 @@ tomcat_check() {
tomcat_get() {
# Collect tomcat values
- mapfile -t lines < <(curl -Ss "$tomcat_url" |\
+ mapfile -t lines < <(curl -u "$tomcatUser":"$tomcatPassword" -Ss "$tomcat_url" |\
xmlstarlet sel \
-t -m "/status/jvm/memory" -v @free \
-n -m "/status/connector[@name='\"http-bio-8080\"']/threadInfo" -v @currentThreadCount \