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

**URL:** <https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878>\
**Category:** Percona Monitoring and Management (PMM)\
**Created:** [November 6, 2021, 5:22am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878 "2021-11-06T05:22:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 6, 2021, 5:22am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/1 "2021-11-06T05:22:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 8, 2021, 3:12pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/2 "2021-11-08T15:12:46Z")

</div>

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

Can somebody help on this?

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 30, 2021, 6:50am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/3 "2021-11-30T06:50:17Z")

</div>

Can somebody help on this?

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [November 30, 2021, 11:47am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/4 "2021-11-30T11:47:54Z")

</div>

Hi, something like this should get you started:

```auto
 - 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 }}"

```

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 30, 2021, 12:29pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/5 "2021-11-30T12:29:17Z")

</div>

Hi @Ivan_Groenewold

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

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/2/2889225512dde8b1d084a52c7dd24606303bac74.png)

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [November 30, 2021, 12:40pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/6 "2021-11-30T12:40:02Z")

</div>

Ok I used the Prometheus syntax. Try this instead:

```auto
---
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 }}"

```

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 30, 2021, 2:21pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/7 "2021-11-30T14:21:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [November 30, 2021, 2:27pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/8 "2021-11-30T14:27:09Z")

</div>

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:

> **[MongoDB Integrated Alerting in Percona Monitoring and Management - Percona...](https://www.percona.com/blog/2021/06/14/mongodb-integrated-alerting-in-percona-monitoring-and-management/)**
>
> Percona Monitoring and Management (PMM) recently introduced the Integrated Alerting feature as a technical preview. This was a very eagerly awaited feature, as PMM doesn’t need to integrate with an external alerting system anymore. Recently we...

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [November 30, 2021, 2:33pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/9 "2021-11-30T14:33:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anthony\_Hawkins](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/anthony_hawkins/32/7124_2.png) [@Anthony\_Hawkins](https://forums.percona.com/u/Anthony_Hawkins)\
**Post date:** [August 9, 2022, 9:10am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/10 "2022-08-09T09:10:32Z")

</div>

Please go through this site:

> **[MongoDB Integrated Alerting in Percona Monitoring and Management - Percona...](https://www.percona.com/blog/2021/06/14/mongodb-integrated-alerting-in-percona-monitoring-and-management/)**
>
> Percona Monitoring and Management (PMM) recently introduced the Integrated Alerting feature as a technical preview. This was a very eagerly awaited feature, as PMM doesn’t need to integrate with an external alerting system anymore. Recently we...

---

<div class="post-metadata">

**Author:** ![Vaibhav232](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vaibhav232](https://forums.percona.com/u/Vaibhav232)\
**Post date:** [January 22, 2024, 11:30am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/11 "2024-01-22T11:30:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [January 23, 2024, 12:09pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/12 "2024-01-23T12:09:35Z")

</div>

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

> **[Percona Monitoring and Management - Percona Alerting](https://docs.percona.com/percona-monitoring-and-management/get-started/alerting.html#alert-rules-templates)**
>
> Alerting notifies of important or unusual activity in your database environments so that you can identify and resolve problems quickly. When something needs your attention, Percona Alerting can be configured to automatically send you a notification...

---

<div class="post-metadata">

**Author:** ![Vaibhav232](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vaibhav232](https://forums.percona.com/u/Vaibhav232)\
**Post date:** [January 29, 2024, 1:19pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/13 "2024-01-29T13:19:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [January 30, 2024, 2:21am UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/14 "2024-01-30T02:21:40Z")

</div>

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

> [@SMTP settings in pmm-server](https://forums.percona.com/t/smtp-settings-in-pmm-server/5354/5):
>
> Hi Andy, I entered AWS SES smtp server credentials, everything is working fine. my steps: run bash inside container docker exec -it pmm-server /bin/bash open editor on /etc/grafana/grafana.ini file [smtp] enabled = true host = email-smtp.us-east-1.amazonaws.com:25 user = SOME\_ACCEESS\_ID password = SOME\_SECRET\_ID ;key\_file = ;skip\_verify = false from\_address = from-email&#64;some-domain.com save changes and exit from containers bash restart container docker restart pmm-server go to…

> **[Enable Email Sending in Percona Monitoring and Management 2](https://www.percona.com/blog/enable-email-sending-in-percona-monitoring-and-management-2/)**
>
> How to enable email sending in Percona Monitoring and Management natively in Grafana for Gmail and Office 365.

---

<div class="post-metadata">

**Author:** ![beckzg](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@beckzg](https://forums.percona.com/u/beckzg)\
**Post date:** [January 24, 2025, 4:18pm UTC](https://forums.percona.com/t/how-to-configure-disk-space-alerts-to-get-a-email-team-from-pmm2/12878/15 "2025-01-24T16:18:21Z")

</div>

> [@Ivan\_Groenewold](#):
>
> `(node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes`

How can I use the value of this formula and put in for example to the Description or Summary lines? I tried to use $value but that inserts the whole information and not the exact number, if I try the $value.value then nothing happens, for example:

Value: [var=‘A’ labels={agent\_id=/agent\_id/24655d9a-dbc0-4141-906d-929871d93f72, agent\_type=node\_exporter, device=/dev/vda1, fstype=ext4, instance=/agent\_id/24655d9a-dbc0-4141-906d-929871d93f72, job=node\_exporter\_agent\_id\_24655d9a-dbc0-4141-906d-929871d93f72\_hr, machine\_id=/machine\_id/9a77d86bbd13408597d33601ecb56ee7, mountpoint=/, node\_id=/node\_id/efdd1554-ae9a-4e0b-9477-e336d5f6dfc6, node\_name=somemachine, node\_type=generic} value=25.515394877019094]
