# LibreNMS Mdadm RAID監控警報

##### **啟用Mdadm**

**確認已安裝[Mdadm監控](https://note.homesitetw.com/books/librenms/page/librenms-mdadm-raid)**

##### **新增警報規則**

**Severity:警報等級**

**Max alert ：最多通知幾次**

**Delay ：延遲多久再來通知**

**Interval ：通知間隔**

**Transports:選擇傳送類別**

<span style="color: rgb(0, 0, 0);">**範例監控RAID降級後1分鐘發出警報**</span>

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2025-09/scaled-1680-/K2Eimage.png)](https://note.homesitetw.com/uploads/images/gallery/2025-09/K2Eimage.png)

##### **新增警報範本**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2026-11/scaled-1680-/hunimage.png)](https://note.homesitetw.com/uploads/images/gallery/2026-11/hunimage.png)

```
{{ $alert->title }}
設備名稱: {{ $alert->display }} 
@if (!empty($alert->uptime_short))
運行時間: {{ $alert->uptime_short }}
@endif
@if ($alert->state == 0)
持續時間: {{ $alert->elapsed }}
恢復時間: {{ $alert->timestamp }}
@foreach ($alert->faults as $key => $value)
降級恢復RAID : {{ explode('_', $value['metric'])[0] }}
@endforeach
@else
告警時間: {{ $alert->timestamp }}
@foreach ($alert->faults as $key => $value)
降級RAID : {{ explode('_', $value['metric'])[0] }}
@endforeach
@endif
```

##### **測試**

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2026-11/scaled-1680-/Y1Aimage.png)](https://note.homesitetw.com/uploads/images/gallery/2026-11/Y1Aimage.png)

[![image.png](https://note.homesitetw.com/uploads/images/gallery/2026-11/scaled-1680-/B5Nimage.png)](https://note.homesitetw.com/uploads/images/gallery/2026-11/B5Nimage.png)