Adding tomcat username/password to curl command
Jorge Romero committed
May 6, 2016 at 11:10 UTC
e116f7a46d7d868c18c6db0f0c99f1316fd930ef
1 file changed
+5
-1
charts.d/tomcat.chart.sh
+5
-1
@@ -6,6 +6,10 @@
6
# the URL to download tomcat status info
7
tomcat_url="http://localhost:8080/manager/status?XML=true"
8
9
+# set tomcat user/password here
10
+tomcatUser=""
11
+tomcatPassword=""
12
+
13
# _update_every is a special variable - it holds the number of seconds
14
# between the calls of the _update() function
15
tomcat_update_every=
@@ -41,7 +45,7 @@ tomcat_check() {
45
46
tomcat_get() {
47
# Collect tomcat values
44
- mapfile -t lines < <(curl -Ss "$tomcat_url" |\
48
+ mapfile -t lines < <(curl -u "$tomcatUser":"$tomcatPassword" -Ss "$tomcat_url" |\
49
xmlstarlet sel \
50
-t -m "/status/jvm/memory" -v @free \
51
-n -m "/status/connector[@name='\"http-bio-8080\"']/threadInfo" -v @currentThreadCount \