From 87d772a7d708fec12f48cd8adc0dedff6e1025da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 26 Aug 2024 10:15:20 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- src/go/plugin/go.d/modules/monit/README.md | 1 + src/go/plugin/go.d/modules/monit/charts.go | 91 +++ src/go/plugin/go.d/modules/monit/collect.go | 117 ++++ .../plugin/go.d/modules/monit/config_schema.json | 185 ++++++ .../go.d/modules/monit/integrations/monit.md | 255 ++++++++ src/go/plugin/go.d/modules/monit/metadata.yaml | 193 ++++++ src/go/plugin/go.d/modules/monit/monit.go | 117 ++++ src/go/plugin/go.d/modules/monit/monit_test.go | 371 +++++++++++ src/go/plugin/go.d/modules/monit/status.go | 153 +++++ .../plugin/go.d/modules/monit/testdata/config.json | 20 + .../plugin/go.d/modules/monit/testdata/config.yaml | 17 + .../go.d/modules/monit/testdata/v5.33.0/status.xml | 688 +++++++++++++++++++++ 12 files changed, 2208 insertions(+) create mode 120000 src/go/plugin/go.d/modules/monit/README.md create mode 100644 src/go/plugin/go.d/modules/monit/charts.go create mode 100644 src/go/plugin/go.d/modules/monit/collect.go create mode 100644 src/go/plugin/go.d/modules/monit/config_schema.json create mode 100644 src/go/plugin/go.d/modules/monit/integrations/monit.md create mode 100644 src/go/plugin/go.d/modules/monit/metadata.yaml create mode 100644 src/go/plugin/go.d/modules/monit/monit.go create mode 100644 src/go/plugin/go.d/modules/monit/monit_test.go create mode 100644 src/go/plugin/go.d/modules/monit/status.go create mode 100644 src/go/plugin/go.d/modules/monit/testdata/config.json create mode 100644 src/go/plugin/go.d/modules/monit/testdata/config.yaml create mode 100644 src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml (limited to 'src/go/plugin/go.d/modules/monit') diff --git a/src/go/plugin/go.d/modules/monit/README.md b/src/go/plugin/go.d/modules/monit/README.md new file mode 120000 index 00000000..ac69496f --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/README.md @@ -0,0 +1 @@ +integrations/monit.md \ No newline at end of file diff --git a/src/go/plugin/go.d/modules/monit/charts.go b/src/go/plugin/go.d/modules/monit/charts.go new file mode 100644 index 00000000..58fcf6c7 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/charts.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioServiceCheckStatus = module.Priority + iota + prioUptime +) + +var baseCharts = module.Charts{ + uptimeChart.Copy(), +} + +var ( + uptimeChart = module.Chart{ + ID: "uptime", + Title: "Uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "monit.uptime", + Priority: prioUptime, + Dims: module.Dims{ + {ID: "uptime"}, + }, + } +) + +var serviceCheckChartsTmpl = module.Charts{ + serviceCheckStatusChartTmpl.Copy(), +} + +var ( + serviceCheckStatusChartTmpl = module.Chart{ + ID: "service_check_type_%s_name_%s_status", + Title: "Service Check Status", + Units: "status", + Fam: "service status", + Ctx: "monit.service_check_status", + Priority: prioServiceCheckStatus, + Dims: module.Dims{ + {ID: "service_check_type_%s_name_%s_status_ok", Name: "ok"}, + {ID: "service_check_type_%s_name_%s_status_error", Name: "error"}, + {ID: "service_check_type_%s_name_%s_status_initializing", Name: "initializing"}, + {ID: "service_check_type_%s_name_%s_status_not_monitored", Name: "not_monitored"}, + }, + } +) + +func (m *Monit) addServiceCheckCharts(svc statusServiceCheck, srv *statusServer) { + charts := serviceCheckChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = cleanChartId(fmt.Sprintf(chart.ID, svc.svcType(), svc.Name)) + chart.Labels = []module.Label{ + {Key: "server_hostname", Value: srv.LocalHostname}, + {Key: "service_check_name", Value: svc.Name}, + {Key: "service_check_type", Value: svc.svcType()}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, svc.svcType(), svc.Name) + } + } + + if err := m.Charts().Add(*charts...); err != nil { + m.Warning(err) + } +} + +func (m *Monit) removeServiceCharts(svc statusServiceCheck) { + px := fmt.Sprintf("service_check_type_%s_name_%s_", svc.svcType(), svc.Name) + px = cleanChartId(px) + + for _, chart := range *m.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanChartId(s string) string { + r := strings.NewReplacer(" ", "_", ".", "_", ",", "_") + return r.Replace(s) +} diff --git a/src/go/plugin/go.d/modules/monit/collect.go b/src/go/plugin/go.d/modules/monit/collect.go new file mode 100644 index 00000000..580aa6d9 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/collect.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "encoding/xml" + "errors" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "golang.org/x/net/html/charset" +) + +var ( + urlPathStatus = "/_status" + urlQueryStatus = url.Values{"format": {"xml"}, "level": {"full"}}.Encode() +) + +func (m *Monit) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := m.collectStatus(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (m *Monit) collectStatus(mx map[string]int64) error { + status, err := m.fetchStatus() + if err != nil { + return err + } + + if status.Server == nil { + // not Monit + return errors.New("invalid Monit status response: missing server data") + } + + mx["uptime"] = status.Server.Uptime + + seen := make(map[string]bool) + + for _, svc := range status.Services { + seen[svc.id()] = true + + if _, ok := m.seenServices[svc.id()]; !ok { + m.seenServices[svc.id()] = svc + m.addServiceCheckCharts(svc, status.Server) + } + + px := fmt.Sprintf("service_check_type_%s_name_%s_status_", svc.svcType(), svc.Name) + + for _, v := range []string{"not_monitored", "ok", "initializing", "error"} { + mx[px+v] = 0 + if svc.status() == v { + mx[px+v] = 1 + } + } + } + + for id, svc := range m.seenServices { + if !seen[id] { + delete(m.seenServices, id) + m.removeServiceCharts(svc) + } + } + + return nil +} + +func (m *Monit) fetchStatus() (*monitStatus, error) { + req, err := web.NewHTTPRequestWithPath(m.Request, urlPathStatus) + if err != nil { + return nil, err + } + req.URL.RawQuery = urlQueryStatus + + var status monitStatus + if err := m.doOKDecode(req, &status); err != nil { + return nil, err + } + + return &status, nil +} + +func (m *Monit) doOKDecode(req *http.Request, in interface{}) error { + resp, err := m.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + dec := xml.NewDecoder(resp.Body) + dec.CharsetReader = charset.NewReaderLabel + + if err := dec.Decode(in); err != nil { + return fmt.Errorf("error on decoding XML response from '%s': %v", req.URL, err) + } + + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/monit/config_schema.json b/src/go/plugin/go.d/modules/monit/config_schema.json new file mode 100644 index 00000000..4d23760b --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/config_schema.json @@ -0,0 +1,185 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Monit collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL of the Monit server.", + "type": "string", + "default": "http://127.0.0.1:2812", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true, + "default": "admin" + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true, + "default": "monit" + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/monit/integrations/monit.md b/src/go/plugin/go.d/modules/monit/integrations/monit.md new file mode 100644 index 00000000..8d3739ac --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/integrations/monit.md @@ -0,0 +1,255 @@ + + +# Monit + + + + + +Plugin: go.d.plugin +Module: monit + + + +## Overview + +This collector monitors status of Monit's service checks. + + +It sends HTTP requests to the Monit `/_status?format=xml&level=full` endpoint. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Monit instances running on localhost that are listening on port 2812. +On startup, it tries to collect metrics from: + +- http://127.0.0.1:2812 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per service + +These metrics refer to the monitored Service. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| server_hostname | Hostname of the Monit server. | +| service_check_name | Service check name. | +| service_check_type | Service check type. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| monit.service_check_status | ok, error, initializing, not_monitored | status | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable TCP PORT + +See [Syntax for TCP port](https://mmonit.com/monit/documentation/monit.html#TCP-PORT) for details. + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/monit.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/monit.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +
Config options + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:2812 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | admin | no | +| password | Password for basic HTTP authentication. | monit | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | GET | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +
+ +#### Examples + +##### HTTP authentication + +Basic HTTP authentication. + +
Config + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + username: admin + password: monit + +``` +
+ +##### HTTPS with self-signed certificate + +With enabled HTTPS and self-signed certificate. + +
Config + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + tls_skip_verify: yes + +``` +
+ +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +
Config + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + + - name: remote + url: http://192.0.2.1:2812 + +``` +
+ + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `monit` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m monit + ``` + +### Getting Logs + +If you're encountering problems with the `monit` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep monit +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep monit /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep monit +``` + + diff --git a/src/go/plugin/go.d/modules/monit/metadata.yaml b/src/go/plugin/go.d/modules/monit/metadata.yaml new file mode 100644 index 00000000..d5479398 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/metadata.yaml @@ -0,0 +1,193 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-monit + plugin_name: go.d.plugin + module_name: monit + monitored_instance: + name: Monit + link: https://mmonit.com/monit/ + categories: + - data-collection.synthetic-checks + icon_filename: monit.png + related_resources: + integrations: + list: [] + alternative_monitored_instances: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - monit + - mmonit + - supervision tool + - monitrc + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors status of Monit's service checks. + method_description: | + It sends HTTP requests to the Monit `/_status?format=xml&level=full` endpoint. + default_behavior: + auto_detection: + description: | + By default, it detects Monit instances running on localhost that are listening on port 2812. + On startup, it tries to collect metrics from: + + - http://127.0.0.1:2812 + limits: + description: "" + performance_impact: + description: "" + additional_permissions: + description: "" + multi_instance: true + supported_platforms: + include: [] + exclude: [] + setup: + prerequisites: + list: + - title: Enable TCP PORT + description: + See [Syntax for TCP port](https://mmonit.com/monit/documentation/monit.html#TCP-PORT) for details. + configuration: + file: + name: go.d/monit.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:2812 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "admin" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "monit" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: GET + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: HTTP authentication + description: Basic HTTP authentication. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + username: admin + password: monit + - name: HTTPS with self-signed certificate + description: With enabled HTTPS and self-signed certificate. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + tls_skip_verify: yes + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + + - name: remote + url: http://192.0.2.1:2812 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: service + description: These metrics refer to the monitored Service. + labels: + - name: server_hostname + description: Hostname of the Monit server. + - name: service_check_name + description: Service check name. + - name: service_check_type + description: Service check type. + metrics: + - name: monit.service_check_status + description: Service Check Status + unit: status + chart_type: line + dimensions: + - name: ok + - name: error + - name: initializing + - name: not_monitored diff --git a/src/go/plugin/go.d/modules/monit/monit.go b/src/go/plugin/go.d/modules/monit/monit.go new file mode 100644 index 00000000..d0fe90b1 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/monit.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("monit", module.Creator{ + Create: func() module.Module { return New() }, + JobConfigSchema: configSchema, + Config: func() any { return &Config{} }, + }) +} + +func New() *Monit { + return &Monit{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:2812", + Username: "admin", + Password: "monit", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second), + }, + }, + }, + charts: baseCharts.Copy(), + seenServices: make(map[string]statusServiceCheck), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Monit struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client + + seenServices map[string]statusServiceCheck +} + +func (m *Monit) Configuration() any { + return m.Config +} + +func (m *Monit) Init() error { + if m.URL == "" { + m.Error("config: monit url is required but not set") + return errors.New("config: missing URL") + } + + httpClient, err := web.NewHTTPClient(m.Client) + if err != nil { + m.Errorf("init HTTP client: %v", err) + return err + } + m.httpClient = httpClient + + m.Debugf("using URL %s", m.URL) + m.Debugf("using timeout: %s", m.Timeout) + + return nil +} + +func (m *Monit) Check() error { + mx, err := m.collect() + if err != nil { + m.Error(err) + return err + } + if len(mx) == 0 { + return errors.New("no metrics collected") + + } + return nil +} + +func (m *Monit) Charts() *module.Charts { + return m.charts +} + +func (m *Monit) Collect() map[string]int64 { + mx, err := m.collect() + if err != nil { + m.Error(err) + } + + if len(mx) == 0 { + return nil + } + return mx +} + +func (m *Monit) Cleanup() { + if m.httpClient != nil { + m.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/monit/monit_test.go b/src/go/plugin/go.d/modules/monit/monit_test.go new file mode 100644 index 00000000..7735dcdc --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/monit_test.go @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStatus, _ = os.ReadFile("testdata/v5.33.0/status.xml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStatus": dataStatus, + } { + require.NotNil(t, data, name) + + } +} + +func TestMonit_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Monit{}, dataConfigJSON, dataConfigYAML) +} + +func TestMonit_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit := New() + monit.Config = test.config + + if test.wantFail { + assert.Error(t, monit.Init()) + } else { + assert.NoError(t, monit.Init()) + } + }) + } +} + +func TestMonit_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (monit *Monit, cleanup func()) + }{ + "success on valid response": { + wantFail: false, + prepare: caseOk, + }, + "fail on unexpected XML response": { + wantFail: true, + prepare: caseUnexpectedXMLResponse, + }, + "fail on invalid data response": { + wantFail: true, + prepare: caseInvalidDataResponse, + }, + "fail on connection refused": { + wantFail: true, + prepare: caseConnectionRefused, + }, + "fail on 404 response": { + wantFail: true, + prepare: case404, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, monit.Check()) + } else { + assert.NoError(t, monit.Check()) + } + }) + } +} + +func TestMonit_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestMonit_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (monit *Monit, cleanup func()) + wantNumOfCharts int + wantMetrics map[string]int64 + }{ + "success on valid response": { + prepare: caseOk, + wantNumOfCharts: len(baseCharts) + len(serviceCheckChartsTmpl)*25, + wantMetrics: map[string]int64{ + "service_check_type_directory_name_directoryAlert_status_error": 1, + "service_check_type_directory_name_directoryAlert_status_initializing": 0, + "service_check_type_directory_name_directoryAlert_status_not_monitored": 0, + "service_check_type_directory_name_directoryAlert_status_ok": 0, + "service_check_type_directory_name_directoryDisabled_status_error": 0, + "service_check_type_directory_name_directoryDisabled_status_initializing": 0, + "service_check_type_directory_name_directoryDisabled_status_not_monitored": 1, + "service_check_type_directory_name_directoryDisabled_status_ok": 0, + "service_check_type_directory_name_directoryNotExists_status_error": 1, + "service_check_type_directory_name_directoryNotExists_status_initializing": 0, + "service_check_type_directory_name_directoryNotExists_status_not_monitored": 0, + "service_check_type_directory_name_directoryNotExists_status_ok": 0, + "service_check_type_directory_name_directoryOk_status_error": 0, + "service_check_type_directory_name_directoryOk_status_initializing": 0, + "service_check_type_directory_name_directoryOk_status_not_monitored": 0, + "service_check_type_directory_name_directoryOk_status_ok": 1, + "service_check_type_file_name_fileAlert_status_error": 1, + "service_check_type_file_name_fileAlert_status_initializing": 0, + "service_check_type_file_name_fileAlert_status_not_monitored": 0, + "service_check_type_file_name_fileAlert_status_ok": 0, + "service_check_type_file_name_fileDisabled_status_error": 0, + "service_check_type_file_name_fileDisabled_status_initializing": 0, + "service_check_type_file_name_fileDisabled_status_not_monitored": 1, + "service_check_type_file_name_fileDisabled_status_ok": 0, + "service_check_type_file_name_fileNotExists_status_error": 1, + "service_check_type_file_name_fileNotExists_status_initializing": 0, + "service_check_type_file_name_fileNotExists_status_not_monitored": 0, + "service_check_type_file_name_fileNotExists_status_ok": 0, + "service_check_type_file_name_fileOk_status_error": 0, + "service_check_type_file_name_fileOk_status_initializing": 0, + "service_check_type_file_name_fileOk_status_not_monitored": 0, + "service_check_type_file_name_fileOk_status_ok": 1, + "service_check_type_filesystem_name_filesystemAlert_status_error": 1, + "service_check_type_filesystem_name_filesystemAlert_status_initializing": 0, + "service_check_type_filesystem_name_filesystemAlert_status_not_monitored": 0, + "service_check_type_filesystem_name_filesystemAlert_status_ok": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_error": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_initializing": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_not_monitored": 1, + "service_check_type_filesystem_name_filesystemDisabled_status_ok": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_error": 1, + "service_check_type_filesystem_name_filesystemNotExists_status_initializing": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_not_monitored": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_ok": 0, + "service_check_type_filesystem_name_filsystemOk_status_error": 0, + "service_check_type_filesystem_name_filsystemOk_status_initializing": 0, + "service_check_type_filesystem_name_filsystemOk_status_not_monitored": 0, + "service_check_type_filesystem_name_filsystemOk_status_ok": 1, + "service_check_type_host_name_hostAlert_status_error": 1, + "service_check_type_host_name_hostAlert_status_initializing": 0, + "service_check_type_host_name_hostAlert_status_not_monitored": 0, + "service_check_type_host_name_hostAlert_status_ok": 0, + "service_check_type_host_name_hostDisabled_status_error": 0, + "service_check_type_host_name_hostDisabled_status_initializing": 0, + "service_check_type_host_name_hostDisabled_status_not_monitored": 1, + "service_check_type_host_name_hostDisabled_status_ok": 0, + "service_check_type_host_name_hostNotExists_status_error": 1, + "service_check_type_host_name_hostNotExists_status_initializing": 0, + "service_check_type_host_name_hostNotExists_status_not_monitored": 0, + "service_check_type_host_name_hostNotExists_status_ok": 0, + "service_check_type_host_name_hostOk_status_error": 0, + "service_check_type_host_name_hostOk_status_initializing": 0, + "service_check_type_host_name_hostOk_status_not_monitored": 0, + "service_check_type_host_name_hostOk_status_ok": 1, + "service_check_type_network_name_networkAlert_status_error": 1, + "service_check_type_network_name_networkAlert_status_initializing": 0, + "service_check_type_network_name_networkAlert_status_not_monitored": 0, + "service_check_type_network_name_networkAlert_status_ok": 0, + "service_check_type_network_name_networkDisabled_status_error": 0, + "service_check_type_network_name_networkDisabled_status_initializing": 0, + "service_check_type_network_name_networkDisabled_status_not_monitored": 1, + "service_check_type_network_name_networkDisabled_status_ok": 0, + "service_check_type_network_name_networkNotExists_status_error": 1, + "service_check_type_network_name_networkNotExists_status_initializing": 0, + "service_check_type_network_name_networkNotExists_status_not_monitored": 0, + "service_check_type_network_name_networkNotExists_status_ok": 0, + "service_check_type_network_name_networkOk_status_error": 0, + "service_check_type_network_name_networkOk_status_initializing": 0, + "service_check_type_network_name_networkOk_status_not_monitored": 0, + "service_check_type_network_name_networkOk_status_ok": 1, + "service_check_type_process_name_processAlert_status_error": 1, + "service_check_type_process_name_processAlert_status_initializing": 0, + "service_check_type_process_name_processAlert_status_not_monitored": 0, + "service_check_type_process_name_processAlert_status_ok": 0, + "service_check_type_process_name_processDisabled_status_error": 0, + "service_check_type_process_name_processDisabled_status_initializing": 0, + "service_check_type_process_name_processDisabled_status_not_monitored": 1, + "service_check_type_process_name_processDisabled_status_ok": 0, + "service_check_type_process_name_processNotExists_status_error": 1, + "service_check_type_process_name_processNotExists_status_initializing": 0, + "service_check_type_process_name_processNotExists_status_not_monitored": 0, + "service_check_type_process_name_processNotExists_status_ok": 0, + "service_check_type_process_name_processOk_status_error": 0, + "service_check_type_process_name_processOk_status_initializing": 0, + "service_check_type_process_name_processOk_status_not_monitored": 0, + "service_check_type_process_name_processOk_status_ok": 1, + "service_check_type_system_name_pve-deb-work_status_error": 0, + "service_check_type_system_name_pve-deb-work_status_initializing": 0, + "service_check_type_system_name_pve-deb-work_status_not_monitored": 0, + "service_check_type_system_name_pve-deb-work_status_ok": 1, + "uptime": 33, + }, + }, + "fail on unexpected XML response": { + prepare: caseUnexpectedXMLResponse, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on invalid data response": { + prepare: caseInvalidDataResponse, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on connection refused": { + prepare: caseConnectionRefused, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on 404 response": { + prepare: case404, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit, cleanup := test.prepare(t) + defer cleanup() + + _ = monit.Check() + + mx := monit.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, monit.Charts(), mx) + assert.Equal(t, test.wantNumOfCharts, len(*monit.Charts()), "want number of charts") + } + }) + } +} + +func caseOk(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != urlPathStatus || r.URL.RawQuery != urlQueryStatus { + w.WriteHeader(http.StatusNotFound) + return + } + _, _ = w.Write(dataStatus) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseUnexpectedXMLResponse(t *testing.T) (*Monit, func()) { + t.Helper() + data := ` + + + 200 + Success + + + + 12345 + John Doe + johndoe@example.com + + Admin + User + + + + 98765 + 2024-08-15 + + + Widget A + 2 + 19.99 + + + Gadget B + 1 + 99.99 + + + 139.97 + + + +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(data)) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseInvalidDataResponse(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseConnectionRefused(t *testing.T) (*Monit, func()) { + t.Helper() + monit := New() + monit.URL = "http://127.0.0.1:65001" + require.NoError(t, monit.Init()) + + return monit, func() {} +} + +func case404(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} diff --git a/src/go/plugin/go.d/modules/monit/status.go b/src/go/plugin/go.d/modules/monit/status.go new file mode 100644 index 00000000..4a87e8c9 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/status.go @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +// status_xml(): https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/xml.c#lines-631 +type monitStatus struct { + Server *statusServer `xml:"server"` + Services []statusServiceCheck `xml:"service"` +} + +type statusServer struct { + ID string `xml:"id"` + Version string `xml:"version"` + Uptime int64 `xml:"uptime"` + LocalHostname string `xml:"localhostname"` +} + +// status_service(): https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/xml.c#lines-196 +// struct Service_T: https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-1212 +type statusServiceCheck struct { + Type string `xml:"type,attr"` + Name string `xml:"name"` + + Status int `xml:"status"` // Error flags bitmap + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-269 + MonitoringStatus int `xml:"monitor"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-254 + MonitorMode int `xml:"monitormode"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-261 + OnReboot int `xml:"onreboot"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-248 + PendingAction int `xml:"pendingaction"` +} + +func (s *statusServiceCheck) id() string { + return s.svcType() + ":" + s.Name +} + +func (s *statusServiceCheck) svcType() string { + // See enum Service_Type https://bitbucket.org/tildeslash/monit/src/master/src/monit.h + + switch s.Type { + case "0": + return "filesystem" + case "1": + return "directory" + case "2": + return "file" + case "3": + return "process" + case "4": + return "host" + case "5": + return "system" + case "6": + return "fifo" + case "7": + return "program" + case "8": + return "network" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) status() string { + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/cervlet.c#lines-2866 + + switch st := s.monitoringStatus(); st { + case "not_monitored", "initializing": + return st + default: + if s.Status != 0 { + return "error" + } + return "ok" + } +} + +func (s *statusServiceCheck) monitoringStatus() string { + switch s.MonitoringStatus { + case 0: + return "not_monitored" + case 1: + return "monitored" + case 2: + return "initializing" + case 4: + return "waiting" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) monitorMode() string { + switch s.MonitorMode { + case 0: + return "active" + case 1: + return "passive" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) onReboot() string { + switch s.OnReboot { + case 0: + return "start" + case 1: + return "no_start" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) pendingAction() string { + switch s.PendingAction { + case 0: + return "ignored" + case 1: + return "alert" + case 2: + return "restart" + case 3: + return "stop" + case 4: + return "exec" + case 5: + return "unmonitor" + case 6: + return "start" + case 7: + return "monitor" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) hasServiceStatus() bool { + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/util.c#lines-1721 + + const eventNonExist = 512 + const eventData = 2048 + + return s.monitoringStatus() == "monitored" && + !(s.Status&eventNonExist != 0) && + !(s.Status&eventData != 0) +} diff --git a/src/go/plugin/go.d/modules/monit/testdata/config.json b/src/go/plugin/go.d/modules/monit/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/monit/testdata/config.yaml b/src/go/plugin/go.d/modules/monit/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml b/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml new file mode 100644 index 00000000..ca4178c6 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml @@ -0,0 +1,688 @@ + + + + 309dc5d56ccd5964cef9b42d1d8305e7 + 1723810534 + 5.33.0 + 33 + 120 + 0 + pve-deb-work + /etc/monit/monitrc + +
127.0.0.1
+ 2812 + 0 +
+
+ + Linux + 6.1.0-23-amd64 + #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) + x86_64 + 16 + 32864100 + 262140 + + + processOk + 1723810534 + 86510 + 0 + 0 + 1 + 0 + 0 + 0 + 843 + 1 + 0 + 0 + 0 + 66112 + 1 + 2 + + 0.0 + 0.1 + 5036 + 34156 + + + -1.0 + -1.0 + + + 9 + 34 + + 8192 + 8192 + + + + + 0 + 1733465 + + + 0 + 135168 + + + 0 + 23145 + + + + + 0 + 8842272 + + + 0 + 9150464 + + + 0 + 22890 + + + + + processDisabled + 1723810534 + 68402 + 0 + 0 + 0 + 0 + 0 + 0 + + + processAlert + 1723810534 + 86548 + 2 + 0 + 1 + 0 + 0 + 0 + 843 + 1 + 0 + 0 + 0 + 66112 + 1 + 2 + + 0.0 + 0.1 + 5036 + 34156 + + + -1.0 + -1.0 + + + 9 + 34 + + 8192 + 8192 + + + + + 0 + 1733465 + + + 0 + 135168 + + + 0 + 23145 + + + + + 0 + 8842272 + + + 0 + 9150464 + + + 0 + 22890 + + + + + processNotExists + 1723810534 + 86595 + 4608 + 0 + 1 + 0 + 0 + 0 + + + filsystemOk + 1723810534 + 86891 + 0 + 0 + 1 + 0 + 0 + 0 + ext2 + rw,relatime + 660 + 0 + 6 + + 19.6 + 92.0 + 469.4 + + + 0.3 + 356 + 124928 + + + + 0 + 5706752 + + + 0 + 210 + + + + + 0 + 1024 + + + 0 + 1 + + + + 0.000 + 0.000 + + + + filesystemDisabled + 1723810534 + 68613 + 0 + 0 + 0 + 0 + 0 + 0 + + + filesystemAlert + 1723810534 + 87124 + 384 + 0 + 1 + 0 + 0 + 0 + ext2 + rw,relatime + 660 + 0 + 6 + + 19.6 + 92.0 + 469.4 + + + 0.3 + 356 + 124928 + + + + 0 + 5706752 + + + 0 + 210 + + + + + 0 + 1024 + + + 0 + 1 + + + + 0.000 + 0.000 + + + + filesystemNotExists + 1723810534 + 87334 + 512 + 0 + 1 + 0 + 0 + 0 + + + fileOk + 1723810534 + 87339 + 0 + 0 + 1 + 0 + 0 + 0 + 755 + 0 + 0 + + 1723744256 + 1723744256 + 1723744256 + + 84820392 + + + fileDisabled + 1723810534 + 68835 + 0 + 0 + 0 + 0 + 0 + 0 + + + fileAlert + 1723810534 + 87356 + 384 + 0 + 1 + 0 + 0 + 0 + 755 + 0 + 0 + + 1723744256 + 1723744256 + 1723744256 + + 84820392 + + + fileNotExists + 1723810534 + 87371 + 512 + 0 + 1 + 0 + 0 + 0 + + + directoryOk + 1723810534 + 87375 + 0 + 0 + 1 + 0 + 0 + 0 + 775 + 0 + 0 + + 1723740545 + 1720694060 + 1720694060 + + + + directoryDisabled + 1723810534 + 68957 + 0 + 0 + 0 + 0 + 0 + 0 + + + directoryAlert + 1723810534 + 87385 + 64 + 0 + 1 + 0 + 0 + 0 + 775 + 0 + 0 + + 1723740545 + 1720694060 + 1720694060 + + + + directoryNotExists + 1723810534 + 87400 + 512 + 0 + 1 + 0 + 0 + 0 + + + hostOk + 1723810534 + 89652 + 0 + 0 + 1 + 0 + 0 + 0 + + Ping + 0.000144 + + + 10.20.4.200 + 19999 + + HTTP + TCP + 0.002077 + + + + hostDisabled + 1723810534 + 69066 + 0 + 0 + 0 + 0 + 0 + 0 + + + hostAlert + 1723810534 + 89857 + 32 + 0 + 1 + 0 + 0 + 0 + + Ping + 0.000069 + + + 10.20.4.200 + 19991 + + HTTP + TCP + -1.000000 + + + + hostNotExists + 1723810549 + 94459 + 16384 + 0 + 1 + 0 + 0 + 0 + + Ping + -1.000000 + + + 10.20.4.233 + 19999 + + HTTP + TCP + -1.000000 + + + + networkOk + 1723810549 + 94801 + 0 + 0 + 1 + 0 + 0 + 0 + + 1 + -1000000 + -1 + + + 0 + 319258 + + + 0 + 714558077 + + + 0 + 0 + + + + + 0 + 172909 + + + 0 + 25128489 + + + 0 + 0 + + + + + + networkDisabled + 1723810534 + 69103 + 0 + 0 + 0 + 0 + 0 + 0 + + + networkAlert + 1723810549 + 94969 + 8388608 + 0 + 1 + 0 + 0 + 0 + + 0 + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + + + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + + + + networkNotExists + 1723810549 + 94992 + 8388608 + 0 + 1 + 0 + 0 + 0 + + -1 + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + + + -1 + -1 + + + -1 + -1 + + + -1 + -1 + + + + + + pve-deb-work + 1723810549 + 94992 + 0 + 0 + 1 + 0 + 0 + 0 + + 1664 + 0 + 9223372036854775807 + + + + 0.00 + 0.04 + 0.03 + + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.1 + 1020120 + + + 0.0 + 0 + + + +
-- cgit v1.2.3