The Nagios build record at CentOS 7

Source: Internet
Author: User

Follow the garden article to build http://www.cnblogs.com/mchina/archive/2013/02/20/2883404.html

1. In the case of Nagios plugin address migration error, record resolution.

2, PHP installed to 5.6.26 Version, record

--------------------------------------------------------------------------------------------------------------- -----

Five. Nagios server-side installation

5.1 Basic Support Kit: GCC glibc glibc-common gd gd-devel xinetd openssl-devel

# rpm-q gcc glibc glibc-common gd gd-devel xinetd openssl-devel

If these packages are not available in the system, use Yum to install

# yum install-y gcc glibc glibc-common gd gd-devel xinetd openssl-devel

5.2 Creating Nagios users and user groups

# useradd-s/sbin/nologin nagios# mkdir/usr/local/nagios# chown-r Nagios.nagios/usr/local/nagios

View permissions for the Nagios directory

# ll-d/usr/local/nagios/

5.3 Compiling and installing Nagios

# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.3.tar.gz

# tar ZXVF nagios-3.4.3.tar.gz

# CD Nagios

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

# make All

# make Install

# Make Install-init

# Make Install-commandmode

# Make Install-config

# chkconfig--add Nagios

# chkconfig--level and Nagios on

# chkconfig--list Nagios

5.4 Verify that the program is installed correctly

Switch directories to the installation path (here is/usr/local/nagios) to see if there are five directories such as etc, bin, sbin, share, Var, if present, it can indicate that the program is properly installed to the system. Nagios Various directory uses are described below:

/tr>
bin nagios executable directory
etc
sbin nagios in the directory where the "540" configuration file is located The directory where the CGI file is located, that is, the directory where the files required to execute the external command are located
nagio s external plug-in directory
nagios log file, lock, etc. The directory where the file is located
nagios log Auto-return File directory
directory for external command files

5.5 Installing the Nagios plugin

# wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz

# tar ZXVF nagios-plugins-2.1.2.tar.gz

# CD nagios-plugins-2.1.2

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

# Make && make install

----------------------------------------------------------------------------------------

5.6 Installing and configuring Apache and PHP

Apache and PHP are not required to install Nagios, but Nagios provides a web monitoring interface that clearly sees the running state of monitored hosts and resources through the Web monitoring interface, so it is necessary to install a Web service.
It is important to note that Nagios requires PHP support when configuring the Web monitoring interface after the nagios3.1.x version. Here we download the Nagios version of nagios-3.4.3, so after the completion of the installation of Apache, we also need to compile the PHP module, the PHP version selected here is php5.4.10.

A. Installing Apache

# wget http://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz

# tar ZXVF httpd-2.2.23.tar.gz

# CD httpd-2.2.23

#./configure--prefix=/usr/local/apache2

# Make && make install

If an error occurs:

It can be solved by adding--with-included-apr at compile time.

B. Installing PHP

# wget http://cn2.php.net/distributions/php-5.6.26.tar.gz

# tar ZXVF php-5.6.26.tar.gz

# CD php-5.6.26

"Installation of LIBXM12 is required here"
Yum Install LIBXML2
Yum Install Libxml2-devel

#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs

# Make && make install

Nagios Build records under CentOS 7

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.