Nagios sends alerts via email

Source: Internet
Author: User

In addition to its rich monitoring capabilities, Nagios has a very powerful alarm function. For the alarm, commonly used is nothing more than mail and SMS alarm two ways, this article is mainly written in Nagios Mail alarm work.

Configuration of mail Alerts
We just need to edit the Contact.cfg file under/usr/local/nagios/etc/object and add the admin's mailbox after email. In general, if the Monitoring Project division is not too thin, the administrator can be responsible for all monitoring, and processing it, you can directly write one or more of the administrator's e-mail address, using a space or comma separated.


However, if the monitoring content of the server has a separate administrator, the network has a separate administrator, we can define multiple contacts (contact), and then use Contactgroup (Contact Group) to group the contacts.
For example, there are two people who manage the network, there are two people on the Management server, we can define two Contactgroup, then define the contact of four administrators, the following example is the contact.cfg that I am currently using, the server administrator has two, the network administrator has two

Configuration of the Contact.cfg
Define Contact{
Contact_Name zhang1
Use Generic-contact
Alias Zhang1
Service_notification_period 24x7
Host_notification_period 24x7
Service_notification_options W,u,c,r
Host_notification_options D,u,r
Service_notification_commands Notify-service-by-email
Host_notification_commands Notify-host-by-email
Email[email protected]
}

Define Contact{
Contact_Name zhang2
Use Generic-contact
Alias Zhang2
Service_notification_period 24x7
Host_notification_period 24x7
Service_notification_options W,u,c,r
Host_notification_options D,u,r
Service_notification_commands Notify-service-by-email
Host_notification_commands Notify-host-by-email
Email[email protected]
}

Define Contact{
Contact_Name Li1
Use Generic-contact
Alias Li1
Service_notification_period 24x7
Host_notification_period 24x7
Service_notification_options W,u,c,r
Host_notification_options D,u,r
Service_notification_commands Notify-service-by-email
Host_notification_commands Notify-host-by-email
Email[email protected]
}

Define Contact{
Contact_Name Li2
Use Generic-contact
Alias Li2
Service_notification_period 24x7
Host_notification_period 24x7
Service_notification_options W,u,c,r
Host_notification_options D,u,r
Service_notification_commands Notify-service-by-email
Host_notification_commands Notify-host-by-email
Email[email protected]
}

define contactgroup{
        contactgroup_name            network
         alias                                    network
        members                             zhang1,zhang2
        }

Define Contactgroup{
Contactgroup_name system
Alias system
Members Li1,li2
}

Note:

1, in the Commands.cfg file to define the command to send the message (the default is present)

2. Add contact information and intervals for notifications in hosts.cfg and services.cfg files.

3. Nagios uses a local mail server to send mail (SendMail or postfix), just make sure that sendmail or postfix is up.

Nagios sends alerts via email

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.