# 13. Email Alert

**In Pandora FMS, alerts are assigned to specific modules of an agent.** When said module enters a particular state, actions can be performed, such as notifications to a particular user via the Web Console:

[![pfms-first-steps-alerts_by_email-image-007.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-007.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-007.png)

The first alert we are going to create consists of sending an email message when connection is lost on one of the machines being monitored.

<p class="callout info">Alerts in Pandora FMS are composed of three elements:</p>

1. **Command** (send an email).
2. **Action** (send a message to a specific user, using the previous command).
3. **Template** (execute a specific action when a condition is met).

In this specific case, a predefined command (sending emails) will be used, an existing action (**Mail to Admin**) will be modified to send it via a specific mailbox, and an existing template will be used, the **Critical condition** template, which will trigger the alert when the module in question appears in a critical state.

With alerts we can do many more things, such as creating an escalation, creating our own commands (to perform more complex integrations or notifications), sending recovery notices, and assigning alerts in bulk, but we will leave all that for another time. *This is a quick guide, right?*

#### <span style="font-weight: 400;">Configuring the email alert  
</span>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Pandora FMS already contains an email delivery server in its installation by default whose sender is `yourmail@domain.es`. Generally, those emails are classified as SPAM by any recipient. To </span><span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">change the email address in charge of sending notifications</span><span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, and the server that processes them, we must access from the console the section **Management** → **Settings** → **System Settings** → **General Setup**. In one of the configuration tabs you will find the **Alerts configuration** section:</span>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[![pfms-first-steps-alerts_by_email-image-010.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-010.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-010.png)</span>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you use the local server (`127.0.0.1`) you will not be able to send messages correctly, as it will depend on the configuration of your environment. If you need more information you can consult [this link](https://pandorafms.com/manual/en/documentation/pandorafms/management_and_operation/12_console_setup#ks1_1_7).</span>

<p class="callout info"><span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To prevent emails from being identified as *spam*, we recommend that you use a corporate email (Gmail®, Proton®, etc.).</span></p>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To configure the recipient of an alert, you only need to modify the action. The action is **Mail to Admin** in **Management**</span>**→**<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> **Actions**: </span>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[![pfms-first-steps-alerts_by_email-image-020.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-020.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-020.png)</span>

Edit the **Mail to Admin** action (by clicking on its name) and use this example as a reference:

[![pfms-first-steps-alerts_by_email-image-030.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-030.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-030.png)

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Field 1 (**Destination address**) will be modified and the destination mailbox address will be placed.</span>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In field 2, leave the text that is in the capture. Here two macros ( `_agent_` and `_module_` ) are being used which will replace the name of the agent and the module that generated the alert at runtime.</span>

<p class="callout info"><span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">There are about forty macros that you can use to obtain values when executing alerts. [See the documentation](https://pandorafms.com/manual/en/documentation/pandorafms/management_and_operation/01_alerts#ks15).</span></p>

<span style="font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Field 3 can be used to give body to the email, in HTML or plain text:</span>

[![pfms-first-steps-alerts_by_email-image-040.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-040.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-040.png)

Although Pandora includes an HTML viewer, we recommend that if you are going to compose emails in HTML, copy and paste the code here

[![pfms-first-steps-alerts_by_email-image-042.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-042.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-042.png)

If you have not modified the default action, the HTML template of the email will be similar to this. You can modify it later, now let's see how alerts are assigned.

#### <span style="font-weight: 400;">Assigning the alert to a module  
</span>

<span style="font-weight: 400;">We navigate to the edit view of an agent where we want to assign an alert to an already defined module and click on the alerts tab:</span>

<span style="font-weight: 400;">[![pfms-first-steps-alerts_by_email-image-050.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-050.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-050.png)</span>

<span style="font-weight: 400;">Now we add the module (for example, Host Alive), the template (Critical Condition) and the action that we configured in the previous step ( Mail to XXX ). Add the alert:</span>

[![pfms-first-steps-alerts_by_email-image-060.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-060.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-060.png)

<span style="font-weight: 400;">Once added, we can observe it in the agent view checking if it is running or not, by looking at the color of its status:</span>

[![pfms-first-steps-alerts_by_email-image-070.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-070.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-070.png)

<span style="font-weight: 400;">We can wait (or force) the *host* to go down to see if the alert works; one way is to insert a zero value directly into the module, which is of true/false type:</span>

<span style="font-weight: 400;">[![pfms-first-steps-alerts_by_email-image-090.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-090.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-090.png)</span>

<span style="font-weight: 400;">An email with the alert should arrive at the mailbox:</span>

[![pfms-first-steps-alerts_by_email-image-110.png](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/scaled-1680-/pfms-first-steps-alerts-by-email-image-110.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2026-03/pfms-first-steps-alerts-by-email-image-110.png)

<p class="callout info">Are you not achieving the results explained in this chapter? Access the [help](https://pandorafms.com/guides/public/books/first-steps-with-pandora-fms/page/21-where-to-look-if-problems-arise) or [support](https://pandorafms.com/guides/public/books/first-steps-with-pandora-fms/page/22-support) section.</p>