Você está na página 1de 8

Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

Installing Centreon on Centos 5


From Nagios Wiki

Contents
1 Intro
1.1 Features
2 CentOS Requirements
2.1 Installing Centos 5.x
2.2 Post CentOS Install
2.3 Adding RPMforge Repository
3 LAMP Requirements for Centreon
3.1 LAMP components needed
3.1.1 Standard
3.1.2 Library
3.1.3 System
3.1.4 Pear Packages
4 Centreon/Oreon
4.1 Requirements for Centreon/Oreon
4.1.1 Installing Centreon/Oreon
4.1.2 install.sh
4.2 All you need for the web install is to actually provide the MySQL root password
4.2.1 Apache
4.3 PHP
4.4 All you need for the web install is to actually provide the MySQL root password
4.4.1 Apache
4.5 PHP
4.6 Directory Structure in /etc/nagios
4.7 Permissions
4.8 Centreon/Oreon Graphing and ODS (Oreon Data Storage)
4.8.1 How to actually make the graphs
4.8.1.1 Checking Data For Graph Generation (ODS)
4.8.1.2 What to check if you don't have any graphs
4.9 Troubleshooting

Intro
Oreon/Centreon (http://www.oreon-project.org) , frontend GUI applications that manages Nagios (similar to Groundwork's Fruity), uses MySQL database
to create the /etc/nagios/*.cfg files necessary for the Nagios daemon.

Features
"At a Glance" type console for the Directors and Execs
RRD Graphing of perfdata
Unified configuration from web control panel

Centreon obviously cannot be yum'd or apt-get'd, you'll have to download, install, and configure.

CentOS Requirements
Installing Centos 5.x
Install CentOS 5 (http://isoredirect.centos.org/centos/5/isos/i386/)
No "single server cd" available, like in 4.x
You only need CD1 if you deselect all the packages, if you select packages, then you will need the other CDs (n/a if you use the DVD, of
course)
Do a minimal install (with as few packages as possible)
unselect all the packages, then click "customize now" and deselect the rest of them
Turn off SELinux (http://www.nsa.gov/selinux/) (if you leave this on, you will likely experience many problems trying to get Nagios working)
Reboot

Post CentOS Install


Update CentOS 5.x

yum update && yum upgrade

Adding RPMforge Repository


Main RPMForge Page (http://wiki.centos.org/Repositories/RPMForge) RPMForge for CentOS 5 (http://wiki.centos.org/Repositories/RPMForge#head-
d766e7aacdee6150c6705d9369aa36c9bcabc139)

1 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

(optional)

install vim-enhanced ("yum install vim-enhanced")

RPMforge (http://rpmforge.net/user/faq/RPMforge) required to "yum install" Nagios stuff]


install protectbase for CentOS (yum-priorities.noarch 0:1.0.4-2.el5.centos) by typing "yum -y install yum-priorities"
edit following files according to RPMforge info
/etc/yum/pluginconf.d/priorities.conf

[main]
enabled=1

.repo files in /etc/yum.repos.d/

priority=N

and

[base], [addons], [update], [extras] ... priority=1


[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N (where N is > 10 and based on your preference)

d/l and add rpmforge repository (this is experimental in CentOS 5)

wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

make sure it all works ok (i.e. show which packages were held back)

yum check-update
.
.
.
yum check-update --> 176 packages excluded due to repository priority protections

Then you can run

yum update

LAMP Requirements for Centreon


(LAMP = Linux Apache MySQL + PHP or Perl)

General instructions
http://www.flmnh.ufl.edu/linux/install_apache.htm

LAMP components needed


(for a full list of Centreon requirements, please see Centreon Prerequisites (http://www.oreon-project.org/Product/Pre-requisits-Oreon-1.3.x-/-1.4.x.html) )

From Centreon website:

Standard

Nagios 1.x / 2.x


Nagios-plugins 1.3.x / 1.4.x
Apache 2.x
MySQL 3.x / 4.x / 5.x
PHP 4.x / 5.x
GD
GD-devel
RRDTool 1.2
Net-SNMP

On CentOS 5 (with RPMForge), type:

yum -y install nagios nagios-devel nagios-plugins nagios-plugins-setuid httpd httpd-manual mysql mysql-server mysql-devel php gd gd-devel rrdtool net-snmp

Library

php-mysql
php-pear
php-snmp
php-posix
libgd2
gd-devel
libpng
libpng-devel
perl-config-IniFiles
perl-Crypt-DES
perl-Digest-HMAC

2 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

perl-Digest-SHA1
perl-GD
perl-IO-Socket-INET6
perl-Net-SNMP
perl-rrdtool
perl-Socket6

yum -y install php-mysql php-pear php-snmp (php-posix) (libgd2) gd-devel (libpng libpng-devel) perl-Config-IniFiles perl-crypt-des perl-digest-hmac
perl-digest-sha1 perl-gd perl-IO-Socket-INET6 perl-net-snmp perl-rrdtool perl-socket6

System

sudo
make
gcc

yum -y install sudo make gcc

Pear Packages

Auth_SASL
Date
DB
DB_DataObject
DB_DataObject_FormBuilder
HTML_Common
HTML_QuickForm
HTML_QuickForm_advmultiselect
HTML_Table
Image_Canvas
Image_Color
Image_Graph
Image_GraphViz
Mail_Mime
MDB2
Net_Ping
Net_Traceroute
Numbers_Roman
Numbers_Words
PEAR
Validate
XML_RPC

pear channel-update pear.php.net

pear install -o -f --alldeps DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date Numbers_Roman Numbers_Words HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect H

/etc/init.d/nagios start
chkconfig nagios on
/etc/init.d/mysqld start
chkconfig mysqld on
/etc/init.d/httpd start
chkconfig httpd on

You will need all the latest PEAR modules + GD so it can do RRD-related things.

type in IP address in browser, make sure page is served and that you can see host checks (otherwise permissions probably aren't set right)
to troubleshoot what might be wrong with Apache, type in "tail /etc/httpd/logs/error_log"

Centreon/Oreon
Centreon is a French development so most documentation and most of the forums are in French, there is adequate documentation in English but I made
this so we can skip by most of that.

Requirements for Centreon/Oreon


(for a full list of Centreon requirements, please see Centreon Prerequisites (http://www.oreon-project.org/Product/Pre-requisits-Oreon-1.3.x-/-1.4.x.html)

Installing Centreon/Oreon

The Oreon project actually has neat videos in Flash for installation: (the other install docs are in French)

Centreon Doc Page (http://www.oreon-project.org/Documentation/Documentation.html) d/l Centreon (http://www.oreon-project.org/Download


/Download.html)

Make sure you go to this AFTER you run install.sh

3 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

The install URL is

http://<yourserver>/oreon/

(trailing forward slash needed)

install.sh

cd /tmp
wget http://download.oreon-project.org/index.php?id=65
tar zxfv centreon-1.4.1.tar.gz
cd centreon-1.4.1
./install.sh

how Nagios installs on CentOS (http://wiki.centos.org/HowTos/Nagios)

answer script questions

4 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

###############################################################################
# OREON Project (www.oreon-project.org) #
# Thanks for using OREON #
# #
# v 1.4.1 #
# #
# infos@oreon-project.org #
# #
# Make sure you have installed and configured #
# sudo - sed #
# php - apache - rrdtool - mysql #
# #
# #
###############################################################################
# The Team OREON #
###############################################################################

Make sure you have root permissions !

WARNING : Setup will delete all previous informations in your OREON DATABASE.

Are you sure to continue ?


[y/n], default to [n]:

Where is installed Nagios ?


default to [/usr/local/nagios]:

Where are your nagios etc directory ?


default to [/usr/local/nagios/etc]:

Where are your nagios plugins / libexec directory ?


default to [/usr/local/nagios/libexec]:

Where are your nagios bin directory ?


default to [/usr/local/nagios/bin]:

Where do I install Oreon ?


default to [/usr/local/oreon]:

Where is sudo ?
default to [/etc/sudoers]:

Where is installed RRD perl modules (RRDs.pm) ?


Just put directory, not full path.
default to [/usr/local/rrdtool/lib/perl]:

Where is rrdtool binary ?


default to [/usr/bin/rrdtool]:

Where is mail binary ?


default to [/usr/bin/mail]:

Where is PEAR Path ?


default to [/usr/share/pear]:

------------------------------------------------------------------------
User Management
------------------------------------------------------------------------

Finding Apache group : apache


Finding Apache user : apache
Finding Nagios group : nagios
Finding nagios group 'nagios' in /etc/group YES
Finding Nagios user : nagios
Finding nagios user 'nagios' in /etc/passwd YES

------------------------------------------------------------------------
Other Stuff
------------------------------------------------------------------------

Nagios libexec directory OK


TrueType verdana installed OK
Finding PEAR Path : /usr/share/pear OK
PEAR Font installed OK

------------------------------------------------------------------------
Configure Apache server
------------------------------------------------------------------------

/usr/local/oreon already exists PASSED


Finding Apache Oreon configuration file
'/etc/httpd/conf.d/oreon.conf' : OK
Do you want rewrite Apache configuration file ?
[y/n], default to [y]:y
Create '/etc/httpd/conf.d/oreon.conf' OK
Configuring Apache OK
User apache added to nagios group OK

Stopping httpd: [ OK ]
Starting httpd: [ OK ]

------------------------------------------------------------------------
Start Oreon Installation
------------------------------------------------------------------------

Oreon Directory already exists PASSED


Copy 'filesGeneration' OK
Copy 'filesUpload' OK
Copy 'GPL_LIB' OK
Copy 'log' OK
Copy 'www' OK
Copy 'cron' OK
Copy 'ODS' OK
Copy 'ODS_SRC_ETC' OK

------------------------------------------------------------------------
Start Plugins Oreon Installation
------------------------------------------------------------------------

/usr/local/nagios/libexec already exists PASSED

Preparing Oreon Plugins...


-> check_centreon_dummy OK
-> check_centreon_nt OK
-> check_centreon_packetErrors OK
-> check_centreon_ping OK
-> check_centreon_snmp_loadaverage OK
-> check_centreon_snmp_process OK
-> check_centreon_snmp_process_detailed OK
-> check_centreon_snmp_remote_storage OK
-> check_centreon_snmp_traffic OK
-> check_centreon_snmp_uptime OK
-> check_centreon_snmp_value OK
-> check_centreon_TcpConn OK
-> check_meta_service OK

5 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

Y (to continue) Where is Nagios installed? /usr/share/nagios Where is your Nagios etc directory? /etc/nagios

All you need for the web install is to actually provide the MySQL root password
Apache

The installation script will actually modify your default httpd.conf.

PHP
vim /etc/php.ini

; - magic_quotes_gpc = Off [Performance]


;change to following

magic_quotes_gpc = On

configuring permissions

All you need for the web install is to actually provide the MySQL root password
Apache

The installation script will actually modify your default httpd.conf.

PHP
vim php.ini

put 'magic_quotes_gpc = On'

configuring permissions

Directory Structure in /etc/nagios


Centreon actually GENERATES the entire config for you so make sure to start with a fresh Nagios install, you can import existing configurations but your
mileage may vary.

If you wish to import your existing config, please see this: Centreon Wiki page for importing existing config (http://wiki.oreon-project.org/index.php
/Load_your_previous_nagios_cfg)

Centreon uses a FLAT config directory unlike other Nagios frontends which may use a tree'd (NagiosQL for instance)

Permissions
Give Apache appropriate permissions.

chmod 6755 /etc/nagios


chown apache:apache /etc/nagios

chmod 644 /etc/nagios/*.cfg


chown apache:apache /etc/nagios/*.cfg

optional (not applicable on new box)

chmod 644 /etc/nagios/hosts/*.cfg


chown apache:apache /etc/nagios/hosts/*.cfg
chmod 644 /etc/nagios/services/*.cfg
chown apache:apache /etc/nagios/services/*.cfg

Making Nagios binary executable by Apache user

chown nagios:apache /usr/bin/nagios


chmod 750 /usr/bin/nagios
chmod +x /usr/bin/nagios

Making sure Nagios can write to command file. If it is not there, then you will need to enable the check_external_commands option to 1 in nagios.cfg.

chown nagios:apache /var/log/nagios/rw


chmod 660 /var/log/nagios/rw

Centreon/Oreon Graphing and ODS (Oreon Data Storage)


This section will discuss the finer points of graphing in Centreon using the RRD's and perfdata.

6 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

The primary thing is to make sure that Nagios has perfdata collection on.

Most of the information here can be gleaned from this half French/English thread in their forums, but I'll summarize them here for easier edification.

http://forum.oreon-project.org/showthread.php?t=4747

The next link is where their actual Wiki article is:

http://wiki.oreon-project.org/index.php/Graphs

For some reason if you do not have a process-service-perfdata script they tell you how to create one, but you should have one already.
The wiki article then goes through to tell you what to do from the web interface to modify the nagios.cfg to enable perfdata collection and default
RRD settings page
One of the main reasons that ODS doesn't work is usually because you don't have the ODS service actually running.

$> /etc/init.d/ods start

$> /etc/init.d/ods status

$> ls /usr/local/oreon/OreonDataStorage/

How to actually make the graphs

This portion is what is really skipped in their documentation.

Go into the Configuration screen on Centreon and ADD a service


In the service configuration screen, go into Service Extended Infos and select a Graph Template that actually matches the perfdata that you are
gathering, for example, Latency would apply to performance figures such as PING or response time.

Checking Data For Graph Generation (ODS)

At this point the graph setup should be complete as long as your service has perfdata turned ON.

Now you go in and check the ODS directory to make sure RRD's are being generated:

ls -l /usr/local/oreon/ODS

You should see some RRD's

-rw-r--r-- 1 root root 2442424 Nov 1 10:41 1.rrd


drwxr-xr-x 2 root root 4096 Oct 31 16:45 backup
drwxrwxr-x 2 apache nagios 4096 Oct 31 15:54 etc
drwxrwxr-x 2 apache nagios 4096 Oct 31 11:19 lib
-rwxrwxr-t 1 apache nagios 17914 Oct 31 11:19 ods
drwxrwxr-x 2 apache nagios 4096 Oct 31 16:45 var

If you do not see any RRD's, check your Nagios directory to make sure perfdata is being collected:

7 of 8 7/2/2011 11:53 AM
Installing Centreon on Centos 5 - Nagios Wiki http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_o...

drwxrwxrwx 2 apache 4096 Nov 1 00:00 archives


-rw-rw-r-- 1 apache 238 Oct 31 13:50 comment.log
-rw-rw-rw- 1 apache 238 Jun 22 17:16 comments.dat
-rw-rw-rw- 1 apache 239 Jun 22 17:16 downtime.dat
-rw-rw-r-- 1 apache 239 Oct 31 13:50 downtime.log
-rw-r--r-- 1 apache 6 Oct 31 16:44 nagios.lock
-rw-rw-r-- 1 apache 2005 Nov 1 09:44 nagios.log
-rw-rw-rw- 1 apache 10904 Oct 31 16:44 objects.cache
-rwxrwxrwx 1 apache 7604 Oct 31 16:44 retention.dat
drwxrwsrwx 2 apache 4096 Oct 31 16:44 rw
-rw-r--r-- 1 apache 24153 Nov 1 10:41 service-perfdata.tmp
-rw-rw-r-- 1 apache 3175 Nov 1 10:44 status.log
-rw------- 1 apache 2926 Nov 1 09:44 status.sav

Make sure that service-perfdata.tmp is in there and has a size greater than 0.

Then you should start seeing graphs when you go to the Centreon View page.

What to check if you don't have any graphs

Check the above files mentioned, see if they exist and if they have sizes
Make sure ODS is running if they aren't being generated
Look inside /usr/local/oreon/ODS/var there are some logs in there also
Check /var/log/messages
Check /etc/httpd/logs
Make sure you selected the right graph template to match your service collection type (parsing problem)

Troubleshooting
tail /var/log/httpd/error_log

nagios command file (http://nagios.sourceforge.net/docs/2_0/commandfile.html)

Retrieved from "http://www.nagioswiki.com/wiki/index.php/Installing_Centreon_on_Centos_5"

This page was last modified 12:46, 1 December 2010.


Content is available under Creative Commons.

8 of 8 7/2/2011 11:53 AM

Você também pode gostar