Installing Centreon on Centos 5

From Nagios Wiki

Jump to: navigation, search

Contents

[edit] Intro

Oreon/Centreon, 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.

[edit] 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.

[edit] CentOS Requirements

[edit] Installing Centos 5.x

  • Install CentOS 5
    • 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 (if you leave this on, you will likely experience many problems trying to get Nagios working)
  • Reboot

[edit] Post CentOS Install

  • Update CentOS 5.x
yum update && yum upgrade

[edit] Adding RPMforge Repository

Main RPMForge Page RPMForge for CentOS 5

(optional)

  • install vim-enhanced ("yum install vim-enhanced")
  • 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/RPMS.dag/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

[edit] LAMP Requirements for Centreon

(LAMP = Linux Apache MySQL + PHP or Perl)

[edit] LAMP components needed

(for a full list of Centreon requirements, please see Centreon Prerequisites)

From Centreon website:

[edit] 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

[edit] Library

    • 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
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

[edit] System

    • sudo
    • make
    • gcc
yum -y install sudo make gcc

[edit] 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_advmulti select HTML_Table Auth_SASL HTTP Image_Canvas Image_Color Image_Graph Image_GraphViz Mail Mail_Mime Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate SOAP

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


/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"

[edit] 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.


[edit] Requirements for Centreon/Oreon

(for a full list of Centreon requirements, please see Centreon Prerequisites

[edit] Installing Centreon/Oreon

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

Centreon Doc Page d/l Centreon

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

  • The install URL is
    http://<yourserver>/oreon/
    (trailing forward slash needed)

[edit] 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

answer script questions


###############################################################################
#                    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
  -> check_nt_centreon                                     OK
  -> check_snmp_cpfw.pl                                    OK
  -> check_snmp_load.pl                                    OK
  -> check_snmp_mem.pl                                     OK
  -> check_snmp_process.pl                                 OK
  -> check_snmp_processus_loaded.pl                        OK
  -> check_snmp_script_result.pl                           OK
  -> check_snmp_storage.pl                                 OK
  -> check_snmp_win.pl                                     OK
  -> oreon.conf                                            OK
  -> oreon.pm                                              OK
  -> process-service-perfdata                              OK
  -> submit_host_check_result                              OK
  -> submit_service_check_result                           OK

Do you want to install Oreon Plugins ? 

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

------------------------------------------------------------------------
                     Start Traps Handler Installation
------------------------------------------------------------------------



Preparing Oreon Plugins...
-> fill_trapDB
-> genSnmpttConfFile
-> trapHandler

Do you want to install Oreon Traps Plugins ? 

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

Where is your SNMP configuration file?
default to [/etc/snmp/]:

Moving snmptrapd.conf to /etc/snmp/                        OK
/etc/snmp/centreon_traps created                           OK
Moving snmptt.ini to /etc/snmp/centreon_traps/             OK
Moving snmp.conf to /etc/snmp/                             OK
Moving snmptt to /usr/sbin/                                OK
Moving snmpttconvertmib to /usr/sbin/                      OK
/usr/local/nagios/libexec/traps/'                          OK


Finding Oreon Plugins configuration file 'oreon.conf' :    OK
You already seem to have installed the plugins Oreon.
Do you want overwrite this file ? You must regenerate this one from Oreon interface.
[y/n], default to [n]:y

/etc/nagios already exists                                 PASSED
/usr/local/oreon/filesGeneration/nagiosCFG already exists  PASSED
/usr/local/oreon/filesUpload/nagiosCFG already exists      PASSED

------------------------------------------------------------------------
                       Start ODS Installation
------------------------------------------------------------------------


Checking ODS data folder : 
Creating Oreon Directory '/var/lib/ods'                    OK
Checking ODS database folder : 
Creating Oreon Directory '/var/lib/ods/database/'          OK
Checking ODS log folder : 
Creating Oreon Directory '/var/log/ods/'                   OK
Replace ODS Macro                                          OK
Install ODS Binary                                         OK
Set ODS properties                                         OK

------------------------------------------------------------------------
                    Replace Macro In ODS cron script
------------------------------------------------------------------------


in /usr/local/oreon/cron/inventory_update.php              OK
in /usr/local/oreon/cron/reporting/ArchiveLogInDB.php      OK
in /usr/local/oreon/cron/parsing_status.pl                 OK
in /usr/local/oreon/cron/parsing_log.pl                    OK

------------------------------------------------------------------------
------------------------------------------------------------------------
                    Replace Macro In ODS cron script
------------------------------------------------------------------------


in /usr/local/oreon/cron/inventory_update.php              OK
in /usr/local/oreon/cron/reporting/ArchiveLogInDB.php      OK
in /usr/local/oreon/cron/parsing_status.pl                 OK
in /usr/local/oreon/cron/parsing_log.pl                    OK

------------------------------------------------------------------------
                         Start Oreon Cron Configuration
------------------------------------------------------------------------


PHP not found. Oreon take php by default
Please specify user do you use for oreon cron
By default, oreon use nagios user, it's correct ?
[y] or specifie user, default to [nagios] 
functions: line 681: crontab: command not found
You old crontab is backup on /tmp/crontab_nagios.3664 file
functions: line 693: crontab: command not found

------------------------------------------------------------------------
                            Configure Sudo
------------------------------------------------------------------------


Finding nagios init script :                               /etc/init.d/nagios
Configuring Sudo                                           OK

------------------------------------------------------------------------
                          Oreon Post Install
------------------------------------------------------------------------


Finding mail binary : /usr/bin/mail                        OK
Finding rrdtool binary : /usr/bin/rrdtool                  OK
Create /usr/local/oreon/www/install/installoreon.conf.php  OK
Create /etc/oreon.conf                                     OK
Configuring Oreon post-install                             OK

###############################################################################
#      Go to the URL : http://your-server/oreon/  to finish the setup         #
#                                                                             #
#                    Report bugs at bugs@oreon-project.org                    #
#                                                                             #
#                             Thanks for using OREON.                         #
#                             -----------------------                         #
#                        Contact : infos@oreon-project.org                    #
#                           http://www.oreon-project.org                      #
###############################################################################



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

[edit] All you need for the web install is to actually provide the MySQL root password

[edit] Apache

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


[edit] PHP

  • vim /etc/php.ini
; - magic_quotes_gpc = Off         [Performance]
;change to following

magic_quotes_gpc = On
  • configuring permissions

[edit] All you need for the web install is to actually provide the MySQL root password

[edit] Apache

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


[edit] PHP

  • vim php.ini
put 'magic_quotes_gpc = On'
  • configuring permissions

[edit] 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

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

[edit] 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

[edit] 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.

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/

[edit] 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.


border

[edit] 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:

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.

border

[edit] 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)

[edit] Troubleshooting

tail /var/log/httpd/error_log

nagios command file

Personal tools
Advertisement