1, Nagios features: Monitor the status of the server, powerful alarm function, the drawing function is weak need to use other plug-ins to implement or integrate other monitoring software.
2. Five states of Nagios: OK warnning CRITICAL UNKNOWN PENDING
OK: normal
Warnning: Warning (typically over threshold)
CRITICAL: Critical Warning (host or service is down or exceeds specified threshold)
UNKNOWN: Unknown
PENDING: Pending (General Add new service initial state)
3, monitoring page:650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/7F/42/wKiom1cYHwmz6uugAAIOr_ Qwt5q259.png "title=" 2.png "alt=" Wkiom1cyhwmz6uugaaior_qwt5q259.png "/>
Nagios not only monitors and displays the status of the service or host, but also displays relevant information, but cannot draw to show trends, etc.
4. Architecture:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/42/wKiom1cYHHijA-1sAAOqd2eSQN8661.png "title=" 1.png " alt= "Wkiom1cyhhija-1saaoqd2esqn8661.png"/>
Nagios server-side main components: Nagios and Nagios plugins (requires Apache or Nginx and PHP support, if need to monitor MySQL need to install MySQL, etc.)
5, monitoring mode:
Active monitoring: the Monitoring Server provides external services, such as: Web services, monitoring side can be directly detected by the corresponding plug-in, based on the return information to determine the status, this method does not need to be monitored to install any plug-in or any special configuration.
(semi) Passive monitoring mode: such as the hardware resources, temperature and other information, monitoring can not be directly detected, can only be installed by the monitoring end of the relevant access to obtain information plug-ins to achieve, for example: NRPE, SNMP, etc., but because the detection action is initiated by the monitoring side, So belongs to the semi-passive monitoring (to monitor the monitoring side), passive monitoring mode has NSCA and so on, monitoring side in the monitoring state, monitoring information is completely monitored by the end of the active send.
NRPE: can monitor Linux/unix and Windows,linux/unix need to install NRPE and Nagios plugins (NRPE dependent plugins)
Windows needs to install nsclient+, this software provides Nrpe functionality (and others, such as CHECK_NT, etc.)
Usage: The Nrpe of the monitored end monitors the TCP 5666 port by default, and the monitor side uses the plug-in Check_nrpe instruction to directly remotely invoke the existing plug-in to obtain relevant information, therefore, the monitoring side needs to configure the relevant plug-in of the detection information in advance (instruction)
SNMP: primarily used to monitor interconnection devices such as switch routers
6. Installation
[email protected] ~]# yum install-y httpd php php-devel php-mysql mysql-devel mysql-server
MySQL Related components selective installation
To create related users and groups:
[[email protected] ~]# groupadd nagcmd[[email protected] ~]# useradd-g nagcmd nagios[[email protected] ~]# passwd nagios[ [Email protected] ~]# usermod-a-G nagcmd Apache #将运行apache的用户添加到nagcmd组中
Compiling and installing Nagios
[Email protected] ~]#/configure--prefix=/usr/local/nagios--with-command-group=nagcmd--enable-event-broker[[ Email protected] ~]# [[email protected] ~]# make All[[email protected] ~]# make Install[[email protected] ~]# make INS Tall-init[[email protected] ~]# make Install-commandmode[[email protected] ~]# make Install-config[[email protected] ~] # [email protected] ~]# make install-webconf #生成nagios网页相关配置文件/etc/httpd/conf.d/nagios.conf [[email protected] ~]#
Create a user name and password to access Nagios:
[Email protected] ~]# htpasswd-c/usr/local/nagios/etc/htpasswd.users nagiosadmin[[email protected] ~]#
Note: It is best to verify the file and user name using this default, if you modify the validation file in/etc/httpd/conf.d/nagios.conf to modify the relevant items, if you want to use a different account, please modify the/usr/local/nagios/cgi.cfg related options, as follows:
[email protected] etc]# Cat Cgi.cfg | grep nagiosadminauthorized_for_system_information=nagiosadminauthorized_for_configuration_information= Nagiosadminauthorized_for_system_commands=nagiosadminauthorized_for_all_services=nagiosadminauthorized_for_all _hosts=nagiosadminauthorized_for_all_service_commands=nagiosadminauthorized_for_all_host_commands=nagiosadmin[ [Email protected] etc]#
This article is from the "retrograde person" blog, please be sure to keep this source http://lingyi.blog.51cto.com/2837715/1766070
Nagios Monitoring Series Learning-Introduction and installation