Commit Graph
1815 Commits
Author SHA1 Message Date
henrygdandSven van Ginkel ca7f75ef73 fix(agent): skip scheduled monitor probes while the hub isn't requesting stats
The hub collects monitor results only with stats requests, which stop
while
a system is paused or the agent is disconnected. Paused WebSocket agents
stay
connected, so they kept probing. Skip scheduled probes after three
default
update intervals without a stats request and resume on the next one.

Co-authored-by: Sven van Ginkel <svenvanginkel@icloud.com>
2026-10-19 19:18:02 -04:00
yi111andGitHub 574c4cf9dd fix(agent): claim sensor names before filtering so excludes don't rename (#2645)
updateTemperatures detected duplicate SensorKeys by looking at the output
map, which only holds sensors that passed every filter. A sensor dropped by
SENSORS or SKIP_GPU therefore never claimed its name, so excluding the first
of two same-named sensors renamed the second one from nvme_sensor_2_4 to
nvme_sensor_2 and dropped it too, making it impossible to exclude just one.

Track handed-out names in a separate set that is populated before any filter
runs, so a sensor's key depends only on the hardware list.
2026-10-19 13:09:05 -04:00
Sven van GinkelandGitHub b431db751f fix(agent): time out blocked fan reads so collection can't hang (#2638, #2639)
Fan sensors were read with a plain os.ReadFile and no timeout. An i915
fan1_input read that blocks in the kernel held the agent lock forever,
stalling every hub request and the WebSocket read loop, so the system
went down and the agent never reconnected.

