diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
commit | 8a7b72f7cd1ccd547a03eb4243294e741d661d3f (patch) | |
tree | 7bc7be4a8e9e298daa1349348400aa2a653866f2 /collectors/charts.d.plugin/tomcat | |
parent | New upstream version 1.11.1+dfsg (diff) | |
download | netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.tar.xz netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.zip |
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin/tomcat')
-rw-r--r-- | collectors/charts.d.plugin/tomcat/README.md | 6 | ||||
-rw-r--r-- | collectors/charts.d.plugin/tomcat/tomcat.chart.sh | 26 |
2 files changed, 19 insertions, 13 deletions
diff --git a/collectors/charts.d.plugin/tomcat/README.md b/collectors/charts.d.plugin/tomcat/README.md index d82951aac..843378604 100644 --- a/collectors/charts.d.plugin/tomcat/README.md +++ b/collectors/charts.d.plugin/tomcat/README.md @@ -1,2 +1,6 @@ +# tomcat + > THIS MODULE IS OBSOLETE. -> USE THE PYTHON ONE - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT +> USE [THE PYTHON ONE](../../python.d.plugin/tomcat) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT + +[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Ftomcat%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]() diff --git a/collectors/charts.d.plugin/tomcat/tomcat.chart.sh b/collectors/charts.d.plugin/tomcat/tomcat.chart.sh index 294487b8b..9ca75e63e 100644 --- a/collectors/charts.d.plugin/tomcat/tomcat.chart.sh +++ b/collectors/charts.d.plugin/tomcat/tomcat.chart.sh @@ -32,24 +32,23 @@ tomcat_priority=60000 # will be in the proper units tomcat_decimal_detail=1000000 -# used by volume chart to convert bytes to KB -tomcat_decimal_KB_detail=1000 +# used by volume chart to convert bytes to kB +tomcat_decimal_kB_detail=1000 tomcat_check() { require_cmd xmlstarlet || return 1 - # check if url, username, passwords are set if [ -z "${tomcat_url}" ]; then - error "tomcat url is unset or set to the empty string" + error "tomcat url is unset or set to the empty string" return 1 fi if [ -z "${tomcat_user}" ]; then # check backwards compatibility # shellcheck disable=SC2154 if [ -z "${tomcatUser}" ]; then - error "tomcat user is unset or set to the empty string" + error "tomcat user is unset or set to the empty string" return 1 else tomcat_user="${tomcatUser}" @@ -59,7 +58,7 @@ tomcat_check() { # check backwards compatibility # shellcheck disable=SC2154 if [ -z "${tomcatPassword}" ]; then - error "tomcat password is unset or set to the empty string" + error "tomcat password is unset or set to the empty string" return 1 else tomcat_password="${tomcatPassword}" @@ -69,8 +68,7 @@ tomcat_check() { # check if we can get to tomcat's status page tomcat_get # shellcheck disable=2181 - if [ $? -ne 0 ] - then + if [ $? -ne 0 ]; then error "cannot get to status page on URL '${tomcat_url}'. Please make sure tomcat url, username and password are correct." return 1 fi @@ -84,8 +82,12 @@ tomcat_check() { tomcat_get() { # collect tomcat values - tomcat_port="$(IFS=/ read -ra a <<< "$tomcat_url"; hostport=${a[2]}; echo "${hostport#*:}")" - mapfile -t lines < <(run curl -u "$tomcat_user":"$tomcat_password" -Ss ${tomcat_curl_opts} "$tomcat_url" |\ + tomcat_port="$( + IFS=/ read -ra a <<<"$tomcat_url" + hostport=${a[2]} + echo "${hostport#*:}" + )" + mapfile -t lines < <(run curl -u "$tomcat_user":"$tomcat_password" -Ss ${tomcat_curl_opts} "$tomcat_url" | run xmlstarlet sel \ -t -m "/status/jvm/memory" -v @free \ -n -m "/status/connector[@name='\"http-bio-$tomcat_port\"']/threadInfo" -v @currentThreadCount \ @@ -107,8 +109,8 @@ tomcat_create() { cat <<EOF CHART tomcat.accesses '' "tomcat requests" "requests/s" statistics tomcat.accesses area $((tomcat_priority + 8)) $tomcat_update_every DIMENSION accesses '' incremental -CHART tomcat.volume '' "tomcat volume" "KB/s" volume tomcat.volume area $((tomcat_priority + 5)) $tomcat_update_every -DIMENSION volume '' incremental divisor ${tomcat_decimal_KB_detail} +CHART tomcat.volume '' "tomcat volume" "kB/s" volume tomcat.volume area $((tomcat_priority + 5)) $tomcat_update_every +DIMENSION volume '' incremental divisor ${tomcat_decimal_kB_detail} CHART tomcat.threads '' "tomcat threads" "current threads" statistics tomcat.threads line $((tomcat_priority + 6)) $tomcat_update_every DIMENSION current '' absolute 1 DIMENSION busy '' absolute 1 |