Install nagios and centreon in CentOS

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


 


# In Snapshot

# 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-common gd-devel make net-snmp 2. start installing nagios
# Creating users and groups

Chattr-I/etc/passwd/etc/shadow/etc/group/etc/gshadowuseradd nagiosgroupadd nag1_usermod-a-G nagcmd nagiosusermod-a-G nagcmd apache# Installing nagios-core

Tar-zxvf nagios-3.5.1.tar.gzcdnagios. /configure -- prefix =/usr/local/nagios -- with-command-group = nagcmd \ -- enable-event-broker -- enable-embedded-perl -- with-perlcachemakeallmakeinstallmakeinstall-initmakeinstall-configmakeinstall -commandmodemakeinstall-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/nagiosstart/etc/init. d/httpdstart# 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/nagiosmakeallmakeinstall-pluginmakeinstall-daemonmakeinstall-daemon-configmakeinstall-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 '2017 I \ nrpe 578/tcp # nrpes '/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.gzcdndoutils-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 = nagiosThe 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. hmakemakeinstall
Cp. /config/ndo2db. cfg-sample/usr/local/nagios/etc/ndo2db. commit CP. /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-initcpdaemon-init/etc/init. d/ndo2db

# Creating database users


Mysql-p> createdatabasenagios; GRANTALLPRIVILEGESONnagios. * TO 'nagios '@ 'localhost' identified by 'nagios';> flush privileges;

# Install a database


Cddb // 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 --importRPM-GPG-KEY.dag.txt rpm-ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpmyum clean allyum updateyum upgradeyum installhttpd gd fontconfig-devel libjpeg-devel libpng-devel gd-devel-perl- GD \ openssl-devel perl-DBD-MySQL mysql-server mysql-devel php-mysql php-gd php-ldap php-xml php-mbstring \ perl-Config-IniFiles perl- DBI perl-DBD-MySQL rrdtool perl-Crypt-DES perl-Digest-SHA1 \ perl-Digest-HMAC net-snmp-utils perl-Socket6 net-snmp-libs php-snmp \ dmidecode lm_sensors perl-Net-SNMP net-snmp-perl fping cpp 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

# Install centreon on the command line through a series of carriage return (retain default configuration) and the path to be filled in.

# 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


GRANTALLPRIVILEGESON 'centreon '. * TO 'centreon' @ 'localhost' identified by 'centreon'; GRANTALLPRIVILEGESON 'centreon _ Store '. * TO 'centreon' @ 'localhost' identified by 'centreon'; GRANTALLPRIVILEGESON '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

# Configure the Nagios path

# Configure the NDoutils path

# Administrator Account Password

# Database connection information

# Start Database Installation

# Logon after installation is complete


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.


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.