One, what is Nagios
1.nagios Introduction
Nagios is a monitoring system that monitors the system's operational status and network information. Nagios can monitor the specified local or remote host and service, as well as provide exception notification functionality. Nagios runs on the Linux/unix platform, while providing an optional browser-based web interface to allow system administrators to view network status, system issues, logs, and more.
Nagios is a very popular, open source and free computer and network system monitoring software. Nagios is the abbreviation for "Nagios Ain ' t gonna insist on sainthood". It was first released in 1999 with "Netsaint". Nagios is primarily used for monitoring in Linux and UNIX platform environments, but the host of MS Windows systems can also be monitored through plugins. Nagios is poll and selected as the most popular it ops tool in LinuxCon. It was named best open source software by InfoWorld in 2009 and is the best choice for systems management tools for the SourceForge community of the year. Nagios is also used by many well-known companies, including Aol,dhl,at&t, L ' oreal, Texas Instruments, Siemens COM CZ, Time Warner Cable, Yahoo, etc.
The main features of the 2.Nagios are:
-Monitor network services (SMTP, POP3, HTTP, NNTP, ping, etc.)
-Monitor host resources (processes, disks, etc.)
-Simple plug-in design to easily expand Nagios's monitoring capabilities
-concurrent processing of monitors such as services
-Error notification function (via email, pager, or other user-defined method)
-can specify a custom event handling controller
-Optional browser-based web interface to allow system administrators to view network status, system issues, logs, etc.
-System monitoring information can be viewed from the phone
Service side (222.105.134.103)
RPM installation Nagios first needs to install the extended Yum source
Rpm-y Install Epel-release
RPM Installation Nagios
Yum install-y httpd nagios nagios-pluginx nagios-plugins-all Nrpe Nagios-plugins-nrpe
Configure the Nagios login password after installation
[Email protected]]# htpasswd-c/etc/nagios/passwd nagiosadmin
New Password:
Re-type New Password:
Adding Password for user nagiosadmin
Modifying the Nagios configuration file
Vim/etc/nagios/nagios.cfg
Detect the configuration file is correct
Nagios-v/etc/nagios/nagios.cfg
Start HTTP and Nagios
Service httpd start;service Nagios start
Clear firewall configuration: iptables-f
Browser Access Http://ip/nagios
Client configuration (222.105.134.102)
Build Configuration Nagios
Configuring the extension source Rpm-y install Epel-release
RPM Installation Nagios
Yum install-y httpd nagios nagios-pluginx nagios-plugins-all Nrpe Nagios-plugins-nrpe
Vim/etc/nagios/nrpe.cfg find "allowed_hosts=127.0.0.1" added as "allowed_hosts=127.0.0.1,222.105.134.103" #加入服务机的ip
Find "dont_blame_nrpe=0" and Change to "dont_blame_nrpe=1"
Start client: Service Nagios start
When a service is locally monitored on the client side of the server , configure the server-side Nagios configuration file to add the following:
[Email protected]]# vi/etc/nagios/objects/commands.cfg
Define Command{
Command_name Check_nrpe
Command_line $USER 1$/check_nrpe-h $HOSTADDRESS $-C $ARG 1$
}
Server Add project monitored by monitored host (222.105.134.102)
cd/etc/nagios/conf.d/
Vim 222.105.134.102.cfg
define host { use linux-server ; Define monitoring host host_name 222.105.134.102 alias 134.102 address 222.105.134.102 } define service { use generic-service host_name 222.105.134.102 service_ description check_ping check_command check_ping!10.020%!200.0,50% max_check_attempts 5 normal_check_interval 1 } define service { use &Nbsp; generic-service host_ name 222.105.134.102 service_description check_ssh check_command check_ssh max_check_attempts 5 # When Nagios detects a problem, a total of 5 attempts to detect a problem before the alarm, if the value is 1, then detected a problem immediately alarm normal_check _interval 1 #重新检测的时间间隔, Unit is minutes, default is 3 minutes notification_interval 60 #在服务出现异常后, the failure has not been resolved and Nagios again notifies the user of the time. Units are minutes. If you think that all events require only one notification, you can set the option here to 0. }define service{ use generic-service host_name 222.105.134.102 service_description check_http check_command check_http max_check_attempts 5 normal_ check_interval 1 } define service { use generic-service host_name 222.105.134.102 service_description check_load check_command check_nrpe!check_load max_check_attempts 5 normal_check_interval 1} define service { use generic-service host_name 222.105.134.102 service_description check_disk_hda1 check_command check_nrpe!check_hda1 max_check_attempts 5 normal_check_interval 1} define service { use generic-service host_name 222.105.134.102 service_description check_disk_hda2 cHeck_command check_nrpe!check_hda2 max_check_attempts 5   NORMAL_CHECK_INTERVAL 1}
The monitoring disk is the/ETC/NAGIOS/NRPE.CFG configuration file that modifies the service side , as shown in the following changes
Command[check_hda1]=/usr/lib64/nagios/plugins/check_disk-w 20%-C 10%-p/dev/hda1command[check_hda2]=/usr/lib64/ Nagios/plugins/check_disk-w 20%-C 10%-p/dev/hda2 modified to: Command[check_hda1]=/usr/lib64/nagios/plugins/check_disk-w 20 %-C 10%-p/dev/sda1command[check_hda2]=/usr/lib64/nagios/plugins/check_disk-w 20%-C 10%-p/dev/sda2
That is, the system area code must be the same as the partition number in the configuration file
Post-write service end multiplicity start Nagios service:/etc/init.d/nagios restart
Client Restart Nrep service:/etc/init.d/nrep restart
This article is from the "Linux Nest" blog, please be sure to keep this source http://xiangcc.blog.51cto.com/10201823/1700675
Nagios Monitoring Installation