Commit Graph
19 Commits
Author SHA1 Message Date
Joel Male 28a555c1de chore: remove SSL cert monitoring (handled by Pulsewise) 2026-02-26 21:35:09 +10:00
Joel Male 4018ba5c4a feat: add PHP-FPM, nginx, SSL, and port monitoring
All four are opt-in via config file:
- FPM_STATUS_URL — PHP-FPM pool stats (active/idle workers, slow requests, max children reached, accepted conn)
- NGINX_STATUS_URL — nginx stub_status (active connections, reading/writing/waiting, accepts/handled/requests)
- SSL_DOMAINS — TLS cert expiry check per domain (days left, valid, expires_at)
- CHECK_PORTS — TCP port availability per port with known service name mapping

Also refactors loadConfigFromFile to return *Config directly instead of a positional tuple.
2026-02-26 11:50:54 +10:00
Joel Male ef6fa1a07f fix: measure process CPU concurrently with system CPU
Previously system CPU was measured first (1s window), then processes
were sampled 1+ second later. Short-lived spikes would appear in system
CPU but not in the process list because the offending process had already
finished. Now both run in parallel so their windows overlap — a process
that caused a spike during the CPU measurement window will be captured.
2026-02-25 21:52:00 +10:00
Joel Male b9b31414b0 fix: name and version on same line, blank line before success message 2026-02-25 16:13:05 +10:00
Joel Male ebdc5a2c48 chore: increase collection interval to 60s 2026-02-25 16:11:30 +10:00
Joel Male f3f37fa372 fix: restart service after update instead of re-execing
Both manual 'update' command and auto-updater now restart via
systemctl/launchctl after replacing the binary, so the service
manager picks up the new version cleanly. Previously the running
daemon kept executing the old binary from memory.
2026-02-25 15:39:57 +10:00
Joel Male bd63686312 feat: add iowait, TCP connection states, and file descriptor metrics
- cpu.iowait_percent: % of time CPU is waiting on disk I/O
- tcp: established/time_wait/close_wait/listen counts; max_time_wait
  system limit included on Linux for context
- file_descriptors: used vs max (Linux reads /proc/sys/fs/file-nr,
  macOS reads kern.openfiles / kern.maxfiles via sysctl)

These three metrics directly surface the most common causes of
unexplained PHP/Laravel timeouts at the system level.
2026-02-25 15:35:43 +10:00
Joel Male 57e68204bd fix: derive CPU total from per-core average to avoid split measurement windows 2026-02-25 15:17:30 +10:00
Joel Male 342b105df9 feat: add 'dump' command to print payload JSON without sending 2026-02-25 15:09:45 +10:00
Joel Male f4e5bafa73 fix: update re-execs with sudo; version output with color and formatting
- 'update' now re-execs with sudo when not root (same pattern as status)
- 'version' output: name and version on separate lines, cyan version number,
  green for up-to-date, yellow for available update
- 'update' output: matching color treatment, red on failure
- Deduplicate color constants — single package-level set used everywhere
2026-02-25 15:02:32 +10:00
Joel Male c0541f7bc9 fix: exclude virtual/pseudo filesystems from disk metrics
squashfs loop mounts (snap packages) are always 100% full by design and
were skewing the max disk usage shown in the UI. Now filters the same
set of pseudo-filesystems that 'df' excludes by default, plus any
/dev/loop* devices regardless of fstype.
2026-02-25 14:57:16 +10:00
Joel Male c9f6f282a6 feat: AUTO_UPDATE config option, null next_update_check when disabled
- AUTO_UPDATE=false in config file disables auto-updating
- --no-auto-update flag still works as an override
- next_update_check is omitted from pulses when auto-update is disabled
- status command shows auto-update enabled/disabled state
- config.example documents the new option
2026-02-25 14:54:07 +10:00
Joel Male ac607c2757 fix: always emit timestamps in UTC to avoid timezone offset issues 2026-02-25 14:51:29 +10:00
Joel Male 7321689cc4 fix: status re-execs with sudo when not running as root 2026-02-25 14:50:07 +10:00
Joel Male 31bd3c35ab feat: include next_update_check timestamp in every pulse payload 2026-02-25 14:48:12 +10:00
Joel Male e2889617fc feat: add status, uninstall commands and collector_version in pulses
- 'pulsewise-collector status' shows hostname, masked token, API endpoint,
  service running state (systemd/launchd), and last pulse timestamp
- 'pulsewise-collector uninstall' stops the service, removes the unit file,
  config dir, log file, and binary; prompts for confirmation, requires root
- State file written to /etc/pulsewise-collector/state (or ~/.config fallback)
  after each successful send to power the 'last pulse' display
- collector_version field added to every metrics payload so the server can
  surface update prompts per-host
2026-02-25 14:44:14 +10:00
Joel Male 35f8ee5347 feat: version/update subcommands, VERSION file, deploy version bumping
- Add VERSION file as canonical version source
- build.sh reads VERSION file automatically, injects via -ldflags
- deploy.sh prompts for major/minor/patch bump, injects version via
  ldflags into all 4 builds, and writes release/latest JSON file
- Add 'pulsewise-collector version' — prints version and checks for update
- Add 'pulsewise-collector update' — fetches and applies the latest release
- Default version changed to "dev" for local builds without ldflags
2026-02-25 14:40:47 +10:00
Joel Male c2241e8d87 feat: add auto-update with --no-auto-update flag
Collector now checks for updates at startup (after 30s) and every 6h.
When a newer version is detected via the /collector/release/latest endpoint,
it downloads the new binary, atomically replaces itself, then re-execs
in-place so the service manager sees no interruption.

Auto-update is enabled by default; pass --no-auto-update to disable.
Version is injected at build time via -ldflags for release builds.
2026-02-25 14:36:42 +10:00
Joel Male 4aa08d0ef4 feat: full collector with macOS support, metrics, and one-click installer
- Collect CPU, memory, swap, disk, disk I/O, network (per-second rates),
  load average, system info, uptime, and top processes via gopsutil
- Install script supports both Linux (systemd) and macOS (launchd)
- Auto-detect OS and architecture for binary download
- Accept TOKEN env var for non-interactive installs
- Config at /etc/pulsewise-collector/config with simple KEY=VALUE format
- Debug mode logs full response body
- Hostname auto-detected if not set in config
2026-02-15 16:04:57 +10:00