Fan reads now go through the same timeout as temperatures
(SENSORS_TIMEOUT, default 2s). A shared readWithTimeout helper tracks a
read still blocked after timing out and skips later polls until it
returns, instead of leaking another blocked goroutine each time. The
temperature path uses the helper too, fixing the same pile-up there.
2026-10-19 13:03:13 -04:00
sveng93andhank 7179bf8b8a chore: remove commented-out LoadAvg1/5/15 fields
The load average fields were replaced by the `la` array and are already
commented out. Replace them with a note about the reserved cbor keys.
2026-10-19 12:54:20 -04:00
henrygdandhank 226590b2df refactor(hub): simplify universal token request parsing and use ApiScenario tests 2026-10-19 12:47:42 -04:00
daniyyellandhank 7b6d995533 Keep dashboard universal tokens out of request URLs 2026-10-19 12:47:42 -04:00
Sven van GinkelandGitHub 2ba1fc0061 test(hub): re-enable /update route test (#2651)
Authenticate the request and expect 404 so the test checks that the
route is not registered without CHECK_UPDATES. Tests run with the
no_ui tag, so the status is stable.
2026-10-19 12:19:19 -04:00
15859c1eb7 refactor: stop sending deprecated DiskReadPs/DiskWritePs fields (#2653)
Disk I/O has been sent in bytes since 0.13.0 (DiskIO for the system,
DiskReadBytes/DiskWriteBytes per filesystem). The agent no longer
populates the old MB-based DiskReadPs/DiskWritePs fields.

The fields are kept on Stats and FsStats only so agents < 0.13.0 still
decode. The hub migrates them on ingest: system-level to DiskIO and
per-filesystem to DiskReadBytes/DiskWriteBytes, so stored records and
the UI only use the byte fields.

Remove the MaxDiskReadPs/MaxDiskWritePs fields, their records averaging,
the UI MB fallbacks and the related TS types.

---------

Co-authored-by: hank <hank@henrygd.me>
2026-10-19 12:17:54 -04:00
Sven van GinkelandGitHub afb710a526 refactor(agent): stop sending deprecated container network fields (#2650)
NetworkSent/NetworkRecv were deprecated in 0.18.3 in favor of
Bandwidth. The hub already falls back to the old fields for older
agents, so the agent no longer needs to populate them.
2026-10-19 11:00:09 -04:00
e233d663c3 refactor(agent): simplify SMART collection with per-device smartctl attempts (#2620)
Rebuild the SMART device list on every refresh instead of keeping
per-device type and parser state across rescans. Each device gets a
short ordered list of smartctl queries, and the three parsers are merged
into one that rejects output without health data so the next query runs.

- scsi devices try auto-detect, then -d sat (#2295)
- NVMe controllers fall back to their n1 namespace
- disks in standby reuse their last reading; a disk not yet collected
  is woken once per agent run
- the last good reading survives temporary read failures
- failed or empty rescans keep the previous device list
- a missing SMART status is UNKNOWN instead of FAILED
- the reported disk type is the type that worked (e.g. sat)
- disks seen through two paths are reported once

---------

Co-authored-by: hank <hank@henrygd.me>
2026-10-19 10:57:25 -04:00
Mike BogdanandGitHub e984ee1208 feat(alerts): add TLS certificate expiry alert for network monitors (#2627)
Adds a NetworkMonitorCert alert with a threshold in days, evaluated on the hub from the certInfo stored by #2401. Follows the NetworkMonitorLoss alert: per-monitor incidents, alert history, recovery notifications.

Refs #391
2026-10-17 13:40:19 -04:00
c479c3e79c fix: prevent ownership reassignment through record updates (#2632)
Co-authored-by: henrygd <hank@henrygd.me>
2026-10-17 13:38:17 -04:00
Sven van GinkelandGitHub 2e9f4ef4a7 fix(docker): build arm/v6 images with GOARM=6 (#2637) 2026-10-17 12:53:30 -04:00
e84eb25e1c fix(agent): keep LHM helper alive after sensor failures (#2624)
Co-authored-by: hank <hank@henrygd.me>
2026-10-17 12:49:57 -04:00
henrygd cc98299a72 refactor(ui): match token mask length and place copy buttons beside values 2026-10-17 10:09:18 -04:00
Daniel JeremiahandGitHub 74b02cbe0d Mask agent tokens until explicitly revealed (#2625) 2026-10-17 10:06:32 -04:00
henrygd d8325acfae fix(helm): omit empty env and envFrom in hub deployment
Wrap env and envFrom in with blocks so they aren't rendered as null keys
when unset, document both values with examples, and bump chart to 0.1.9.
2026-10-17 09:43:46 -04:00
NielDBandGitHub b2cbd05c4c feat(helm) add envFrom and env (#2626) 2026-10-17 09:41:23 -04:00
henrygd e8970e4679 fix(site): show spinner in systems table until systems are loaded 2026-10-15 09:53:58 -04:00
henrygd fb85013d22 chore: update changelog 2026-10-13 12:42:27 -04:00
henrygd ce45eab1c5 chore: bump Go version to 1.27.2 2026-10-13 12:34:06 -04:00
4aee1668fe fix(agent): bind connection lifecycle to a cancellable context (#2464)
Agent.Start and ConnectionManager.Start now take a context.Context. The
manager runs until that context is cancelled or the process receives
SIGINT/SIGTERM. On shutdown it waits for in-flight reconnect attempts
before closing connections.

The reconnect delay, WebSocket dial and pending handshake now stop when
the context is cancelled. A context-aware dialer keeps proxy selection
from the environment. WebSocket callbacks no longer block on eventChan
after the event loop exits. A late reconnect can no longer restart the
SSH server once shutdown begins.

BREAKING CHANGE: agent.Agent.Start now requires a context.Context.

---------

Co-authored-by: hank <hank@henrygd.me>
2026-10-13 12:32:26 -04:00
henrygd 0ff6ab0b8c chore(deps): upgrade go dependencies 2026-10-13 10:40:16 -04:00
henrygd 9b40b62ec8 docs(agent): explain btrfs ioctl fallback incomplete-probe semantics 2026-10-13 10:32:59 -04:00
Santhi PrakashandGitHub 01b9b03d67 fix(agent): determine btrfs pool health via ioctls when sysfs devinfo is absent (#2489)
Kernels before sysfs devinfo (pre-5.13, e.g. Synology DSM 4.4) report
every Btrfs pool health as UNKNOWN and expose no member devices, even
though the same facts are available through BTRFS_IOC_FS_INFO and
BTRFS_IOC_DEV_INFO on the mountpoint.

When the devinfo directory does not exist, enumerate devids via DEV_INFO
after confirming the filesystem through FS_INFO: members that answer are
listed with their recorded capacity, a member reporting no device path is
missing (DEGRADED), freed devids (ENODEV gaps from remove/replace) are
skipped, and the kernel device count is cross-checked against the sysfs
devices links so an unattributed missing member still reads DEGRADED.
Any ioctl failure or count mismatch leaves health UNKNOWN rather than
reporting unverified ONLINE.
2026-10-13 10:32:20 -04:00
032c03b0f7 fix(ui): sort monitor targets without URL scheme, show HTTPS in badge (#2501)
Co-authored-by: hank <hank@henrygd.me>
2026-10-13 09:38:26 -04:00
henrygd d5f50fa461 feat(users): warn on invalid OAUTH_DEFAULT_USER_ROLE values 2026-10-13 08:39:37 -04:00
Sven van GinkelandGitHub 13ea8106eb users: add OAUTH_DEFAULT_USER_ROLE and make USER_EMAIL user admin (#2516) 2026-10-13 08:37:04 -04:00
Sven van GinkelandGitHub 1da59e3771 fix(agent): make package update checks work under the systemd sandbox (#2538)
The agent runs as the beszel user under ProtectSystem=strict, so package
managers that write temp, cache or log files failed with only
"exit status 1" in the log.

- Include the command's stderr in package update check errors.
- dnf5: point XDG_STATE_HOME and XDG_CACHE_HOME into the agent's data
  dir. They default to $HOME, which is /nonexistent for the beszel user.
  With -C, dnf5 still reads the system metadata cache.
- zypper: keep the solv cache in the data dir with --solv-cache-dir,
  since the agent user cannot rebuild it in /var/cache/zypp.
- install-agent.sh, Debian unit: add PrivateTmp=yes. dnf4 (Rocky, Alma)
  and zypper keep temporary files in /var/tmp, which ProtectSystem=strict
  makes read-only. The install script also adds it to existing units
  when re-run.
2026-10-13 08:07:44 -04:00
spatiumstasandGitHub 17dcd96efc fix(site): improve accessibility and preserve login translation (#2604) 2026-10-13 07:52:23 -04:00
henrygd 2fea95b3f1 chore(hub): update bun + npm lockfiles 2026-10-13 07:33:25 -04:00
spatiumstasandGitHub 9e60049248 fix(site): support Tailwind directives in Biome (#2603) 2026-10-13 07:31:01 -04:00
spatiumstasandGitHub 4886479cd4 fix(site): preserve lazy loading of the systemd table (#2602) 2026-10-13 07:20:45 -04:00
henrygd bb23f99b3e fix(agent): keep raw ZFS pool capacity when the root dataset has a refquota
A refquota on a pool's root dataset caps its avail by the root's own
referenced data, so used+avail can understate pool capacity when child
datasets hold most of the data and trigger false disk usage alerts.
Fetch refquota with the root datasets and fall back to the raw zpool
figures for those pools.
2026-10-12 14:17:59 -04:00
kenny-ishandGitHub 32d4692853 fix(agent): report ZFS pool capacity from the root dataset (#2540)
The pool overview used `zpool list`, whose size and alloc count raw vdev
space. On raidz that includes parity, so a TrueNAS pool with 65 TB usable
showed 98 TB capacity, while the details page (root dataset) matched TrueNAS.

Take Size, Alloc and Free from the pool's root dataset (used+avail), the same
way Btrfs reports effective capacity. If the root dataset cannot be read, keep
the raw figures and set Raw so the UI labels them as raw usage.

Fixes #2539
2026-10-12 14:14:19 -04:00
spatiumstasandGitHub 9cf75cca7a fix(site): stabilize system dialog layout across tabs (#2571) 2026-10-12 12:53:11 -04:00
Rajeev GadgilandGitHub 02f24ed0af fix(agent): fall back to NVML power samples when power usage is unsupported (#2550) 2026-10-12 12:45:27 -04:00
MarrrrrrrrryandGitHub a1d86d120f refactor(ui): measure y-axis labels via textContent instead of innerHTML (#2536) 2026-10-12 11:41:10 -04:00
Rajeev GadgilandGitHub a1cbdc980e fix(hub): omit zero GPU package power from stored stats (#2551) 2026-10-12 11:08:53 -04:00
Sven van GinkelandGitHub 665bcb3e53 refactor(agent): consolidate smartctl JSON types and SMART parsers (#2584) 2026-10-12 10:34:37 -04:00
spatiumstasandGitHub 3d33d5eabb fix(agent): preserve NVMe namespace fallbacks across rescans (#2597) 2026-10-12 09:28:44 -04:00
Mario MoharandGitHub da51dfd598 fix(site): unsubscribe live metrics that resolve after leaving 1m (#2599)
pb.realtime.subscribe() resolves only once the server has confirmed the
subscription. When the chart time changed away from 1m before that, the
effect cleanup ran with the initial no-op, the subscription stayed active,
and its 1m points kept overwriting the 1h history. Track cancellation,
unsubscribe as soon as the late subscription resolves, and ignore messages
that arrive after cleanup. Fixes #2598.
2026-10-12 09:14:31 -04:00
Mario MoharandGitHub 596f96442e fix(hub): keep the updater running when the system record lookup fails (#2588)
getRecord removed the system from the manager on any error, so a query that
timed out while the hub was stalled stopped the updater for good. The system
stayed 'up' in the database and was never polled again until a restart.
Only a record that is really gone removes the system now. (#2544)
2026-10-11 13:39:00 -04:00
Sven van GinkelandGitHub 4da7d867f2 systemd: include user journals in service logs (#2553) 2026-10-11 13:02:38 -04:00
d324ccc097 feat(agent): support custom WebSocket headers with HUB_HEADERS (#2585)
Co-authored-by: henrygd <hank@henrygd.me>
2026-10-11 11:22:37 -04:00
henrygd 7f2eb90f24 perf(agent): reuse buffer when reading intel_gpu_top samples 2026-10-11 10:44:18 -04:00
yi111andGitHub 7f63e65f22 fix(agent): parse intel_gpu_top -J arrays that omit commas between samples (#2589) 2026-10-11 10:35:56 -04:00
henrygd f8d3fe1817 fix: use omitzero for scalar JSON fields under json v2
PocketBase now marshals record JSON fields with encoding/json/v2, where
omitempty no longer omits zero numbers or false. This roughly doubled the
size of stored system_stats rows with zero-value keys. Switch scalar
fields to omitzero to restore the v1 output shape, and add a test that
compares v1 and v2 output for zero-heavy values.
2026-10-11 09:47:30 -04:00
Bharat KauravandGitHub 383e9c7072 fix(agent): widen NVMe unsafe_shutdowns to uint (#2583)
unsafe_shutdowns was uint16, so drives reporting more than 65535 unsafe
shutdowns made json.Unmarshal fail and the entire NVMe SMART record was
discarded with only "no valid SMART data found" in the logs. Widen it
to uint, matching power_cycles (#2484), and log the unmarshal error at
debug level so similar failures are diagnosable.

Fixes #2582
2026-10-11 09:17:17 -04:00
spatiumstasandhank 13bdd05934 fix: handle cached NVMe failures and empty SMART responses 2026-10-09 14:40:55 -04:00