]> arthur.barton.de Git - netdata.git/commitdiff
Adding tomcat username/password to curl command
authorJorge Romero <Jorge.Romero@openbondx.com>
Fri, 6 May 2016 15:10:06 +0000 (11:10 -0400)
committerJorge Romero <Jorge.Romero@openbondx.com>
Fri, 6 May 2016 15:10:06 +0000 (11:10 -0400)
charts.d/tomcat.chart.sh

index f5a4cb99edb094f9c71f789c1f939d2ff5bbee0c..2458b984c41909a8872bc46d1d1e72c1c41cbe8e 100755 (executable)
@@ -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 \