Title: SentryLab-PVE
A lightweight monitoring stack for Proxmox VE hosts. Collects system, storage, ZFS, NVMe wear/SMART metrics and publishes them to MQTT for Home Assistant (and ESPHome displays). Tested on Proxmox VE 9.1.4.
- Split collectors: system, temp, wear, health, zfs, non-zfs; orchestrated by active/passive runners.
- Systemd timers for clean scheduling; start/stop helpers provided.
- Safe SMART usage to avoid waking sleeping devices (active cycle only).
- MQTT discovery for Home Assistant; CSV exports for quick hardware mapping.
- ESPHome example (Witty Cloud) for visual alerts.
install.sh # Installer (copies scripts and units)
src/
sentrylab.conf # MQTT + host config
utils.sh # Shared helpers and topics
discovery.sh # HA MQTT discovery
system.sh # System metrics
temp.sh # NVMe temps
wear.sh # NVMe wear
health.sh # NVMe SMART health
zfs.sh # ZFS pools
non-zfs.sh # Non-ZFS volumes
monitor-passive.sh # Lightweight cycle (no wake)
monitor-active.sh # Invasive cycle (SMART/ZFS sync)
start.sh / stop.sh # Enable/disable all timers
system/
*.service/*.timer # systemd units
esphome/
sentrylab-witty.yaml # Witty Cloud example
fragments.yaml # Reusable RGB logic
- MQTT broker and Home Assistant
- Proxmox host with bash + systemd
- Packages:
git,jq,mosquitto-clients
apt update && apt install -y git jq mosquitto-clientsgit clone https://github.com/CmPi/SentryLab-PVE.git
cd SentryLab-PVE
sudo ./install.shInstaller targets:
- Scripts:
/usr/local/bin/sentrylab/ - Config:
/usr/local/etc/sentrylab.conf - Units: copied to
/usr/local/bin/sentrylab/system/(deployed to/etc/systemd/system/only whenstart.shis used, removed whenstop.shis used, subject to backup) - CSV exports:
/var/lib/sentrylab/exports/
Edit /usr/local/etc/sentrylab.conf:
BROKER,PORT,USER,PASSHOST_NAME(defaults to hostname)- Optional:
MQTT_QOS,HA_BASE_TOPIC,DEBUG=truefor dry-run
# Discovery (HA configs only)
DEBUG=true /usr/local/bin/sentrylab/discovery.sh
# Passive set (no wake): system + non-zfs
DEBUG=true /usr/local/bin/sentrylab/monitor-passive.sh
# Active set (may wake drives): temp, wear, health, zfs, non-zfs
DEBUG=true /usr/local/bin/sentrylab/monitor-active.shSet DEBUG=false to publish for real.
sudo /usr/local/bin/sentrylab/start.sh # enable+start timers
sudo /usr/local/bin/sentrylab/stop.sh # disable all timersSuggested cadences (edit timers if needed):
- Passive: every 3–5 minutes
- Active: 15–30 minutes (or daily for SMART)
- Discovery: at boot or when sensor set changes
cd SentryLab-PVE
sudo ./uninstall.shThe uninstaller will:
- Run
stop.shto disable and stop all services/timers - Remove any systemd units from
/etc/systemd/system/that weren't properly cleaned up - Remove all scripts from
/usr/local/bin/sentrylab/ - Remove the export directory
/var/lib/sentrylab/(CSV files will be regenerated bydiscovery.shif reinstalled) - Remind you to manually remove the config file if desired:
/usr/local/etc/sentrylab.conf
system: load/uptime/memory/storage summarytemp: NVMe tempswear: NVMe wear metricshealth: NVMe SMART healthzfs: pool health/usagedisks: non-ZFS usageavailability: online/offline heartbeat
| Metric | Topic | Payload Example |
|---|---|---|
| CPU Load | proxmox/<host>/system/load |
0.35 |
| Uptime | proxmox/<host>/system/uptime_sec |
86400 |
| NVMe Temp | proxmox/<host>/temp/nvme0 |
42.1 |
| NVMe Wear | proxmox/<host>/wear/nvme0_wearout |
3 |
| NVMe Health | proxmox/<host>/health/nvme0_media_errors |
0 |
| ZFS Pool | proxmox/<host>/zfs/<pool> |
{ "health": "ONLINE", "alloc": 123456789, "free": 987654321 } |
| Non-ZFS Disks | proxmox/<host>/disks |
{ "sda_size_bytes": 512110190592, "sda_free_bytes": 135239876608, ... } |
| Availability | proxmox/<host>/availability |
online |
- MQTT Discovery is published by
discovery.shtohomeassistant/(orHA_BASE_TOPIC). - If HA does not show the device, restart the MQTT integration or HA to consume retained configs, then run an active/passive cycle to publish states.
- Use
esphome/sentrylab-witty.yamlwith yoursecrets.yaml(wifi, API, OTA keys). - Set
nas_hostnameto matchHOST_NAMEinsentrylab.conf. - LED logic: ZFS alert = red/blue blink; CPU temp drives green/orange/red; off when cool.
- Discovery exports land in
/var/lib/sentrylab/exports/for NVMe/ZFS maps. - Use them to script HA dashboards or for quick inventory.
Issues and PRs welcome.