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 @Ivan_Groenewold

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 }}"
3 Likes

Hi @Ivan_Groenewold

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.

2 Likes

Please go through this site:

2 Likes

Hi Naresh where did you get a alerts message could you tell me please

@Vaibhav232 Please go through the below documentation. You have to create the rules using the alert templates as per your requirements.

2 Likes

hi Nareesh I have tried to configure the same setting but when i went to test the contact point parametere
i got error that smtp configuration not mention into the grafana.ini file instead i have pass one env file in while creating the container for smtp configuration what will be the error then

@Vaibhav232 You need to follow the below to setup SMTP settings in the Grafana.ini file.