docs: document the connectivity probe config for hbc_mini.py and hbc_mini.c
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uc9V1v7iXruubpoLiSE24M
This commit is contained in:
@@ -659,7 +659,28 @@ Config: `~/.hbc.json` (JSON format, same keys as `~/.hbc.yaml`).
|
|||||||
| `cpu_monitor` | Linux (`/proc/stat`; no per-core, no frequency) |
|
| `cpu_monitor` | Linux (`/proc/stat`; no per-core, no frequency) |
|
||||||
| `memory_monitor` | Linux (`/proc/meminfo`) |
|
| `memory_monitor` | Linux (`/proc/meminfo`) |
|
||||||
| `disk_monitor` | Linux, macOS, BSD (`df -P`) |
|
| `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.
|
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 |
|
| `disk_monitor` | All | `df -P` subprocess |
|
||||||
| `network_monitor` | Linux | `/proc/net/dev` |
|
| `network_monitor` | Linux | `/proc/net/dev` |
|
||||||
| `network_monitor` | FreeBSD, NetBSD, DragonFly | `getifaddrs()` + `AF_LINK` |
|
| `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 |
|
| `ping_monitor` | All | `ping` subprocess |
|
||||||
| `nagios_runner` | All | `popen()` 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`
|
### Differences from `hbc_mini.py`
|
||||||
|
|
||||||
- No `filesystem_info` or `zfs_monitor` plugins
|
- No `filesystem_info` or `zfs_monitor` plugins
|
||||||
- `UPD` (self-update) messages are logged but not acted on
|
- `UPD` (self-update) messages are logged but not acted on
|
||||||
- No IPv6 early-fail protection
|
- No IPv6 early-fail protection
|
||||||
- Config is JSON only (`~/.hbc.json`), no YAML
|
- Config is JSON only (`~/.hbc.json`), no YAML
|
||||||
|
- No macOS or Windows build (Linux and the BSDs only)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user