Tiny NFS connectivity monitor that pushes a Home Assistant binary_sensor via REST.
- 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).
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
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)"
sudo env INSTANCE="media-nfs" \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/zacs/nfs-ha-monitor/main/scripts/uninstall.sh)"