Skip to content

Commit ff17153

Browse files
committed
fix(network-io): report packet, error and drop rates, drop raw byte counters (#320)
packets_*, errin/errout and dropin/dropout from psutil.net_io_counters() are cumulative counters since boot and were emitted with uom='c'. Emit them as in-plugin per-second rates (<iface>_<field>_per_second) instead. The raw bytes_recv/bytes_sent counters were redundant with the existing throughput rates and are dropped. Update the Grafana dashboard: remove the raw-bytes panel and the non_negative_difference workaround, point the packets and stats panels at the new rates.
1 parent bdec84e commit ff17153

5 files changed

Lines changed: 83 additions & 201 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Monitoring Plugins:
9999
* cert: can scan a whole subnet for expiring or untrusted TLS certificates across many common ports, not just a single endpoint or local files (now the default when run without parameters)
100100
* cert: warning/critical thresholds also accept a percentage of the lifetime or a duration, and the full certificate chain is checked, not just the leaf
101101
* ipmi-sensor: performance data is grouped by sensor type, so temperatures, fan speeds, voltages and power show up in separate graphs (existing IPMI graph history resets once) ([#22](https://github.com/Linuxfabrik/monitoring-plugins/issues/22))
102+
* network-io: packet, error and drop counts are now reported as per-second rates instead of continuous counters, and the redundant raw byte counters were dropped in favor of the existing throughput rates, so Grafana graphs and aggregations are correct; re-import the network-io Grafana dashboard after updating ([#320](https://github.com/Linuxfabrik/monitoring-plugins/issues/320))
102103
* nextcloud-security-scan: reports a fresh rating right after a Nextcloud update instead of a stale one (`--path`) ([#118](https://github.com/Linuxfabrik/monitoring-plugins/issues/118))
103104
* php-status: also reports the active php.ini runtime settings and the largest OPcache scripts (`--top`), and flags PHP-FPM services a single check does not cover
104105
* php-status: OPcache alerting is more tolerant (warns at 95% by default) and now flags cache thrashing, while a full interned strings buffer no longer warns

check-plugins/network-io/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Overview
55

6-
Monitors network I/O throughput per interface over time. Calculates bytes per second from cumulative counters using SQLite state persistence between runs. Alerts only if bandwidth thresholds have been exceeded for a configurable number of consecutive check runs (default: 5), suppressing short spikes. Also reports packet rates, errors, and drops per interface.
6+
Monitors network I/O throughput per interface over time. Calculates bytes per second from cumulative counters using SQLite state persistence between runs. Alerts only if bandwidth thresholds have been exceeded for a configurable number of consecutive check runs (default: 5), suppressing short spikes. Also reports packet, error, and drop rates per interface.
77

88
**Important Notes:**
99

@@ -45,7 +45,7 @@ Monitors network I/O throughput per interface over time. Calculates bytes per
4545
second from cumulative counters using SQLite state persistence between runs.
4646
Alerts only if bandwidth thresholds have been exceeded for a configurable
4747
number of consecutive check runs (default: 5), suppressing short spikes. Also
48-
reports packet rates, errors, and drops per interface.
48+
reports packet, error, and drop rates per interface.
4949
5050
options:
5151
-h, --help show this help message and exit
@@ -109,18 +109,16 @@ Per interface:
109109

110110
| Name | Type | Description |
111111
|----|----|----|
112-
| \<interface\>\_bytes_recv | Continuous Counter | Number of bytes received. |
113112
| \<interface\>\_bytes_recv_per_second1 | Bytes | Current bytes received per second. |
114113
| \<interface\>\_bytes_recv_per_second15 | Bytes | Averaged bytes received per second over the configured count. |
115-
| \<interface\>\_bytes_sent | Continuous Counter | Number of bytes sent. |
116114
| \<interface\>\_bytes_sent_per_second1 | Bytes | Current bytes sent per second. |
117115
| \<interface\>\_bytes_sent_per_second15 | Bytes | Averaged bytes sent per second over the configured count. |
118-
| \<interface\>\_dropin | Continuous Counter | Total number of incoming packets which were dropped. |
119-
| \<interface\>\_dropout | Continuous Counter | Total number of outgoing packets which were dropped (always 0 on macOS and BSD). |
120-
| \<interface\>\_errin | Continuous Counter | Total number of errors while receiving. |
121-
| \<interface\>\_errout | Continuous Counter | Total number of errors while sending. |
122-
| \<interface\>\_packets_recv | Continuous Counter | Number of packets received. |
123-
| \<interface\>\_packets_sent | Continuous Counter | Number of packets sent. |
116+
| \<interface\>\_dropin_per_second | Number | Incoming packets dropped per second. |
117+
| \<interface\>\_dropout_per_second | Number | Outgoing packets dropped per second (always 0 on macOS and BSD). |
118+
| \<interface\>\_errin_per_second | Number | Receive errors per second. |
119+
| \<interface\>\_errout_per_second | Number | Send errors per second. |
120+
| \<interface\>\_packets_recv_per_second | Number | Packets received per second. |
121+
| \<interface\>\_packets_sent_per_second | Number | Packets sent per second. |
124122
| \<interface\>\_throughput1 | None | Current bytes per second (bytes_recv_per_second1 + bytes_sent_per_second1). |
125123
| \<interface\>\_throughput15 | None | Averaged bytes per second over the configured count. |
126124

0 commit comments

Comments
 (0)