woods
862a9cdea0
hbc_mini.c: make it work on NetBSD
...
This fixes the numbers by using the correct MIB to match the struct.
2026-06-02 13:42:11 -07:00
woods
9351938b15
hbc_mini.c: make it compile on NetBSD
...
Use the public "struct uvmexp_sysctl" instead of "struct uvmexp".
The numbers from the memory_monitor are wonky, but it builds and runs.
2026-06-02 12:05:42 -07:00
Andreas Wrede and Claude Sonnet 4.6
588eb2a792
feat: retry DNS resolution indefinitely and add -4/-6 flags in hbc and hbc_mini.c
...
Mirror the same changes from hbc_mini.py: retry host resolution with
exponential backoff (5s→60s) instead of exiting on DNS failure, and add
mutually exclusive -4 / -6 flags to restrict connections to IPv4 or IPv6.
In hbc (main.py) the retry sleep is interruptible via the shutdown_event.
In hbc_mini.c signal handlers are moved before the resolution loop so
SIGINT/SIGTERM can break the retry during startup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-12 08:15:53 -04:00
andreas and Claude Sonnet 4.6
cc4a103bae
scripts/c: add .gitignore for build outputs
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-08 12:24:29 -04:00
andreas and Claude Sonnet 4.6
53fb10fdf5
scripts/c: remove committed binary
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-08 12:24:05 -04:00
andreas and Claude Sonnet 4.6
2df2ad18c9
scripts/c: add single-file C port of hbc_mini
...
hbc_mini.c is a full port of scripts/hbc_mini.py requiring only zlib,
pthreads, and a C11 compiler. Supports Linux, FreeBSD, NetBSD, and
DragonFly BSD with platform-specific plugin backends:
- cpu_monitor: /proc/stat (Linux) or kern.cp_time sysctl (BSD)
- memory_monitor: /proc/meminfo (Linux), vm.stats.vm.* (FreeBSD),
struct uvmexp (NetBSD)
- network_monitor:/proc/net/dev (Linux) or getifaddrs()+if_data (BSD)
- disk_monitor: df -P (all platforms)
- ping_monitor: ping subprocess (all platforms)
- nagios_runner: shell commands with perfdata parsing (all platforms)
- os_info: uname() + /etc/os-release (Linux) or kern.osrelease (BSD)
Build: cc -O2 -o hbc_mini hbc_mini.c -lz -lpthread -lm
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-08 12:23:45 -04:00