Installing Nagios and Centreon using Centreon to manage Nagios

Source: Internet
Author: User

This article describes the complete nagios and centreon installation processes.

Installation environment:

CentOS5.6, X64 updated.

Monitor Engine: Nagios

Broker module: NDoutils

Hypothesis:

Mysql has been installed and started

Path:/usr/local/mysql/

Sock path:/var/lib/mysql. sock

Procedure reference: http://documentation.centreon.com/docs/centreon/en/latest/installation/from_sources.html

1. Download the installation package

# Download a patch for nagios, nagios-plugin, nrpe, ndoutils, and ndoutils

cd /data/tool
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.1.tar.gzwget --no-check-certificate https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gzwget http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gzwget http://nchc.dl.sourceforge.net/project/nagios/ndoutils-1.x/ndoutils-1.5.2/ndoutils-1.5.2.tar.gzwget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.5.2_light.patch
# Software packages required for centreon installation in http://www.centreon.com/Content-Products-IT-network-monitoring/supported-software-and-requirements check
# Download centreon 2.4.0
wget http://download.centreon.com/index.php?id=4264
# Install necessary packages
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
2. start installing nagios
# Creating users and groups
chattr -i /etc/passwd /etc/shadow /etc/group /etc/gshadowuseradd nagiosgroupadd nagcmdusermod -a -G nagcmd nagiosusermod -a -G nagcmd apache
# Installing nagios-core
tar -zxvf nagios-3.5.1.tar.gzcd nagios./configure --prefix=/usr/local/nagios --with-command-group=nagcmd \--enable-event-broker --enable-embedded-perl --with-perlcachemake allmake installmake install-initmake install-configmake install-commandmodemake install-webconfcp -R contrib/eventhandlers/ /usr/local/nagios/libexec/chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers

# Start nagios apache

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg/etc/init.d/nagios start/etc/init.d/httpd start
# Create a nagios user for Logon
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
# Install nagios-plugins
tar -zxvf nagios-plugins-1.5.tar.gzcd ../nagios-plugins-1.5./configure --with-nagios-user=nagios \--with-nagios-group=nagios \--prefix=/usr/local/nagios \--enable-redhat-pthread-workaround --with-ipv6=no \--enable-perl-modules \--with-mysql=/usr/local/mysqlmake && make install
# Install nrpe
tar -zxvf nrpe-2.15.tar.gz./configure --prefix=/usr/local/nagiosmake allmake install-pluginmake install-daemonmake install-daemon-configmake install-xinetd

Install xinetd for management

yum install xinetd -ysed -i 's/127.0.0.1/127.0.0.1 183.61.70.34/' /etc/xinetd.d/nrpesed -i '578 i\nrpe            5666/tcp                        # NRPE' /etc/servicesservice xinetd restart
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_userssed -i 's/allowed_hosts=127.0.0.1/allowed_hosts=127.0.0.1,<your ip addr>/' /usr/local/nagios/etc/nrpe.cfg
3. Install ndoutils
tar -zxvf ndoutils-1.5.2.tar.gzcd ndoutils-1.5.2patch -p1 -N < ../ndoutils1.5.2_light.patch./configure --prefix=/usr/local/nagios/ --enable-mysql --with-mysql=/usr/local/mysql --with-ndo2db-user=nagios --with-ndo2db-group=nagios
The default source file make will report the following error changes:
sed -i -e 's/#include <mysql\/mysql.h>/#include <\/usr\/local\/mysql\/include\/mysql.h>/' include/config.hsed -i -e 's/#include <mysql\/errmsg.h>/#include <\/usr\/local\/mysql\/include\/errmsg.h>/' include/config.hmakemake install
cp ./config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfgcp ./config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
# Edit/usr/local/nagios/etc/nagios. cfg and add it to the broker_module
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg

# Install the Startup File

chmod +x daemon-initcp daemon-init /etc/init.d/ndo2db

# Creating database users

mysql -p>>create database nagios;GRANT ALL PRIVILEGES ON nagios.* TO 'nagios'@'localhost' IDENTIFIED BY 'nagios';>>FLUSH PRIVILEGES;

# Install a database

cd db/./installdb -u nagios -p nagios -h localhost -d nagios
4. Install centreon
usermod -a -G apache centreonusermod -a -G nagios centreonwget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpmwget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txtrpm --import RPM-GPG-KEY.dag.txtrpm -ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpmyum clean allyum updateyum upgradeyum install httpd gd fontconfig-devel libjpeg-devel libpng-devel gd-devel perl-GD \    openssl-devel perl-DBD-MySQL mysql-server mysql-devel php php-mysql php-gd php-ldap php-xml php-mbstring \    perl-Config-IniFiles perl-DBI perl-DBD-MySQL rrdtool perl-rrdtool perl-Crypt-DES perl-Digest-SHA1 \    perl-Digest-HMAC net-snmp-utils perl-Socket6 perl-IO-Socket-INET6 net-snmp net-snmp-libs php-snmp \    dmidecode lm_sensors perl-Net-SNMP net-snmp-perl fping cpp gcc gcc-c++ libstdc++ glib2-devel \    php-pear
usermod -U apachepear channel-update pear.php.netpeardev upgrade-allpear upgrade-all

Error Handling: [PHP Fatal error: Allowed memory size of 8388608 bytes exhausted]

echo 'memory_limit = 256M' >>/etc/php.ini

# Start centreon Installation

./install.sh -i

# Retain the default configuration after a series of carriage returns) and the path to be filled in to complete centreon installation under the command line.

# Do not post them here

# The two paths RRDs. pm and PEAR. php must be noted. You can use find to find the exact path.

/usr/local/rrdtool/lib/perl/5.8.8/x86_64-linux-thread-multi/RRDs.pm/usr/share/pear/PEAR.php

# Configuring centreon database users

GRANT ALL PRIVILEGES ON `centreon`.* TO 'centreon'@'localhost' identified by 'centreon';GRANT ALL PRIVILEGES ON `centreon_storage`.* TO 'centreon'@'localhost' identified by 'centreon';GRANT ALL PRIVILEGES ON `centreon_status`.* TO 'centreon'@'localhost' identified by 'centreon';FLUSH PRIVILEGES;

# Log on to the web page to perform the next installation:

Http: // SERVER_ADDRESS/centreon

# Check php Expansion

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150313P9-0.png "style =" float: none; "title =" Image.png "alt =" 161914280.png"/>

# Configure the Nagios path

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150315644-1.png "style =" float: none; "title =" Image1.png "alt =" 161914671.png"/>

# Configure the NDoutils path

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150315557-2.png "style =" float: none; "title =" Image2.png "alt =" 161914235.png"/>

# Administrator Account Password

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/115031M47-3.png "style =" float: none; "title =" Image3.png "alt =" 161914488.png"/>

# Database connection information

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150314E3-4.png "style =" float: none; "title =" Image4.png "alt =" 161915138.png"/>

# Start Database Installation

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150315M2-5.png "style =" float: none; "title =" Image5.png "alt =" 161915392.png"/>

# Logon after installation is complete

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1150315X8-6.png "style =" float: none; "title =" Image6.png "alt =" 161915414.png"/>


The preceding steps are complete for centreon installation.

In particular, do not write an error in each path or file name during centreon command line mode installation.




This article is from the "Linux Fantasy" blog, please be sure to keep this source http://mrcto.blog.51cto.com/1923168/1344091

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.