Add a problem alert

In Pandora FMS the most basic way to make alerts is to assign an alert to a specific module.

Introduction

Of course, more advanced work can be done such as alerts on events, correlation, etc. The first alert to do is to send an email when one of the machines that are already being monitored (with the Host alive module) goes offline.

Pandora FMS alerts are composed by three elements:

In this specific case we are going to use a predefined command (sending emails), we are going to modify an action that already exists (Mail to XXX) and we are going to use a template that also exists, the Critical condition template, that will execute the alert when the module in question appears in critical condition.

See also: "Pandora FMS alert system (video)".

Server Configuration

For the correct operation of the command email you must configure in the file pandora_server.conf a mail server that allows to make relay.

In the example, the mail server located in our local host (localhost) using Postfix . You must put the IP address of the local mail server, or one on the Internet (configuring authentication for it).

To modify the server configuration file, you must access to él, located in /etc/pandora/pandora_server.conf as user root elevating its privileges by means of the command sudo su. You are the  only responsible for that key.

guiarapida_mailconf02.png

To edit such a configuration file in this example, the program vim is used. You can get more information in the tutorial video«File editing with VIM».

Look for the lines seen in the screenshot below and set those values. If you do not have a mail server, you can use for example a Gmail® account. You can see a quick guide on how to configure the Pandora FMS server to work with a Gmail® account in the following link: Configuration of email alerts.

Lines beginning with the # character are comments and are not taken into account by the server.

guíaapida_mailconf03.png

Once the changes are made press ESC and :wq to save the changes and exit. Once you are in the command line, restart the Pandora FMS server:

/etc/init.d/pandora_server restart

.

Alert Configuration

As indicated above, alerts in Pandora FMS are composed of 3 parts: Command, Action and Template. You can find these options in the section Alerts. In order to configure this alert you only need to modify the action so you will use the option Alert actions.

pfms-management-alert_actions.png

The action to use is Mail to admin, click on that name to edit the alert action.

pfms-management-alert_actions-mail_to_admin.png

Modify field 1 (Field 1) and put your email box, in this example it is used yourmail@example.com. Field 2 (Field 2) is left the text that is in the screenshot. Here we are using two macros that will replace at run time the agent name and the module that has generated the alert.

Assign alert to module

Navigate to the agent edition where you have the module defined and click on the alerts tab:

pfms-agent_add_alert.png

Now add the module (Host Alive), the template (Critical Condition) and the action ( Mail to admin ). Click on the button Add alert.

pfms-agent_add_alert_2.png

Once added, you will be able to observe in the agent view whether it is running or not, seeing the color of its status:

pfms-agent_add_alert_alert_3.png

When the host goes out of line the alert will be initiated:

pfms-agent_add_alert_4.png

An email with the alert should arrive in your mailbox, something like the following:guiarapida_mail.png

Pandora FMS alerts are extremely flexible, and therefore, sometimes complex to use. There is a chapter in the documentation specifically for them: Alerts in Pandora FMS.