CentOS installation Nagios

Source: Internet
Author: User

Nagios's introduction:1, Nagios is a monitoring system operating status and network information monitoring system. It monitors the system state of the specified local or remote host and the services that are running, while providing the ability to provide exception notifications. 2. Nagios can be run on the Linux/unix platform, while providing an optional browser-based web interface to facilitate system administrators to view network status, various system issues, as well as logs, performance graphs, etc. Nagios Features: 1, monitoring network services (mysql,http,ping, etc.)
2. Monitor host resources (processes, disks, etc.)
3, simple plug-in extension function
4, abnormal notification function (via email, SMS, etc.)
5, the Web interface enables system managers to view the status of network services at any time, system problems and so on 6, can be viewed through the mobile phone system monitoring information Nagios Installation:  One: Pre-Installation Preparation 1: Installation environment: CentOS OS 2: Required software:    nagios-3.0.3.tar.gz //nagios program installation package Httpd-2.2.2.ta r.gz  //apache installation Package Nagios-plugins-1.4.tar.gz //nagios plug-in installation package Nrpe-2.12.tar.gz //na The Gios extension, which is installed on the monitored server, provides Nagios with the operation of the server.      II: Nagios installation 1: Install Nagios main program # TAR–ZXVF nagios-3.0.3.tar.gz # CD nagios-3.0.3//To avoid      Compile-free errors, first create Nagios users and groups, and the/usr/local/nagios directory, specifying Nagios's directory genus. # groupadd Nagios # useradd nagios–g nagios # mkdir/usr/local/nagios # chown-r NAGIOS:NAGIOS/UAR/L Ocal/nagios #/configure--prefix=/usr/local/nagios # make all    //compile # make install    //install Nagios main program, CGI and HTML files etc # make install-init  //install Nagios startup script # make install-conf      ig //Copy the configuration file example into the Nagios configuration file # make install-commandmode //configure Nagios directory permissions. # Make install-webconf (as this command executes, it is created in/etc/httpd/conf.d/   NAgios.conf file, so before executing the command, mkdir-p/etc/httpd/conf.d/  #cat/etc/httpd/conf.d/nagios.conf >>/usr/local/h Ttpd/conf/httpd.conf after the installation completed in the/usr/local/nagios generated five directories, respectively, var log file, bin execution program, etc configuration file, Sbin, share web directory.      The installation was successful. 2: Install Nagios plugin Nagios itself does not monitor the function, all monitoring is done by the plug-in, the plug-in will monitor the results returned to the Nagios,nagios analysis of these results, the web to show us, while providing the corresponding alarm function (this alarm function is also by the plug-in      Completed). #tar –ZXVF nagios-plugins-1.4.tar.gz # CD nagios-plugins-1.4.1 # ./configure–prefix=/usr/local/nagios  compiled to n Agios installation directory # make && made install   after installation, the Libexe plugin directory will be generated under the/usr/local/nagios/directory, and all of Nagios's plugins will be Inside this directory.        3: Install Apache service.      If the installation of the system when the Apache is not installed, the use of the system to install the service.      Install Apache There's no more explaining.      # tar–zxvf   httpd-2.2.2.tar.gz # cd httpd-2.2.2 #/CONFIGURE–PREFIX=/USR/LOCAL/HTTPD # make && make install 4:apache you need to use the command to generate the Nagios user's password to detect the Nagios configuration #/usr/local/httpd/bin/htpasswd&nbsp ;-C/USR/LOCAL/NAGIOS/ETC/HTPAsswd.users Admin #/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg Query Configuration There is no error when the total Wa appears rnings:0 Total errors:   0  is configured successfully and can be logged inhttp://localhost/nagios View. 5: Install configuration Nrpe program #tar-zxvf nrpe-2.12.tar.gz #cd nrpe-2.12 #./configure && make all # make instal L-plugin//install Check_nrpe plugin # make Install-daemon # make Install-daemon-config # make install-xinetd//install Xin      ETD script Configuration Nrpe # Vi/etc/xinetd.d/nrpe//If XINETD is not installed, install using Yum install xinetd. # Only_from = 127.0.0.1 comment out allowshosts =192.168.1.1 add monitoring host # Vi/etc/services Nrpe 56 66/TCP #nrpe//Add #/ETC/INIT.D/XINETD Start Service 6: Configure the Nagios Nagios primary configuration file with Cgi.cfg , Nagios.cfg commands.cfg,service.cfg,windows.cfg,host.cfg,contacts.cfg where service.cfg and host.cfg need to be created themselves. A:Modify Cgi.cfg #vi/usr/local/nagios/etc/cgi.cfg Find these lines, after adding Admin user, can define users themselves, using "," separated Authorized_for_system_informa Tion=nagiosadmin,admin Authorized_for_configuration_information=nagiosadmin Authorized_for_all_services=nagiosad Min authorized_for_all_hosts=nagiosadmin authorized_for_all_service_commands=nagiosadmin authorized_for_all _host_commands=nagiosadmin B:Modify the Nagios.cfg file   #vi/usr/local/nagios/etc/nagios.cfg Find these lines, remove the previous comment Cfg_file=/usr/local/nagios/etc/objects/co mmands.cfg //command configuration path cfg_file=/usr/local/nagios/etc/objects/contacts.cfg   //  Contact configuration cfg _file=/usr/local/nagios/etc/objects/timeperiods.cfg//Template configuration Cfg_file=/usr/local/nagios/etc/objects/templates.cfg/ /  Monitoring window Configuration cfg_dir=/usr/local/nagios/etc/objects/servers//need to add   monitor host configuration file yourself to ask Allison #cfg_file =/usr/local/nag Ios/etc/objects/localhost.cfg command_check_interval=5s    modified here for 5, auto refresh.

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.