Nagios Monitoring System

Source: Internet
Author: User

Nagios is an open source free network monitoring tool that can monitor Windows, Linux and UNIX host status, switch routers and other network equipment, in the system or service status anomalies when sending mail or SMS alarm, the first time to notify the site operations personnel. Traffic monitoring is not his forte, traffic monitoring recommends using cacti (can draw very intuitive graphics.

To summarize Nagios, you can mainly monitor the following areas:
? If the host is down (by pinging, the host is considered down if the ping is not available, but does not affect other services being monitored)
? server resources (CPU usage, hard disk space, etc.)
? Network Services (Smtp\pop3\http\)
? Monitor network devices (routers, switches, etc.)

First, need to understand the point of knowledge
1. Nagios Working principle
Nagios itself does not include the ability to monitor hosts and services. All monitoring and monitoring functions are done through a variety of plugins. After installing Nagios, the/libexex in the Nagios home directory is included with Nagios's plugin, such as: Check_disk is the plug-in that checks the disk space, Check_load is the plug-in that checks the CPU load, each plug-in can run. check_xxx-h command to check its usage and functionality.

2. Four monitoring states of Nagios
Nagios can identify four status return information. 0 (OK) indicates a healthy state (green display), 1 (WARNING) indicates a warning (XXX), 2 (CRITICAL) indicates a very serious error (red), 3 (UNKNOWN) indicates an unknown error (deep xxx), Nagios determines the state of the monitored object based on the value returned by the plug-in, and is displayed through the Web for administrators to detect faults immediately.

3. Nagios manages the service work process remotely via the Nrpe plugin
1) Nagios executes the Check_nrpe plugin installed inside it and tells Check_nrpe to detect which services.
2) connect the Nrpe daemon on the remote machine via the Ssl,check_nrpe.
3) Nrpe run local plug-ins to detect the local server and status (Check_disk,... etc).
4) Nrpe The results of the test to the host side of the Check_nrpe,check_nrpe and then send the results to the Nagios state queue.
5) Nagios reads the information in the queue, then displays the results.

Second, the experimental environment

1. Experimental topology

2. Configuring Nagios monitoring system involves knowledge points
1) nagios configuration file:
Nagios.cfg: Master profile, defining the name and location of various configuration files
CGI.CFG: Controlling the CGI configuration file
Resource.cfg: Resource file, define various variables so that other files can be called
Objects: Other configuration file directory, this directory is mainly:
COMMAND.CFG: Command configuration file, define various command formats for other file calls
Contacts.cfg: Contacts and groups, send messages and other alarm information can be called
LOCALHOST.CFG: Monitor the configuration file for this machine
TIMEPERIODS.CFG: A configuration file that defines the monitoring time for other file calls
Hostgroups.cfg: The host (group) that defines the monitoring needs to be created manually.
2) Relationship between configuration files
Several of the definitions involved in Nagios configuration include hosts, host groups, services, service groups, contacts, contact group, monitoring time, and monitoring commands. As you can see from these definitions, Nagios's various profiles are interrelated and referenced to each other. To successfully configure a Nagios monitoring system, it is important to understand the dependencies and dependencies between each profile, with four points
? Define monitoring of those hosts, host groups, services, and service group
? define what command to use for this monitoring
? Define the time period for monitoring
? Define the contacts and contact ancestors to notify when there is a problem with the host or server

3) Configure Nagios
In order to be able to explain the problem more clearly and for ease of maintenance, it is recommended that you create a separate configuration file for each of the Nagios defined objects.
Create a conf directory to define host hosts

Create a hostgroups.cfg file to define a host group
? define contacts and contact groups with the default Contacts.cfg file
Use the default Commands.cfg file to define the command
? Use default timeperiods.cfg to define the monitoring time period
? Use the default Templetes.cfg file as a resource reference file

3. Configure Nagios
1) Modify the/USR/LOCAL/NAGIOS/ETC/NAGIOS.CGF master configuration file



Nagios Monitoring System

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.