Configure new Nagios (1)

Source: Internet
Author: User

ConfigurationNagiosMany configurations are required, such as configuring contacts and contact groups.

By default, all Nagios configuration files are located in the/etc/nagios directory. For convenience, the configuration file symbols related to Apache may be linked to the Apache configuration directory. The configuration can be divided into multiple files, each of which is used for different parts of the configuration.

The first component to be set is the contact and Contact Group. Contacts are those who receive notifications about the stopping of the host or service. By default, Nagios provides pager and email notification methods. By using extensions, you can use Jabber and many other methods to send notifications, which is convenient in some cases.

The contact is stored in the contacts. cfg file and defined as follows:

Listing 1. Configuration 1: Basic contact information

 
 
  1. define contact{  
  2.  
  3. contact_name jdoe  
  4.  
  5. alias John Due  
  6.  
  7. service_notification_commands notify-by-email  
  8.  
  9. host_notification_commands host-notify-by-emailes  
  10.  
  11. email john.doe@yourcompany.com  
  12.  
  13. }  
  14.  

Group contacts: when the host or service status changes, Nagios does not specify the person to be notified, but notifies the relevant group. Sometimes you can even define a person multiple times to specify different notification commands or addresses, then, add all the methods to contact the user in the contact group (see list 2 ).

Listing 2. Configuration 2: group contacts

 
 
  1. define contactgroup{  
  2.  
  3. contactgroup_name server-admins  
  4.  
  5. alias Server Administrators  
  6.  
  7. members jdoe,albundy  
  8.  
  9. }  
  10.  

The next step is to configure the host to be monitored by Nagios. You should add all hosts that contain services that monitor or check whether they are active. The configuration file for storing host information is hosts. cfg. The following is an example of a host definition:


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.