Nagios is an open-source, free network monitoring tool that effectively monitors Windows, Linux and UNIX host status, network devices such as switch routers, printers, and more. Send mail or SMS alarm when the system or service status is abnormal the first time to notify the site operators, after the status of the resumption of normal mail or SMS notification.
function Introduction
The features that Nagios can monitor are:
1, monitoring network services (SMTP, POP3, HTTP, NNTP, ping, etc.);
2, monitor the host resources (processor load, disk utilization, etc.);
3, simple plug-in design allows users to easily expand their services to detect methods;
4, parallel service inspection mechanism;
5, with the ability to define the hierarchical structure of the network, with the "parent" host definition to express the relationship between the network host, this relationship can be used to identify and clarify the host outage or unreachable state;
6, when the service or host problems arise and resolve the alarm sent to the contact person (via email, SMS, user-defined mode);
7, can define some processing procedures, so that it can be in service or host failure to play a preventive role;
8, automatic log scrolling function;
9, can support and implement redundant monitoring of the host;
10, the optional web interface for viewing the current network status, notification and fault history, log files and so on;
11, can be viewed through the mobile phone system monitoring information;
12, can specify the custom event processing controller;
How Nagios Works
Nagios's function is to monitor the service and host, but he does not include this part of the function, all the monitoring, detection functions are through a variety of plug-ins to complete.
After you start Nagios, it periodically automatically calls the plug-in to detect the server state, while Nagios maintains a queue, all the status information returned by the plug-ins goes into the queue, and Nagios reads the information from the beginning of the team and processes it, displaying the status results over the web.
Nagios provides a number of plug-ins that allow you to easily monitor many service statuses. After the installation is complete, there are all the plugins available in Nagios's/libexec in the Nagios home directory, such as Check_disk is the plug-in that checks the disk space, Check_load checks the CPU load, and so on. Each plugin can be used to view its usage and functionality by running the./check_xxx–h.
Four monitoring statuses for Nagios
OK, warn, critial, unknown
Nagios plug-ins required for each status monitoring
Check_by_ssh
Check_nt
Check_nrpe
Check_nsca
Check_snmp
CHECK_XYZ---------> Delegates can customize names
=============================================================
Deploying Nagios
Nagios Download https://www.nagios.org/downloads/nagios-core/thanks/?t=1503146125
Below is a demonstration of version 3.2.0
Deploying the Nagios monitoring side
1. Installing Nagios Core
1) Install Nagios dependent software
[email protected] ~]# yum install-y httpd mariadb-server php php-mysql GD PHP-GD
[Email protected] ~]# systemctl start httpd
[Email protected] ~]# Systemctl enable httpd
Created symlink From/etc/systemd/system/multi-user.target.wants/httpd.service to/usr/lib/systemd/system/ Httpd.service.
[Email protected] ~]# systemctl start mariadb
[Email protected] ~]# Systemctl enable MARIADB
Created symlink From/etc/systemd/system/multi-user.target.wants/mariadb.service to/usr/lib/systemd/system/ Mariadb.service.
2) Create Naigos user
[Email protected] ~]# Groupadd nagcmd
[Email protected] ~]# useradd-g nagcmd Nagios
[Email protected] ~]# Usermod-ag nagcmd Apache
3) Install Nagios core
[Email protected] ~]# tar zxf nagios-3.2.0.tar.gz
[Email protected] ~]# CD nagios-3.2.0
[Email protected] nagios-3.2.0]#/configure--with-command-group=nagcmd
[[email protected] nagios-3.2.0]# make all
[[email protected] nagios-3.2.0]# make install>>> generate Nagios-related files
[[email protected] nagios-3.2.0]# make Install-init>>> generate Nagios Service script
[[email protected] nagios-3.2.0]# make Install-commandmode>>> set Nagios permissions
[[email protected] nagios-3.2.0]# make Install-config>>> build config file
[[email protected] nagios-3.2.0]# make install-webconf>>> generate httpd child configuration file
Create a user who logs on to the Nagios Web page, which is used later to log on to Nagios via the web
[Email protected] ~]# htpasswd-c/usr/local/nagios/etc/htpasswd.users nagiosadmin
New Password:
Re-type New Password:
Adding Password for user nagiosadmin
[Email protected] ~]#
Nagios Directory Description:
/usr/local/nagios installation directory
/USR/LOCAL/NAGIOS/ETC configuration file
/usr/local/nagios/libexec Plug-in
2. Install Nagios Plugin
# tar zxf nagios-plugins-1.5.tar.gz
# CD nagios-plugins-1.5
#./configure--with-nagios-user=nagios--with-nagios-group=nagios
# Make && make install
via the # ls/usr/local/nagios/libexec/command, you can see that the plugin indicates the plugin was successfully installed
Start the Nagios service and set the boot from boot
[[email protected] ~]#/etc/init.d/nagios start
Reloading systemd: [OK]
Starting Nagios (via Systemctl): [OK]
[Email protected] ~]# chkconfig--add Nagios
[Email protected] ~]# chkconfig Nagios on
[Email protected] ~]# systemctl restart httpd
Log in to Nagios's Web interface http.//Native Ip/nagios
This article is from the "lyw666" blog, make sure to keep this source http://lyw666.blog.51cto.com/12823216/1957683
The second nagios of monitoring software