summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/monit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:30:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:30:37 +0000
commit8a7b72f7cd1ccd547a03eb4243294e741d661d3f (patch)
tree7bc7be4a8e9e298daa1349348400aa2a653866f2 /collectors/python.d.plugin/monit
parentNew upstream version 1.11.1+dfsg (diff)
downloadnetdata-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/python.d.plugin/monit')
-rw-r--r--collectors/python.d.plugin/monit/README.md2
-rw-r--r--collectors/python.d.plugin/monit/monit.chart.py26
-rw-r--r--collectors/python.d.plugin/monit/monit.conf10
3 files changed, 25 insertions, 13 deletions
diff --git a/collectors/python.d.plugin/monit/README.md b/collectors/python.d.plugin/monit/README.md
index 6d10240c9..0f69aff29 100644
--- a/collectors/python.d.plugin/monit/README.md
+++ b/collectors/python.d.plugin/monit/README.md
@@ -31,3 +31,5 @@ local:
If no configuration is given, module will attempt to connect to monit as `http://localhost:2812`.
---
+
+[![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%2Fpython.d.plugin%2Fmonit%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
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
diff --git a/collectors/python.d.plugin/monit/monit.conf b/collectors/python.d.plugin/monit/monit.conf
index f9c26dbc3..9a3fb6938 100644
--- a/collectors/python.d.plugin/monit/monit.conf
+++ b/collectors/python.d.plugin/monit/monit.conf
@@ -27,11 +27,9 @@
# If unset, the default for python.d.plugin is used.
# priority: 60000
-# retries sets the number of retries to be made in case of failures.
-# If unset, the default for python.d.plugin is used.
-# Attempts to restore the service are made once every update_every
-# and only if the module has collected values in the past.
-# retries: 60
+# penalty indicates whether to apply penalty to update_every in case of failures.
+# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
+# penalty: yes
# autodetection_retry sets the job re-check interval in seconds.
# The job is not deleted if check fails.
@@ -58,7 +56,7 @@
# # JOBs sharing a name are mutually exclusive
# update_every: 1 # the JOB's data collection frequency
# priority: 60000 # the JOB's order on the dashboard
-# retries: 60 # the JOB's number of restoration attempts
+# penalty: yes # the JOB's penalty
# autodetection_retry: 0 # the JOB's re-check interval in seconds
#
# Additionally to the above, this plugin also supports the following: