diff --git a/README.md b/README.md index 8bfd9b3..65194a3 100644 --- a/README.md +++ b/README.md @@ -659,7 +659,28 @@ Config: `~/.hbc.json` (JSON format, same keys as `~/.hbc.yaml`). | `cpu_monitor` | Linux (`/proc/stat`; no per-core, no frequency) | | `memory_monitor` | Linux (`/proc/meminfo`) | | `disk_monitor` | Linux, macOS, BSD (`df -P`) | -| `network_monitor` | Linux (`/proc/net/dev`) | +| `network_monitor` | Linux (`/proc/net/dev`); per-protocol connectivity probe (all platforms) | + +`network_monitor` also reports per-protocol (IPv4/IPv6) internet presence — whether the host +has a working route and reply to a well-known address, plus its own address, the local +gateway, and RTT — as `p4`/`p6` flags on every heartbeat and a `connectivity` object in the +plugin data. Configurable, defaults shown: + +```json +{ + "plugins": { + "network_monitor": { + "probe_enabled": true, + "probe_v4": "1.1.1.1", + "probe_v6": "2606:4700:4700::1111", + "probe_interval": 60 + } + } +} +``` + +`probe_v4`/`probe_v6` must be IP literals (no hostnames). Gateway lookup works on Linux, +FreeBSD/NetBSD/DragonFly/macOS (`route -n get`), and Windows (`route print`). Not available vs full `hbc`: no YAML config, no `filesystem_info`, no `zfs_monitor`, no IPv6 early-fail protection. @@ -712,6 +733,7 @@ SIGHUP causes the process to restart itself via `execv()`. SIGTERM/SIGINT trigge | `disk_monitor` | All | `df -P` subprocess | | `network_monitor` | Linux | `/proc/net/dev` | | `network_monitor` | FreeBSD, NetBSD, DragonFly | `getifaddrs()` + `AF_LINK` | +| `network_monitor` (connectivity probe) | Linux, FreeBSD, NetBSD, DragonFly | UDP `connect()` route check + one ICMP echo per protocol | | `ping_monitor` | All | `ping` subprocess | | `nagios_runner` | All | `popen()` subprocess | @@ -743,12 +765,33 @@ SIGHUP causes the process to restart itself via `execv()`. SIGTERM/SIGINT trigge } ``` +`network_monitor` also runs the per-protocol connectivity probe described above, in a +dedicated thread (its ICMP echo can block for a few seconds). Same config keys and defaults +as `hbc_mini.py`: + +```json +{ + "plugins": { + "network_monitor": { + "probe_enabled": true, + "probe_v4": "1.1.1.1", + "probe_v6": "2606:4700:4700::1111", + "probe_interval": 60 + } + } +} +``` + +Gateway lookup on the C client covers Linux and FreeBSD/NetBSD/DragonFly only (no macOS or +Windows build of `hbc_mini.c` exists). + ### Differences from `hbc_mini.py` - No `filesystem_info` or `zfs_monitor` plugins - `UPD` (self-update) messages are logged but not acted on - No IPv6 early-fail protection - Config is JSON only (`~/.hbc.json`), no YAML +- No macOS or Windows build (Linux and the BSDs only) ---