From e116f7a46d7d868c18c6db0f0c99f1316fd930ef Mon Sep 17 00:00:00 2001 From: Jorge Romero Date: Fri, 6 May 2016 11:10:06 -0400 Subject: [PATCH] Adding tomcat username/password to curl command --- charts.d/tomcat.chart.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/charts.d/tomcat.chart.sh b/charts.d/tomcat.chart.sh index f5a4cb99..2458b984 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 \ -- 2.39.2