fix bugs
Wing924 committed
Jul 27, 2017 at 15:41 UTC
7dcd9b46424392eec2a283b2796cfba9ec89d79c
2 files changed
+5
-8
conf.d/python.d/tomcat.conf
+4
-1
@@ -63,7 +63,10 @@
63
# user: 'username'
64
# pass: 'password'
65
#
66
-
66
+# if you have multiple connectors, the following are supported:
67
+#
68
+# connector_name: 'ajp-bio-8009' # default is null, which use first connector in status XML
69
+#
70
# ----------------------------------------------------------------------
71
# AUTO-DETECTION JOBS
72
# only one of them will run (they have the same name)
python.d/tomcat.chart.py
+1
-7
@@ -1,10 +1,8 @@
1
# -*- coding: utf-8 -*-
2
# Description: tomcat netdata python.d module
3
# Author: Pawel Krupa (paulfantom)
4
-# Update author: Wing924
4
5
from base import UrlService
7
-from re import compile
6
import xml.etree.ElementTree as ET
7
8
try:
@@ -47,7 +45,7 @@ CHARTS = {
45
'jvm': {
46
'options': [None, "JVM Memory Pool Usage", "MB", "memory", "tomcat.jvm", "stacked"],
47
'lines': [
50
- ["free", 'free', "absolute", 1, 1048576],
48
+ ["free", 'free', "absolute", 1, 1048576],
49
["eden_used", 'eden', "absolute", 1, 1048576],
50
["survivor_used", 'survivor', "absolute", 1, 1048576],
51
["tenured_used", 'tenured', "absolute", 1, 1048576],
@@ -86,9 +84,6 @@ class Service(UrlService):
84
self.order = ORDER
85
self.definitions = CHARTS
86
89
- def check(self):
90
- return UrlService.check(self) and self._get_data() != None
91
-
87
def _get_data(self):
88
"""
89
Format data received from http request
@@ -114,7 +109,6 @@ class Service(UrlService):
109
memory = jvm.find('memory')
110
data['free'] = memory.get('free')
111
data['total'] = memory.get('total')
117
- data['used'] = int(data['total']) - int(data['free'])
112
113
for pool in jvm.findall('memorypool'):
114
name = pool.get('name')