How to configure disk space alerts to get a email/team from PMM2

Hi Team,

How do we configure the disk space alerts in PMM2? If we get a alerts for disk space issues then it would be fine.

We need a diskspace alerts for all the mounts, it would be fine.

Can somebody help on this?

1 Like

Can somebody help on this?

1 Like

Hi, something like this should get you started:

 - alert: HostOutOfDiskSpace
    expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0
    for: 2m
    labels:
      severity: warning
    annotations:
      summary: Host out of disk space (instance {{ $labels.instance }})
      description: "Disk is almost full (< 10% left)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
1 Like

Hi @igroene

I tried with above one already but I am getting the below error.
ERROR: Failed to parse rule template.

1 Like

Ok I used the Prometheus syntax. Try this instead:

---
templates:
  - name: HostOutOfDiskSpace
    version: 1
    summary: HostOutOfDiskSpace
    expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0
    severity: warning
    annotations:
      summary: Host out of disk space (instance {{ $labels.instance }})
      description: "Disk is almost full (< 10% left)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
2 Likes

Hi @igroene

Thanks for info, its working fine.

Can you give me the reference link which you give, so that I ill work on other alerts.

1 Like

Glad to hear! normally I start by going to the metrics explorer to check what’s available, there are plenty of examples on the internet if you search for prometheus alerts. Some examples are here as well:

1 Like

Thank you so much for the information provided. I will check it on this.

1 Like