Nagios&cacti Article eight: Build Nagios server

Source: Internet
Author: User

Test environment: CentOS 6.4 x86_64

"The first section prepares the installation package"

Nagios can be downloaded to the official website of Www.nagios.org/download. The installation packages used in the testing process in this article are as follows:

Nagios-4.0.8.tar.gz

Nagios-plugins-2.0.3.tar.gz

"The second part quickly builds the environment that Nagios needs"

If you have no special requirements for Nagios, it is recommended to use Yum to quickly build this environment.

Execute yum Install httpd

Execute yum Install PHP (Note that PHP must be installed, otherwise the login web will prompt for errors after Nagios starts)

"Third part installs Nagios software"

Execute Useradd Nagios

Executive Mkdir/usr/local/nagios

Execute Chown nagios.nagios/usr/local/nagios/

Execute TAR-ZXVF nagios-4.0.8.tar.gz

Execute CD nagios-4.0.8

Execution./configure--prefix=/usr/local/nagios

650) this.width=650; "title=" 1.png "alt=" wkiol1rbof-g1tcgaakewfb05i4967.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 4d/dd/wkiol1rbof-g1tcgaakewfb05i4967.jpg "/>

Execute make all

Execute make Install

Execute Make Install-init

Execute Make Install-commandmode

Execute Make Install-config

Perform cd/usr/local/nagios/to see if the following directories are available

650) this.width=650; "title=" 2.png "alt=" wkiol1rboafgo6w9aabdw04vjk0013.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 4d/dd/wkiol1rboafgo6w9aabdw04vjk0013.jpg "/>

Bin:nagios the directory where the executable program is located, the Nagios file is the main program

Etc:nagios configuration file location, after initial installation, only a few *.cfg-sample files

Sbin:nagios the directory where the CGI files are located, that is, the files required to execute the external command

Share:nagios the directory where the Web page file resides

Var:nagios directory where files such as log files, SPID, etc. are located

Execute TAR-ZXVF nagios-plugins-2.0.3.tar.gz

Execution./configure--prefix=/usr/local/nagios

Execute make

Execute make Install

Executive ls/usr/local/nagios/libexec/

The installed plug-in file is displayed, that is, all plugins are installed in the Libexec directory

650) this.width=650; "style=" width:665px;height:125px; "title=" 2.png "alt=" Wkiol1rbohsjiwwxaakysivjrjs795.jpg "src= "Http://s3.51cto.com/wyfs02/M02/4D/DD/wKioL1RbOhSjIwWxAAKySIVjrJs795.jpg" width= "755" height= "" "/>

"Part IV configuration Apache"

Perform ps-ef|grep httpd confirm that Apache is running and confirm that the user is running

Execute usermod-g nagios Apache to add Apache running users to the Nagios group

Copy the contents of the/root/nagios-4.0.8/sample-config/httpd.conf to the bottom of the/etc/httpd/conf/httpd.conf file, as follows

650) this.width=650; "title=" 3.png "alt=" wkiom1rbomsiuskxaagyf7sveyw848.jpg "src=" http://s3.51cto.com/wyfs02/M00/ 4d/de/wkiom1rbomsiuskxaagyf7sveyw848.jpg "/>

Perform service httpd restart restart Apache.

"Part Five add Nagios users"

User name Zhangduozhu password 123456

Execute htpasswd-c/usr/local/nagios/etc/htpasswd Zhangduozhu

650) this.width=650; "title=" 4.png "alt=" wkiom1rbouawfwhaaacilekvdx4871.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 4d/de/wkiom1rbouawfwhaaacilekvdx4871.jpg "/>

Perform CAT/USR/LOCAL/NAGIOS/ETC/HTPASSWD view

650) this.width=650; "title=" 5.png "alt=" wkiol1rbo3vrpravaabo_odgmvc039.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 4d/dd/wkiol1rbo3vrpravaabo_odgmvc039.jpg "/>

"Part VI Login to Nagios Web"

Enter Http://ip/nagios in the browser

Enter User name password

650) this.width=650; "title=" 5.png "alt=" wkiol1rbo-wyk1y_aaeb3rqfm8k883.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 4d/dd/wkiol1rbo-wyk1y_aaeb3rqfm8k883.jpg "/>

650) this.width=650; "title=" 6.png "alt=" wkiol1rbpaltb55maaedwmvjhz8914.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 4d/dd/wkiol1rbpaltb55maaedwmvjhz8914.jpg "/>

Note that Nagios now displays "not running" because Nagios has not yet started.

The following sections describe how to configure Nagios and how to monitor clients.

This article is from the "Rudder Master" blog, please be sure to keep this source http://zdzhu.blog.51cto.com/6180070/1573786

Nagios&cacti Article eight: Build Nagios server

Related Article

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.