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/python.d.plugin/monit/monit.chart.py | |
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 '')
-rw-r--r-- | collectors/python.d.plugin/monit/monit.chart.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/collectors/python.d.plugin/monit/monit.chart.py b/collectors/python.d.plugin/monit/monit.chart.py index 51943c0e1..3ac0032c5 100644 --- a/collectors/python.d.plugin/monit/monit.chart.py +++ b/collectors/python.d.plugin/monit/monit.chart.py @@ -6,13 +6,20 @@ import xml.etree.ElementTree as ET from bases.FrameworkServices.UrlService import UrlService -# default module values (can be overridden per job in `config`) -# update_every = 2 -priority = 60000 -retries = 60 # see enum State_Type from monit.h (https://bitbucket.org/tildeslash/monit/src/master/src/monit.h) -MONIT_SERVICE_NAMES = ['Filesystem', 'Directory', 'File', 'Process', 'Host', 'System', 'Fifo', 'Program', 'Net'] +MONIT_SERVICE_NAMES = [ + 'Filesystem', + 'Directory', + 'File', + 'Process', + 'Host', + 'System', + 'Fifo', + 'Program', + 'Net', +] + DEFAULT_SERVICES_IDS = [0, 1, 2, 3, 4, 6, 7, 8] # charts order (can be overridden if you want less charts, or different order) @@ -90,10 +97,10 @@ CHARTS = { class Service(UrlService): def __init__(self, configuration=None, name=None): UrlService.__init__(self, configuration=configuration, name=name) - base_url = self.configuration.get('url', 'http://localhost:2812') - self.url = '{0}/_status?format=xml&level=full'.format(base_url) self.order = ORDER self.definitions = CHARTS + base_url = self.configuration.get('url', 'http://localhost:2812') + self.url = '{0}/_status?format=xml&level=full'.format(base_url) def parse(self, data): try: @@ -105,15 +112,19 @@ class Service(UrlService): def check(self): self._manager = self._build_manager() + raw_data = self._get_raw_data() if not raw_data: return None + return bool(self.parse(raw_data)) def _get_data(self): raw_data = self._get_raw_data() + if not raw_data: return None + xml = self.parse(raw_data) if not xml: return None @@ -121,6 +132,7 @@ class Service(UrlService): data = {} for service_id in DEFAULT_SERVICES_IDS: service_category = MONIT_SERVICE_NAMES[service_id].lower() + if service_category == 'system': self.debug("Skipping service from 'System' category, because it's useless in graphs") continue |