@cryptotaxi247 / netdata-1 / commits / 54cdcbc34

"apache" module fixes

lgz committed Oct 13, 2017 at 21:03 UTC 54cdcbc343a63f6e14fd54bbeb792e76dd9fdc5c
1 file changed +13 -10
python.d/apache.chart.py
+13 -10
@@ -2,7 +2,7 @@
2 # Description: apache netdata python.d module
3 # Author: Pawel Krupa (paulfantom)
4
5 -from base import UrlService
5 +from bases.FrameworkServices.UrlService import UrlService
6
7 # default module values (can be overridden per job in `config`)
8 # update_every = 2
@@ -94,15 +94,18 @@ class Service(UrlService):
94 self.url = self.configuration.get('url', 'http://localhost/server-status?auto')
95
96 def check(self):
97 - if UrlService.check(self):
98 - if 'idle_servers' in self._data_from_check:
99 - self.__module__ = 'lighttpd'
100 - for chart in self.definitions:
101 - opts = self.definitions[chart]['options']
102 - opts[1] = opts[1].replace('apache', 'lighttpd')
103 - opts[4] = opts[4].replace('apache', 'lighttpd')
104 - return True
105 - return False
97 + self._manager = self._build_manager()
98 + data = self._get_data()
99 + if not data:
100 + return None
101 +
102 + if 'idle_servers' in data:
103 + self.module_name = 'lighttpd'
104 + for chart in self.definitions:
105 + opts = self.definitions[chart]['options']
106 + opts[1] = opts[1].replace('apache', 'lighttpd')
107 + opts[4] = opts[4].replace('apache', 'lighttpd')
108 + return True
109
110 def _get_data(self):
111 """