How to configure alerts in Prometheus for diskspace

user2153844 picture user2153844 · Oct 16, 2018 · Viewed 10k times · Source

We have prometheus running on Win Server box, and WMI exporter on a separate box(client). Able to read client metrics in Prometheus. Now the requirement is the moment Diskspace =>90 % , send an email alert, so that we can run a job to clean up space using an automated job / manual job.

Could you please help on how to configure alert for diskspace >90

enter image description here

Answer

Prafull Ladha picture Prafull Ladha · Oct 23, 2018

To send email notification based on alert you need to setup alertmanager with prometheus. Here is the guide how to do that: https://github.com/prometheus/alertmanager

Also you can configure the alert rules. I am using node exporter to fetch node metrics and using the following rule

- alert: DiskSpace10%Free
     expr: node_exporter:node_filesystem_free:fs_used_percents >= 90
     labels:
       severity: moderate
     annotations:
       summary: "Instance {{ $labels.instance }} is low on disk space"
       description: "{{ $labels.instance }} has only {{ $value }}% free."

You can configure the above rule according to WMI exporter and you will be good to go. Hope this helps.