This tutorial will guide the user to complete the installation of Centreon on FreeBSD. We will be using an installation on a FreeBSD 9.0-PRERELEASE kernel version, kernel version does not influence the tutorial. It may be FreeBSD 8.x or 9.x
What is the Centreon?
Centreon is a powerful tool for monitoring hosts and services, it is a frontend that works on top of Nagios, adding many features for viewing and alert history, status, etc. ..
Need Support ? Click Here !

To learn more about the tool, I invite you to visit the official site at http://www.centreon.com
What we need? ?
- Apache
- PHP 5.3.x + a lot of dependencies
- Mysql
- Nagios
- Pear + a lot of dependencies
- Perl + a lot of dependencies
- rrdtool
- snmp
- sudo
- Centreon (obvious :-p)
Starting installation of packages
For this tutorial, we will use the tool portmaster, you can even do all the installation manually, but I advise u to use the tool in order to facilitate the installation of the dependencies and the amount of packages that we need.
|
1 2 |
/usr/ports/ports-mgmt/portmaster make install clean |
if you are using csh shell
|
1 |
rehash |
We start by some common packages to provide the Centreon:
|
1 2 |
# In the package configurations, keep the default settings or to your liking. portmaster -d lang/perl5.12 www/apache22 shells/bash security/sudo net-mgmt/net-snmp net-mgmt/snmptt |
Installing our database (if using MySQL outside, only install mysql-client)
|
1 |
portmaster -d databases/mysql51-client databases/mysql51-server |
Let’s go, install the PHP:
Attention to configure PHP5 package, you need some options checked, at least those which are listed below:
|
1 2 |
│ │ [*] CLI Build CLI version │ │ │ │ [*] APACHE Build Apache module │ │ |
|
1 2 3 4 5 |
portmaster -d lang/php5 databases/php5-mysql graphics/php5-gd www/php5-session archivers/php5-zlib sysutils/php5-posix security/php5-filter converters/php5-mbstring textproc/php5-xml devel/php5-gettext textproc/php5-xmlwriter |
PEAR:
|
1 2 3 4 5 6 7 8 9 |
portmaster -d devel/pear databases/pear-DB_DataObject databases/pear-DB_DataObject_FormBuilder databases/pear-MDB2 textproc/pear-Numbers_Roman textproc/pear-Numbers_Words devel/pear-HTML_QuickForm2 devel/pear-HTML_QuickForm_advmultiselect net/pear-Net_Traceroute net/pear-Net_Ping devel/pear-Validate net/pear-XML_RPC mail/pear-Mail mail/pear-Mail_Mime www/pear-HTTP net/pear-SOAP devel/pear-HTML_Table security/pear-Auth_SASL net/pear-Net_SMTP graphics/pear-Image_Canvas graphics/pear-Image_Graph graphics/pear-Image_GraphViz |
Let’s go to the part of Perl:
|
1 2 3 |
portmaster -d devel/p5-Config-IniFiles graphics/p5-GD databases/p5-DBD-mysql security/p5-Crypt-DES security/p5-Digest-HMAC net-mgmt/p5-Net-SNMP |
Problems with network? implementing security? click here !
An important tool that can not miss in our environment:
|
1 |
portmaster -d databases/rrdtool |
And our background of Centreon, Nagios!
|
1 |
portmaster -d net-mgmt/nagios net-mgmt/ndoutils |
Check the options:
|
1 2 3 |
│ │[X] EMBEDDED_PERL Enable embedded Perl [requires Perl 5.8.0+] │ │ │ │[X] NANOSLEEP Use nanosleep in event timing │ │ │ │[X] EVENT_BROKER Enable event broker functionality │ │ |
Nagios-plugins:
|
1 2 |
│ │ [X] FPING Support for non-flooding fast ping (check_fping) │ │ │ │ [X] NETSNMP SNMP support (check_snmp) │ │ |
If installing in a Jail, check below:
|
1 |
│ │ [X] JAIL Compilation within jail(8) (see Makefile) │ │ |
ndoutils:
|
1 |
│ │ [X] MYSQL MySQL Backend │ │ |
Let’s settings for some packages:
if you are using csh shell
|
1 |
rehash |
PHP:
|
1 2 3 4 |
cd /usr/local/etc cp php.ini-production php.ini # Set the time zone for your location perl -p -i -e 's/;date.timezone =/date.timezone = America/Sao_Paulo/' /usr/local/etc/php.ini |
Apache:
|
1 2 3 4 5 6 7 |
echo 'apache22_enable="YES"' >> /etc/rc.conf echo "AddType application/x-httpd-php .php" >> /usr/local/etc/apache22/Includes/php.conf echo "AddType application/x-httpd-php-source .phps" >> /usr/local/etc/apache22/Includes/php.conf perl -p -i -e 's/DirectoryIndex index.html/DirectoryIndex index.html index.php/g' /usr/local/etc/apache22/httpd.conf # Make sure your hosts file (/etc/hosts) or internal DNS is working properly /usr/local/etc/rc.d/apache22 start |
Mysql:
|
1 2 3 4 |
echo 'mysql_enable="YES"' >> /etc/rc.conf /usr/local/etc/rc.d/mysql-server start # set the root password for mysql mysqladmin -u root password "new-password" |
SNMP:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
echo 'snmpd_enable="YES"' >> /etc/rc.conf echo 'snmpd_flags="-a"' >> /etc/rc.conf echo 'snmpd_conffile="/usr/local/etc/snmp/snmpd.conf"' >> /etc/rc.conf echo 'snmptrapd_enable="YES"' >> /etc/rc.conf echo 'snmptrapd_flags="-a -p /var/run/snmptrapd.pid"' >> /etc/rc.conf mkdir -p /usr/local/etc/snmp cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmp/snmpd.conf perl -p -i -e 's/rocommunity public default -V systemonly/rocommunity public default/g' /usr/local/etc/snmp/snmpd.conf perl -p -i -e 's/agentAddress udp:127.0.0.1:161/#agentAddress udp:127.0.0.1:161/' /usr/local/etc/snmp/snmpd.conf /usr/local/etc/rc.d/snmpd start /usr/local/etc/rc.d/snmptrapd start |
Fix the file /usr/local/etc/snmp/snmpd.conf with location information and identification.
If you are installing snmpd in a Jail, see this article for the same operation in Jail:
http://ggeek.blogspot.com/2008/10/freebsd-jails-and-net-snmp.html
Consulting in Open Source, contact us!
Nagios:
|
1 2 3 4 5 6 7 8 |
sh cd /usr/local/etc/nagios/ ls -1 *-sample | while read arq ; do mv $arq `echo $arq | cut -f1 -d'-'` ; done cd objects/ ls -1 *-sample | while read arq ; do mv $arq `echo $arq | cut -f1 -d'-'` ; done exit echo 'nagios_enable="YES"' >> /etc/rc.conf /usr/local/etc/rc.d/nagios start |
NDOUtils:
|
1 |
echo 'ndo2db_enable="YES"' >> /etc/rc.conf |
Download Centreon:
|
1 2 3 4 |
cd /tmp fetch http://download.centreon.com/centreon/centreon-2.3.3.tar.gz tar zxf centreon-2.3.3.tar.gz cd centreon-2.3.3 |
Making Centreon read the bash shell
There are two ways (choose one):
- Changing the path the scripts Centreon:
|
1 2 |
perl -p -i -e 's//bin/bash//usr/local/bin/bash/g' install.sh perl -p -i -e 's//bin/bash//usr/local/bin/bash/g' libinstall/* |
- Creating a symbolic link in /bin
|
1 |
ln -s /usr/local/bin/bash /bin/bash |
Some preparations for the installation:
|
1 2 |
mkdir -p /tmp/cron.d fetch -o tmpl/vardistrib/freebsd http://www.luizgustavo.pro.br/downloads/freebsd.txt |
Now start the installation via the command:
|
1 |
bash install.sh -f tmpl/vardistrib/freebsd |
Follow the installation process through the video below:
After installation, we will leave for the web part to do so, restart MySQL and Apache:
|
1 2 |
/usr/local/etc/rc.d/apache2 restart /usr/local/etc/rc.d/mysql-server restart |
We fix some patches of permission:
|
1 2 3 4 5 6 7 8 9 10 11 |
chown -R www:www /usr/local/etc/centreon/ cd /usr/local/centreon rm filesGeneration mv /var/cache/centreon/filesGeneration . chown -R www:www filesGeneration rm filesUpload mv /var/cache/centreon/filesUpload . chown -R www:www filesUpload cd /var/cache/centreon ln -s /usr/local/centreon/filesGeneration ln -s /usr/local/centreon/filesUpload |
We also fix a problem of dependence on the version of PEAR:
|
1 2 |
/usr/local/bin/pear uninstall HTML_QuickForm_advmultiselect /usr/local/bin/pear install -f pear/HTML_QuickForm_advmultiselect-1.2.0 |
Now this way, we can point to our broswer centreon server address:
|
1 |
http://<ip_or_url>/centreon |
Follow the video to configure the web:
There is less, we still need to export the configuration files for our NDO-Utils to work for it, follow the export of the same video on the web:
Now, let’s start the processes of Centreon:
|
1 2 3 |
pw user mod nagios -s /bin/sh /usr/local/etc/rc.d/centcore start /usr/local/etc/rc.d/centstorage start |
Setting the part of the CRON to FreeBSD:
|
1 2 3 |
cat /tmp/cron.d/* >> /etc/crontab /etc/rc.d/cron restart rm -rf /tmp/cron.d |
Restart nagios processes and ndoutils
|
1 2 |
/usr/local/etc/rc.d/nagios restart /usr/local/etc/rc.d/ndo2db restart |
Ready! Now just configure your hosts and start monitoring.
If you need support Centreon, contact the Mundounix, we offer support and advice for network monitoring solution.

Luiz Gustavo,
Como faço para o centreon enviar email de notificação e como colocar ele em Portugues?
Hello,
So as to have the reporting working, I had to manually copy /tmp/centreon-2.3.3/cron/* to /usr/local/centreon/cron
But I already have a probleme, if I reboot the server, I could no longueur export the conf to nagios: Error generating files. Any Idea ?
Hello Brazil from Russia. Thanks a lot for that manual.