# PandoraFMS Integration

Connecting [Pandora FMS](https://pandorafms.com/en/) to ilert allows technical alerts – such as high CPU, disk full, or service downtime – to be forwarded to on-call staff. This enables fast diagnoses, structured escalation, and improved operational resilience across hybrid environments.

## In ilert: Create a PandoraFMS alert source

1. Go to **Alert sources** --> **Alert sources** and click on **Create new alert source**

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FjX0cS4q7woTXKajZmc1W%2FScreenshot%202023-08-28%20at%2010.21.10.png?alt=media&#x26;token=8ef3666b-84eb-4b51-abee-f07303313941" alt=""><figcaption></figcaption></figure>
2. Search for **PandoraFMS** in the search field, click on the PandoraFMS tile and click on **Next**.&#x20;

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FlXzQlJpaTFSR49AZk0xA%2FScreenshot%202023-08-28%20at%2010.24.23.png?alt=media&#x26;token=cffeacb4-57b9-47d4-827d-b0f6b1afd914" alt=""><figcaption></figcaption></figure>
3. Give your alert source a name, optionally assign teams and click **Next**.
4. Select an **escalation policy** by creating a new one or assigning an existing one.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FNnuZqONaIhbOf6fn4OkZ%2FScreenshot%202023-08-28%20at%2011.37.47.png?alt=media&#x26;token=8a74f7b5-5bd2-4eea-97fa-1c1dbb041333" alt=""><figcaption></figcaption></figure>
5. Select you [Alert grouping](https://docs.ilert.com/alerting/configure-alerting/alert-sources#alert-grouping) preference and click **Continue setup**. You may click **Do not group alerts** for now and change it later.&#x20;

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FueugN4JgHn1c90ggFA6u%2FScreenshot%202023-08-28%20at%2011.38.24.png?alt=media&#x26;token=b8009daf-3ca8-4264-a6fa-e42ef7333205" alt=""><figcaption></figcaption></figure>
6. The next page show additional settings such as customer alert templates or notification prioritiy. Click on **Finish setup** for now.
7. On the final page, an API key and / or webhook URL will be generated that you will need later in this guide.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fi3TIOBvNYBQfDtNpmm0A%2FScreenshot%202023-08-28%20at%2011.47.34.png?alt=media&#x26;token=6cae965a-e448-4443-8c20-37cf501c43b2" alt=""><figcaption></figcaption></figure>

## In PandoraFMS: Add ilert Webhook as Alert Command

1. Download our script pandorafms\_ilert.sh.\
   Download links:\
   [Pandora FMS modules library](https://pandorafms.com/library/)\
   [ilert Pandorafms](https://github.com/iLert/ilert-pandorafms)
2. Save this script into the following path :

   ```
   [SERVER_INSTALLATION_PATH]/pandora_server/util/ilert/
   ```
3. In the sidebar, go to **Alerts** -> **Commands** and click on the **Create** button.
4. Enter a **Name** for the command.
5. In the **Command** field enter: \\

   ```
   sh /usr/share/pandora_server/util/ilert/pandorafms_ilert.sh "_field1_" "_field2_" "_id_alert_" "_field3_" "_field4_" "_timestamp_" "_alert_text_severity_" "_agentname_" "_module_" "_data_"
   ```
6. In the **Description** field enter:\
   `_field1_ : ilert alert source API key.`\
   `_field2_ : Type of the created event. Can be "alert" or "resolved".`\
   `_field3_ : Title of the event.`\
   `_field4_ : Description of the event.`

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FrX6YNDpZO9TXjOj075mX%2FScreenshot%202022-09-19%20at%2015.40.45.png?alt=media&#x26;token=214b2d9b-1fcb-474c-b386-7a425c2a8ca9" alt=""><figcaption></figcaption></figure>

7. Enter following field descriptions:\
   **1 field description**: `ilert API Key (click on the hide checkbox, to keep the Key secure)`\
   \`\`**2 field description**: `Event Type`\
   **2 field values**: `alert,Alert;resolved,Resolved`\
   **3 field description**: `Title`\
   **4 field description**: `Description`

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FimyBNHq4TF4iaquNgJQL%2FScreenshot%202022-09-19%20at%2015.50.14.png?alt=media&#x26;token=429fc0e4-fbb4-4a89-abc4-3933499bd656" alt=""><figcaption></figcaption></figure>

8. Save the command by clicking on the **Create** button.
9. In the sidebar, go to **Alerts** -> **Actions** and click on the **Create** button.
10. Enter a **Name** for the action. Select a **Group** and select a the previous made **Command**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FgRqwBYWtySOFZrqBLhF4%2FScreenshot%202022-09-19%20at%2016.14.04.png?alt=media&#x26;token=5d6c2f81-27c1-426e-af89-90bb38f95856" alt=""><figcaption></figcaption></figure>

11. For **ilert API Key** enter the API Key created in ilert on [this step](#in-ilert-create-pandorafms-alert-source).
12. Depending on the section **Triggering/Recovery** set the **Event Type** to Alert/Resolved
13. Enter a **Title** and a **Description**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fx7O2Jo7cq1d9deBp6btv%2FScreenshot%202022-09-19%20at%2016.11.36.png?alt=media&#x26;token=5fb76ed1-f5e0-4155-aa71-2a4cb4f5ab5d" alt=""><figcaption></figcaption></figure>

14. Save the Action by clicking on the **Create** button.
15. In the sidebar, go to **Alerts** -> **Templates** and click on the **Create** button.
16. Enter a **Name** for the Template, assign a **Group** and set a **Priority**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FLOMCpt72M6jNdsBw5bYG%2FScreenshot%202022-09-19%20at%2016.15.09.png?alt=media&#x26;token=bb03f2a2-0e60-4a13-b076-ead49739a77e" alt=""><figcaption></figcaption></figure>

17. On the next step, select our created action as **Default action**.
18. Set a **Condition type** and a **Value**(dependent on the type) for the event to get fired.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FKwWZH3ltAZolN5f4SrVy%2FScreenshot%202022-09-19%20at%2016.15.51.png?alt=media&#x26;token=c1e4250f-45a7-4518-b94b-9b3c9580549c" alt=""><figcaption></figcaption></figure>

19. &#x20;On the next step, enable **Alert recovery** to activate the automatical alert recovery in ilert.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FzlWRDE4gWwG3FAe3wes5%2FScreenshot%202022-09-22%20at%2012.39.24.png?alt=media&#x26;token=b21ef1c0-3b4a-4a5b-ab48-4b155e9c6c53" alt=""><figcaption></figcaption></figure>

20. &#x20;Create the template.
21. &#x20;In the sidebar, go to **Alerts** -> **List of Alerts** and click on the **Create** button.
22. &#x20;Enter a **Agent**, the **Module**, the previous created **Action**, and the **Template**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F8CDZVCxGJRYIIcaef6mU%2FScreenshot%202022-09-19%20at%2016.16.50.png?alt=media&#x26;token=7afc5a02-f808-4795-9195-a1330eba33d7" alt=""><figcaption></figcaption></figure>

23. &#x20;Click on **Add alert** to finish the integration.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FGYveREVKwMI4icfPTn9v%2FScreenshot%202022-09-19%20at%2016.17.15.png?alt=media&#x26;token=ec6b931f-56e0-400e-a547-746ee001d3ff" alt=""><figcaption></figcaption></figure>

## FAQ

**Will alerts in ilert be resolved automatically?**

Yes, as soon as a module has been recovered, the alert in ilert will be resolved automatically. Make sure to fill out the **Recovery** fields in **Alert Action** and enable **Alert recovery** in **Templates** in [PandoraFMS](#in-pandorafms-add-ilert-webhook-as-alert-command).
