diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
commit | a8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch) | |
tree | 77f0a30f016c0925cf7ee9292e644bba183c2774 /collectors/python.d.plugin/monit | |
parent | Adding upstream version 1.19.0. (diff) | |
download | netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip |
Adding upstream version 1.29.0.upstream/1.29.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.md | 18 | ||||
-rw-r--r-- | collectors/python.d.plugin/monit/monit.chart.py | 28 |
2 files changed, 38 insertions, 8 deletions
diff --git a/collectors/python.d.plugin/monit/README.md b/collectors/python.d.plugin/monit/README.md index a54b9d67f..fe1389687 100644 --- a/collectors/python.d.plugin/monit/README.md +++ b/collectors/python.d.plugin/monit/README.md @@ -1,4 +1,10 @@ -# monit +<!-- +title: "Monit monitoring with Netdata" +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/python.d.plugin/monit/README.md +sidebar_label: "Monit" +--> + +# Monit monitoring with Netdata Monit monitoring module. Data is grabbed from stats XML interface (exists for a long time, but not mentioned in official documentation). Mostly this plugin shows statuses of monit targets, i.e. [statuses of specified checks](https://mmonit.com/monit/documentation/monit.html#Service-checks). @@ -19,7 +25,15 @@ Monit monitoring module. Data is grabbed from stats XML interface (exists for a - Hosts (+latency) - Network interfaces -## configuration +## Configuration + +Edit the `python.d/monit.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config python.d/monit.conf +``` Sample: diff --git a/collectors/python.d.plugin/monit/monit.chart.py b/collectors/python.d.plugin/monit/monit.chart.py index 9f3270572..bfc182349 100644 --- a/collectors/python.d.plugin/monit/monit.chart.py +++ b/collectors/python.d.plugin/monit/monit.chart.py @@ -4,12 +4,10 @@ # SPDX-License-Identifier: GPL-3.0-or-later import xml.etree.ElementTree as ET - from collections import namedtuple from bases.FrameworkServices.UrlService import UrlService - MonitType = namedtuple('MonitType', ('index', 'name')) # see enum Service_Type from monit.h (https://bitbucket.org/tildeslash/monit/src/master/src/monit.h) @@ -122,7 +120,7 @@ CHARTS = { class BaseMonitService(object): - def __init__(self, typ, name, status, monitor): + def __init__(self, typ, name, status, monitor): self.type = typ self.name = name self.status = status @@ -153,12 +151,21 @@ class BaseMonitService(object): class ProcessMonitService(BaseMonitService): - def __init__(self, typ, name, status, monitor): + def __init__(self, typ, name, status, monitor): super(ProcessMonitService, self).__init__(typ, name, status, monitor) self.uptime = None self.threads = None self.children = None + def __eq__(self, other): + return super(ProcessMonitService, self).__eq__(other) + + def __ne__(self, other): + return super(ProcessMonitService, self).__ne__(other) + + def __hash__(self): + return super(ProcessMonitService, self).__hash__() + def uptime_key(self): return 'process_uptime_{0}'.format(self.name) @@ -183,16 +190,25 @@ class ProcessMonitService(BaseMonitService): class HostMonitService(BaseMonitService): - def __init__(self, typ, name, status, monitor): + def __init__(self, typ, name, status, monitor): super(HostMonitService, self).__init__(typ, name, status, monitor) self.latency = None + def __eq__(self, other): + return super(HostMonitService, self).__eq__(other) + + def __ne__(self, other): + return super(HostMonitService, self).__ne__(other) + + def __hash__(self): + return super(HostMonitService, self).__hash__() + def latency_key(self): return 'host_latency_{0}'.format(self.name) def data(self): base_data = super(HostMonitService, self).data() - latency = float(self.latency) * 1000000 if self.latency else None + latency = float(self.latency) * 1000000 if self.latency else None data = {self.latency_key(): latency} data.update(base_data) |