Install Nagios 4.1.1 on CentOS 6.6

Source: Internet
Author: User
Tags mrtg

Install Nagios 4.1.1 on CentOS 6.6

Environment: VMware Workstation Virtual Machine, Server: 192.168.118.128

Server Environment: CentOS-6.6 nagios-4.1.1 httpd-2.4.20 php-5.6.22

Server installation:

Useradd nagios User Creation

Mkdir/usr/local/nagios
Chown-R nagios: nagios/usr/local/nagios?

Tar-xzvf nagios-4.1.1.tar.gz.gz
Cd nagios-4.1.1
Ll
./Configure -- prefix =/usr/local/nagios
Make all
Yum install unzip
Make all
Make install
Make install-init
Make install-commandmode
Make install-config
Chkconfig -- add nagios
Chkconfig -- level 35 nagios on
Chkconfig -- list nagios
Cd ..
Rz
Ll
Tar-xzvf nagios-plugins-2.1.1.tar.gz # plugin installation package
Tar-xzvf nagios-cn-3.2.3.tar.bz2
Ll
Rm nagios-cn-3.2.3.tar.bz2
Ll
Rz
Ll
Tar-jxvf nagios-cn-3.2.3.tar.bz2 # Chinese installation package
Cd nagios-cn-3.2.3
Ll
./Configure
Make all
Make install
Cd ..
Ll
Mkdir/usr/local/apache2
Tar-zxvf httpd-2.4.20.tar.gz
Cd httpd-2.4.20
./Configure -- prefix =/usr/local/apache2
Ll
Vi README
More INSTALL
./Configure -- prefix =/usr/local/apache2
Find/-name apr
Find/-name APR
Find/-name apr * # Apr library support
Yum search apr
Yum install apr. x86_64 apr-util.x86_64
Yum remove httpd
./Configure -- prefix =/usr/local/apache2
Cd ..
Ll
Wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
Ll
Rm apr-1.4.5.tar.gz
Rz
Ll
Tar-zxvf apr-1.5.2.tar.gz
Tar-zxvf apr-util-1.5.4.tar.gz
Tar-zxvf pcre-8.38.tar.gz
Cd apr-1.5.2
./Configure -- prefix =/usr/local/apr
Make & make install
Cd ..
Cd apr-util-1.5.4
./Configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr/bin/apr-1-config
Make & make install
Cd ..
Cd pcre-8.38
./Configure -- prefix =/usr/local/pcre
Make & make install
Cd ..
Cd httpd-2.4.20
. /Configure -- prefix =/usr/local/apache2 -- enable-so -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr- util/-- with-pcre =/usr/local/pcre
Make
Make install
Cd ..
Ll
Tar-zxvf php-5.6.22.tar.gz
Mkdir/usr/local/php
Cd php-5.6.22
./Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs
Yum install libxml2
Find/-name libxml2
Find/-name libxml2 *
Find/-name xml2-config
Yum install libxml2-devel
Find/-name xml2-config
./Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs
Make
Make test
Make install <br> cp php. ini-development/usr/local/lib/php. ini # php configuration

Configure apache. File Location: usr/local/apache2/conf/http. conf

Change the process startup user to nagios, namely:

User nagios

Group nagios

LoadModule php5_module modules/libphp5.so # Remove the comment before this line

Find DirectoryIndex and add index. php

Added SetHandler application/x-httpd-php to support parsing php.

Add nagios configuration at the end:

ScriptAlias/nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow, deny
Allow from all
AuthName "Nagios Access"
AuthUserFile/usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
Alias/nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
AuthType Basic
Options None
AllowOverride None
Order allow, deny
Allow from all
AuthName "nagios Access"
AuthUserFile/usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>

Because the access authentication file is specified, you need to create one:

/Usr/local/apache2/bin/htpasswd-c/usr/local/nagios/etc/htpasswd [set your logon username] Press enter and enter the set password.

After the configuration is complete, you can start nagios and apache.

Problems:

Local access is allowed, and other hosts in the LAN are not accessible. If no router is reported, the firewall is blocked. You can turn off the server firewall: service iptables stop or add a new listener port 80 (http. conf) Rules: iptables-I INPUT-p tcp -- dport 80-j ACCEPT

After installing the server, you must configure the corresponding nagios file to monitor other hosts.

-------------------------------------- Split line --------------------------------------

Configure Mrtg in Ubuntu to monitor Nginx and server system resources

Use snmp + Mrtg to monitor Linux systems

Mrtg server construction (Network Traffic Monitoring)

Network Monitor Nagios Overview

Nagios construction and Configuration

Build a Nagios monitoring platform in the Nginx Environment

Configure the basic Nagios System on RHEL5.3 (using Nagios-3.1.2)

CentOS 5.5 + Nginx + Nagios monitoring and control terminal installation and Configuration Guide

Install Nagios Core for Ubuntu 13.10 Server

-------------------------------------- Split line --------------------------------------

Nagios details: click here
Nagios: click here

This article permanently updates the link address:

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.