8000 GitHub - zacs/nfs-ha-monitor: Script to monitor NFS connection and report it to Home Assistant · GitHub
[go: up one dir, main page]

Skip to content

About

Script to monitor NFS connection and report it to Home Assistant

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nfs-ha-monitor

Tiny NFS connectivity monitor that pushes a Home Assistant binary_sensor via REST.

Features

  • Detects mount presence and I/O responsiveness (timeouts catch stale NFS).
  • Heartbeat every HEARTBEAT_SECS (default 300s) even if state unchanged.
  • Systemd templated units support multiple monitors per host (instances).

Quick install

sudo env INSTANCE="media-nfs" \
HA_URL="http://homeassistant.local:8123" \
HA_TOKEN="YOUR_LONG_LIVED_TOKEN" \
ENTITY_ID="binary_sensor.nfs_online" \
MOUNTPOINT="/mnt/media_nfs" \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/install.sh)"

Optional: TEST_PATH, PROBE_TIMEOUT (default 5), HEARTBEAT_SECS (default 300), CURL_INSECURE=true

TEST_PATH="/mnt/media_nfs"
PROBE_TIMEOUT=5
HEARTBEAT_SECS=300
CURL_INSECURE=false

Multiple mounts

Just use a different INSTANCE. Like this:

# Instance 1
sudo env INSTANCE="bama" \
HA_URL="http://homeassistant.local:8123" \
HA_TOKEN="YOUR_LONG_LIVED_TOKEN" \
ENTITY_ID="binary_sensor.bama_nfs_online" \
MOUNTPOINT="/nfs/media" \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/install.sh)"

# Instance 2
sudo env INSTANCE="photos" \
HA_URL="http://homeassistant.local:8123" \
HA_TOKEN="YOUR_LONG_LIVED_TOKEN" \
ENTITY_ID="binary_sensor.photos_nfs_online" \
MOUNTPOINT="/nfs/photos" \
HEARTBEAT_SECS=120 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/install.sh)"

# Instance 3
sudo env INSTANCE="backups" \
HA_URL="http://homeassistant.local:8123" \
HA_TOKEN="YOUR_LONG_LIVED_TOKEN" \
ENTITY_ID="binary_sensor.backups_nfs_online" \
MOUNTPOINT="/mnt/backups" \
PROBE_TIMEOUT=8 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/install.sh)"

Uninstall

sudo env INSTANCE="media-nfs" \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/uninstall.sh)"

About

Script to monitor NFS connection and report it to Home Assistant

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0