Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ cards:
- sensor.vps1_temp
```

## Health and Alert Automations

Use the provided sensors to notify you when a server looks unhealthy. For example:

- High CPU or memory usage sustained for several minutes.
- Disks approaching full capacity.
- Sensors turning `unavailable`/`unknown`, which likely means SSH connectivity is down.

You can copy and adjust the sample automations in [`examples/automations/health_alerts.yaml`](examples/automations/health_alerts.yaml) to fit your entity names and preferred notification services.

## SSH Key Storage

- When running **Home Assistant OS**, copy your SSH private key into the `/config/ssh/` directory (for example via the File
Expand Down
47 changes: 47 additions & 0 deletions examples/automations/health_alerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Example Home Assistant automations for VServer SSH Stats sensors
# Replace entity IDs and notify targets with values from your setup.

- alias: "[VServer] CPU usage high"
description: "Alert when CPU usage stays above 85% for 5 minutes."
trigger:
- platform: numeric_state
entity_id: sensor.vps1_cpu
above: 85
for: "00:05:00"
action:
- service: notify.notify
data:
title: "High CPU usage on VPS1"
message: "CPU has been above 85% for 5 minutes. Current: {{ states('sensor.vps1_cpu') }}%"
mode: single

- alias: "[VServer] Disk usage warning"
description: "Warn when root filesystem is getting full."
trigger:
- platform: numeric_state
entity_id: sensor.vps1_disk
above: 85
action:
- service: notify.notify
data:
title: "Disk usage warning on VPS1"
message: "Root filesystem is {{ states('sensor.vps1_disk') }}% used."
mode: single

- alias: "[VServer] SSH sensor offline"
description: "Notify when SSH stats go unavailable for 3 minutes."
trigger:
- platform: state
entity_id:
- sensor.vps1_cpu
- sensor.vps1_mem
to:
- unavailable
- unknown
for: "00:03:00"
action:
- service: notify.notify
data:
title: "VPS1 offline?"
message: "SSH sensors have been unavailable for 3 minutes. Check connectivity."
mode: single