Commit Graph

3 Commits (master)

Author SHA1 Message Date
mirivlad fe1463442a fix: Agent network metrics initialization
- Initialize _prev_net_io on first call for all interfaces
- Calculate metrics from second call onwards
- This ensures metrics are captured starting from cycle 2
2026-04-17 10:19:32 +08:00
mirivlad f1fc514a33 fix: Agent network and disk metrics for VPS
Network:
- Remove speed > 0 check in _is_real_interface()
- Use 1000 Mbps default for interfaces with speed=0
- This allows virtual interfaces (ens3) to be detected
- Remove network_rx/network_tx (no longer needed)

Disk:
- Rewrite get_disk_metrics() to detect unique devices
- If only one device (/) - create only disk_used_root
- If multiple devices - create for each
- This fixes VPS with single disk showing same % for all mounts
2026-04-17 10:11:16 +08:00
mirivlad bce4c2e2d0 fix: Update agent install, disk metrics, fallback blocks, and dynamic thresholds
BREAKING: install.sh now downloads agent from server instead of embedding it

Changes:
- AgentController: downloadAgent() method for serving agent.py with token auth
- AgentController: rewrite generateInstallScript() to curl agent from server
- agent.py: copy production version from server (with temp, disk, network metrics)
- agent.py: fix get_disk_metrics() to use priority mountpoints (/, /home, etc)
- agent.py: fix disk_total_gb collection to use priority mountpoints
- detail.twig: add fallback blocks for temperatures (alert-info)
- detail.twig: add fallback blocks for disk doughnuts (alert-warning)
- detail.twig: add fallback blocks for network graphs (alert-warning)
- detail.twig: add null check for ramTotalGB in tooltip
- detail.twig: improve thresholds form with human-readable labels and units
- ServerDetailController: query only metrics that exist on server and display on graphs

For server 3 (mirv.top):
- After deploy, download new install.sh and reinstall agent
- This will add disk_used_root, ram_total_gb, temperatures support
2026-04-17 09:25:43 +08:00