Академический Документы
Профессиональный Документы
Культура Документы
-1-
1.
Setup of a Central server with engine: Nagios, Broker: ndo2d, database: local MySql 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 Central: Ubuntu server setup Central: First login Central: Necessary components Central: Nagios setup Central: Nagios Plugins setup Central: Ndoutils setup Central: Enable snmp Central: Check services Central: Install Centreon Central: Finishing setup of Centreon Central: Configuring webinterface
2. Setup of a Central server with engine: Nagios, Broker: ndo2d, database: local MySql and setup of its Poller server with engine: Nagios using ndomod 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 Central: Ubuntu server setup Central: First login Central: Necessary components Central: Nagios setup Central: Nagios Plugins setup Central: Ndoutils setup Central: Enable snmp Central: Check services Central: Install Centreon Central: Finishing setup of Centreon Central: Configuring webinterface Poller: Ubuntu server setup Poller: First login Poller: Necessary components Poller: Nagios setup Poller: Nagios Plugins setup Poller: Ndoutils setup Poller: Enable snmp Poller: Check services Central: Add Poller to Central Central: Add Poller to Centreon configuration
3. Setup of a Central server with engine: Nagios, Broker: ndo2d, database: external MySql and setup of its Poller server with engine: Nagios using ndomod 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 MySql: Ubuntu server setup MySql: First login MySql: Necessary components MySql: Enable snmp MySql: Check services MySql: Configure root user of mysql from any hosts Central: Ubuntu server setup Central: First login Central: Necessary components -2-
3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.20 3.21 3.22 3.23 3.24 3.25 3.26 3.27 3.28 3.29
Central: Nagios setup Central: Nagios Plugins setup Central: Ndoutils setup Central: Enable snmp Central: Check services Central: Install Centreon Central: Finishing setup of Centreon MySql: Configure centreon user of mysql from any hosts MySql: Reset admin password Central: Configuring webinterface Poller: Ubuntu server setup Poller: First login Poller: Necessary components Poller: Nagios setup Poller: Nagios Plugins setup Poller: Ndoutils setup Poller: Enable snmp Poller: Check services Central: Add Poller to Central Central: Add Poller to Centreon configuration
4. Setup of a Central server with engine: CentEngine, Broker: ndo2d, database: local MySql and setup of its Poller server with engine: Centengine 4.1 NOT WORKING YET
5. Setup of a Central server with engine: Nagios, Broker: Centreon-Broker, database: local MySql and setup of its Poller server with engine: Nagios, Broker: Centreon-Broker 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 5.19 5.20 5.21 Central: Ubuntu server setup Central: First login Central: Necessary components Central: Nagios setup Central: Nagios Plugins setup Central: Ndoutils setup Central: Centreon-Broker setup Central: Enable snmp Central: Check services Central: Install Centreon Central: Finishing setup of Centreon Central: Configuring Centreon to use Centreon-Broker Poller: Ubuntu server setup Poller: First login Poller: Necessary components Poller: Nagios setup Poller: Nagios Plugins setup Poller: Ndoutils setup Poller: Centreon-Broker setup Poller: Enable snmp Poller: Check services -3-
Central: Add Poller to Central Central: Add Poller to Centreon configuration Central: Configuring Centreon to let the Poller use Centreon-Broker
6. Setup of a Central server with engine: Nagios, Broker: Centreon-Broker, database: external MySql and setup of its Poller server with engine: Nagios, Broker: Centreon-Broker 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 6.20 6.21 6.22 6.23 6.24 6.25 6.26 6.27 6.28 6.29 6.30 6.31 6.32 MySql: Ubuntu server setup MySql: First login MySql: Necessary components MySql: Enable snmp MySql: Check services MySql: Configure root user of mysql from any hosts Central: Ubuntu server setup Central: First login Central: Necessary components Central: Nagios setup Central: Nagios Plugins setup Central: Ndoutils setup Central: Centreon-Broker setup Central: Enable snmp Central: Check services Central: Install Centreon Central: Finishing setup of Centreon MySql: Configure centreon user of mysql from any hosts MySql: Reset admin password Central: Configuring Centreon to use Centreon-Broker Poller: Ubuntu server setup Poller: First login Poller: Necessary components Poller: Nagios setup Poller: Nagios Plugins setup Poller: Ndoutils setup Poller: Centreon-Broker setup Poller: Enable snmp Poller: Check services Central: Add Poller to Central Central: Add Poller to Centreon configuration Central: Configuring Centreon to let the Poller use Centreon-Broker
7. Setup of two Central server with engine: Nagios, Broker: Centreon-Broker, database: external MySql and setup of a Poller server with engine: Nagios, Broker: Centreon-Broker 7.1 7.2 7.3 7.4 7.5 7.6 7.7 MySql: Ubuntu server setup MySql: First login MySql: Necessary components MySql: Enable snmp MySql: Check services MySql: Configure root user of mysql from any hosts Central1: Ubuntu server setup -4-
7.8 7.9 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17 7.18 7.19 7.20 7.21 7.22 7.23 7.24 7.25 7.26 7.27 7.28 7.29 7.30 7.31 7.32 7.33
Central1: First login Central1: Necessary components Central1: Nagios setup Central1: Nagios Plugins setup Central1: Ndoutils setup Central1: Centreon-Broker setup Central1: Enable snmp Central1: Check services Central1: Install Centreon Central1: Finishing setup of Centreon MySql: Configure centreon user of mysql from any hosts MySql: Reset admin password Central1: Configuring Centreon to use Centreon-Broker Poller: Ubuntu server setup Poller: First login Poller: Necessary components Poller: Nagios setup Poller: Nagios Plugins setup Poller: Ndoutils setup Poller: Centreon-Broker setup Poller: Enable snmp Poller: Check services Central1: Add Poller to Central Central1: Add Poller to Centreon configuration Central1: Configuring Centreon to let the Poller use Centreon-Broker Central2: Simply clone Central1 to Central2
8. Plugins and others... 8.0 8.1 8.2 8.3 Problems with plugins nagvis syslog geolocation
-5-
-6-
1.
Setup of a Central server with engine: Nagios, Broker: ndo2d, database: local MySql
Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and ndo2db to send data to its local MySql database. 1.1 Central: Ubuntu server setup Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
-7-
-8-
1.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
-9-
1.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
1.4
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
/usr/sbin/groupadd nagios /usr/sbin/usermod -a -G nagios nagios /usr/sbin/usermod -a -G nagios www-data
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
1.5
- 11 -
1.6
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
1.7
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
Or more simply :
vi /etc/snmp/snmpd.conf
1.8
sysv-rc-conf Check Apche2, MySQL , Nagios , ndo2db , snmpd to startup at 2,3,4 and 5 runlevel And reboot
- 13 -
1.9
- 14 -
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y
- 15 -
-----------------------------------------------------------------------Start CentWeb Installation -----------------------------------------------------------------------Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory
OK
OK
OK OK OK
OK
OK
- 16 -
default to [/usr/local/nagios/etc] > Path /usr/local/nagios/etc Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 17 -
Change macros for dashboardBuilder.pl Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK OK
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 18 -
OK OK
-----------------------------------------------------------------------Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin]
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 19 -
> Path /usr/local/centreon/bin /usr/bin/ssh /usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed OK OK OK OK nagios nagios
OK OK OK OK OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ Finding Nagios group : Finding Apache user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps Installing the plugins Trap binaries Change macros for snmptrapd.conf Change macros for snmptt.ini Install : snmptrapd.conf Install : snmp.conf Install : snmptt.ini
OK nagios www-data
OK OK OK OK OK OK OK
- 20 -
Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ############################################################################### # # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
or services centcore and censtorage wont start 1.10 Central: Finishing setup of Centreon
- 21 -
- 22 -
1.11
broker_module=
- 23 -
- 24 -
Reboot After restart check services restarting them: Service centcore restart Service centstorage restart Check for no errors output! If necessary : service ndo2db restart service nagios restart
- 25 -
2. Setup of a Central server with engine: Nagios, Broker: ndo2d, database: local MySql and setup of its Poller server with engine: Nagios using ndomod Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and ndo2db to send data to its local MySql database. 2.1 Central: Ubuntu server setup Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
- 26 -
- 27 -
2.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
- 28 -
2.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
2.4
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
/usr/sbin/groupadd nagios /usr/sbin/usermod -a -G nagios nagios /usr/sbin/usermod -a -G nagios www-data
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
2.5
- 30 -
2.6
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
2.7
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
Or more simply :
vi /etc/snmp/snmpd.conf
2.8
sysv-rc-conf Check Apche2, MySQL , Nagios , ndo2db , snmpd to startup at 2,3,4 and 5 runlevel And reboot
- 32 -
2.9
- 33 -
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y
- 34 -
-----------------------------------------------------------------------Start CentWeb Installation -----------------------------------------------------------------------Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory
OK
OK
OK OK OK
OK
OK
- 35 -
default to [/usr/local/nagios/etc] > Path /usr/local/nagios/etc Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 36 -
Change macros for dashboardBuilder.pl Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK OK
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 37 -
OK OK
-----------------------------------------------------------------------Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin]
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 38 -
> Path /usr/local/centreon/bin /usr/bin/ssh /usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed OK OK OK OK nagios nagios
OK OK OK OK OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ Finding Nagios group : Finding Apache user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps Installing the plugins Trap binaries Change macros for snmptrapd.conf Change macros for snmptt.ini Install : snmptrapd.conf Install : snmp.conf Install : snmptt.ini
OK nagios www-data
OK OK OK OK OK OK OK
- 39 -
Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ############################################################################### # # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
or services centcore and censtorage wont start 2.10 Central: Finishing setup of Centreon
- 40 -
- 41 -
2.11
broker_module=
- 42 -
- 43 -
Reboot After restart check services restarting them: Service centcore restart Service centstorage restart Check for no errors output! If necessary : service ndo2db restart service nagios restart 2.12 Poller: Ubuntu server setup
Now we start preparing an Ubuntu Server 10.04 system to become a Centreon Poller using Nagios engine to check hosts and services status and to send data to a Central. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 44 -
- 45 -
2.13
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
- 46 -
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.121 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
2.14
Run the followings: System update Once its installed, proceed to a system update
aptitude update sudo aptitude full-upgrade y
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
- 47 -
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev y
2.15
/usr/sbin/useradd -m -s /bin/bash nagios passwd nagios Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- 48 -
2.16
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install cd /usr/local/nagios chmod 777 -R libexec vi /etc/sudoers nagios nagios nagios nagios nagios nagios nagios nagios ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: /etc/init.d/nagios restart /etc/init.d/nagios stop /etc/init.d/nagios start /etc/init.d/nagios reload /usr/local/nagios/bin/nagiostats /usr/local/nagios/bin/nagios * /usr/local/nagios/bin/ndo2db * /usr/local/nagios/bin/ndomod.o *
User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO
2.17
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
2.18
vi /etc/default/snmpd
Where 10.77.3.121 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 50 -
Or more simply :
vi /etc/snmp/snmpd.conf
2.19
sysv-rc-conf Check Nagios and snmpd to startup at 2,3,4 and 5 runlevel and reboot
- 51 -
2.20
Setting up key authentication using SSH On the central server generate a key pair using ssh-keygen. Accept all defaults (LEAVE BLANK PASSWORD).
root@central:/# cd /usr/local/nagios/libexec root@central:/usr/local/nagios/libexec# su nagios
$ ssh-keygen
- 52 -
Generating public/private rsa key pair. Enter file in which to save the key (/home/nagios/.ssh/id_rsa): Created directory '/home/nagios/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nagios/.ssh/id_rsa. Your public key has been saved in /home/nagios/.ssh/id_rsa.pub. The key fingerprint is: c3:27:df:68:67:ba:8a:60:1e:47:a1:8d:ad:ac:db:dc nagios@central The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | = o | | o + S . | | . o = o | | * . + + | | * = . . + | | o.+ E ..o. | +-----------------+
Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)
$ ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@poller000.localdomain.com The authenticity of host '10.77.0.49 (10.77.0.49)' can't be established. RSA key fingerprint is 5f:43:48:83:d0:42:eb:ab:42:08:4b:7b:31:ca:59:70. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.77.0.49' (RSA) to the list of known hosts. nagios@10.77.0.49's password: Now try logging into the machine, with "ssh 'nagios@10.77.0.49'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password. Verify that you could access to the satellite without password prompt:
ssh nagios@poller000.localdomain.com
From central centreon Synchronize commands with the satellite (only if you are using the same architecture on both side 32bits or 64bits):
scp /usr/local/nagios/libexec/* nagios@poller000.localdomain.com:/usr/local/nagios/libexec scp /usr/local/nagios/bin/ndomod.o nagios@poller000.localdomain.com:/usr/local/nagios/bin
Delete files from satellite and resync again with scp. 2.21 Central: Add Poller to Centreon configuration
On the poller:
cd /usr/local/nagios/etc rm *
- 53 -
Next, duplicate the ndomod configuration for the new poller. Configuration > Centreon > ndomod.cfg. Select action "Duplicate". (Status: enabled, Requester: the name of the freshly created poller, IP address: the IP address of the central server, Instance name: must be unique)
- 54 -
Next, also duplicate the nagios configuration for the new poller. Configuration > Nagios > nagios.cfg Select action "Duplicate". (Status: enabled, Server Nagios configured: the name of the freshly created poller)
Finalization: Make sure centcore is running on the central server. If it is not running, start it: Reboot both central and poller Hosts configuration Finally, attach host/services to the new poller and generate the configuration for all servers, take a beer and watch your setup go.
- 55 -
0 0 0
0.0.0.0:* 10.77.3.120:5668
- 56 -
3. Setup of a Central server with engine: Nagios, Broker: ndo2d, database: external MySql and setup of its Poller server with engine: Nagios using ndomod Now we start preparing an Ubuntu Server 10.04 system to become a mysql external database server for a Centreon Central server.
3.1
MySql: Ubuntu server setup Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 57 -
3.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@ mysql-cent:~$ sudo su [sudo] password for cristian: root@ mysql-cent:/home/cristian#
- 58 -
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.122 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
nameserver 10.77.3.0 nameserver 10.77.3.1 domain localdomain.com search localdomain.com Restart network services
cd /etc/init.d ./networking restart
- 59 -
3.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils sysv-rc-conf policykit ntp -y
PhpMyAdmin
aptitude install phpmyadmin -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
3.4
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
vi /etc/snmp/snmpd.conf
Or more simply :
vi /etc/snmp/snmpd.conf
3.5
sysv-rc-conf
- 61 -
3.6
LISTEN
- 62 -
Change from:
To:
3.7
Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and ndo2db to send data to an external MySql database Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
- 63 -
- 64 -
3.8
- 65 -
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
3.9
- 66 -
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
3.10
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group. - 67 -
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
3.11
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install
3.12
- 68 -
tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
3.13
vi /etc/default/snmpd
- 69 -
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
Or more simply :
vi /etc/snmp/snmpd.conf
3.14
- 70 -
3.15
export PATH="$PATH:/usr/local/nagios/bin/"
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y ------------------------------------------------------------------------
- 72 -
Start CentWeb Installation -----------------------------------------------------------------------Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory default to [/usr/local/nagios/etc]
OK
OK
OK OK OK
OK
OK
- 73 -
> Path /usr/local/nagios/etc Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl Change macros for dashboardBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 74 -
Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 75 -
Create /etc/centreon/instCentWeb.conf
OK
-----------------------------------------------------------------------Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin] >
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 76 -
Path /usr/local/centreon/bin /usr/bin/ssh /usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed
OK OK OK nagios nagios
OK OK OK OK OK
OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ Finding Nagios group : Finding Apache user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps Installing the plugins Trap binaries Change macros for snmptrapd.conf Change macros for snmptt.ini Install : snmptrapd.conf Install : snmp.conf Install : snmptt.ini Install : snmptt
OK nagios www-data
OK OK OK OK OK OK OK OK
- 77 -
Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ############################################################################### # # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
or services centcore and censtorage wont start 3.16 Central: Finishing setup of Centreon
- 78 -
- 79 -
- 80 -
- 81 -
3.17
- 82 -
3.18
Search for admin user of centreon in database and reset all informations
5f4dcc3b5aa765d61d8327deb882cf99
- 83 -
3.19
Then enter centreon webinterface and retype the password for centreon user of mysql server in nd02db configuration:
- 84 -
Now we start preparing an Ubuntu Server 10.04 system to become a Centreon Poller using Nagios engine to check hosts and services status and to send data to a Central using external MySql Database. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 85 -
- 86 -
3.21
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you): - 87 -
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.121 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
3.22
Run the followings: System update Once its installed, proceed to a system update
aptitude update sudo aptitude full-upgrade y
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl y
- 88 -
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev y
3.23
/usr/sbin/useradd -m -s /bin/bash nagios passwd nagios Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
3.24
cd /usr/local/src/
- 89 -
wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install cd /usr/local/nagios chmod 777 -R libexec vi /etc/sudoers nagios nagios nagios nagios nagios nagios nagios nagios ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: /etc/init.d/nagios restart /etc/init.d/nagios stop /etc/init.d/nagios start /etc/init.d/nagios reload /usr/local/nagios/bin/nagiostats /usr/local/nagios/bin/nagios * /usr/local/nagios/bin/ndo2db * /usr/local/nagios/bin/ndomod.o *
User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO
3.25
- 90 -
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
3.26
vi /etc/default/snmpd
Where 10.77.3.121 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 91 -
127.0.0.1 192.168.0.0/24
Or more simply :
vi /etc/snmp/snmpd.conf
3.27
sysv-rc-conf Check Nagios and snmpd to startup at 2,3,4 and 5 runlevel and reboot
- 92 -
3.28
Setting up key authentication using SSH On the central server generate a key pair using ssh-keygen. Accept all defaults (LEAVE BLANK PASSWORD).
root@central:/# cd /usr/local/nagios/libexec root@central:/usr/local/nagios/libexec# su nagios
- 93 -
$ ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/nagios/.ssh/id_rsa): Created directory '/home/nagios/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nagios/.ssh/id_rsa. Your public key has been saved in /home/nagios/.ssh/id_rsa.pub. The key fingerprint is: c3:27:df:68:67:ba:8a:60:1e:47:a1:8d:ad:ac:db:dc nagios@central The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | = o | | o + S . | | . o = o | | * . + + | | * = . . + | | o.+ E ..o. | +-----------------+
Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)
$ ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@poller000.localdomain.com The authenticity of host '10.77.0.49 (10.77.0.49)' can't be established. RSA key fingerprint is 5f:43:48:83:d0:42:eb:ab:42:08:4b:7b:31:ca:59:70. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.77.0.49' (RSA) to the list of known hosts. nagios@10.77.0.49's password: Now try logging into the machine, with "ssh 'nagios@10.77.0.49'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password. Verify that you could access to the satellite without password prompt:
ssh nagios@poller000.localdomain.com
From central centreon Synchronize commands with the satellite (only if you are using the same architecture on both side 32bits or 64bits):
scp /usr/local/nagios/libexec/* nagios@poller000.localdomain.com:/usr/local/nagios/libexec scp /usr/local/nagios/bin/ndomod.o nagios@poller000.localdomain.com:/usr/local/nagios/bin
3.29
- 94 -
On the poller:
cd /usr/local/nagios/etc rm *
Next, duplicate the ndomod configuration for the new poller. Configuration > Centreon > ndomod.cfg. Select action "Duplicate". (Status: enabled, Requester: the name of the freshly created poller, IP address: the IP address of the central server, Instance name: must be unique)
- 95 -
Next, also duplicate the nagios configuration for the new poller. Configuration > Nagios > nagios.cfg Select action "Duplicate". (Status: enabled, Server Nagios configured: the name of the freshly created poller)
Finalization: Make sure centcore is running on the central server. If it is not running, start it: Reboot both central and poller Hosts configuration Finally, attach host/services to the new poller and generate the configuration for all servers, take a beer and watch your setup go.
root@central:/# netstat -apn |grep 5668 tcp 0 0 0.0.0.0:5668 0.0.0.0:* LISTEN 769/ndo2db tcp 0 0 127.0.0.1:5668 127.0.0.1:34227 ESTABLISHED 2708/ndo2db tcp 0 0 10.77.3.120:5668 10.77.3.121:58976 ESTABLISHED 2719/ndo2db tcp 0 0 127.0.0.1:34227 127.0.0.1:5668 ESTABLISHED 2709/nagios root@poller000:/# netstat -apn |grep 5668 tcp 0 0 0.0.0.0:5668 0.0.0.0:* LISTEN 802/ndo2db tcp 0 0 10.77.3.121:58976 10.77.3.120:5668 ESTABLISHED 8976/nagios On the databse server: root@mysql-cent:~# netstat -apn | grep 3306 tcp 0 0 10.77.3.122:3306 0.0.0.0:* LISTEN 767/mysqld tcp 0 0 10.77.3.122:3306 10.77.3.120:52414 ESTABLISHED 767/mysqld tcp 0 0 10.77.3.122:3306 10.77.3.120:52519 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52448 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52416 ESTABLISHED 767/mysqld tcp 0 0 10.77.3.122:3306 10.77.3.120:52513 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52439 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52482 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52425 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52438 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52517 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52522 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52440 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52467 ESTABLISHED 767/mysqld tcp 0 0 10.77.3.122:3306 10.77.3.120:52524 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52480 TIME_WAIT tcp 0 0 10.77.3.122:3306 10.77.3.120:52462 TIME_WAIT we see that only connection from ndo2db from central are active. So ndomod.cfg of the poller is used to send data to ndo2db of the central that sends data to mysql server :
- 97 -
- 98 -
4. Setup of a Central server with engine: CentEngine, Broker: ndo2d, database: local MySql and setup of its Poller server with engine: Centengine 4.1 NOT WORKING YET
- 99 -
5. Setup of a Central server with engine: Nagios, Broker: Centreon-Broker, database: local MySql and setup of its Poller server with engine: Nagios, Broker: Centreon-Broker CentreonBroker's usage is pretty simple. But first let's have an overview of how the whole system works. As you might know (if not you probably wouldn't be here), the goal of Centreon Broker is to store Nagios events in a database. When monitoring services and hosts, Nagios generates differents kinds of events to notify if a check has been executed or if a service state has changed for example. Those events are processed internally by Nagios and cannot be exported by default. To do this, we will have to load a module within the Nagios process. Once loaded, the module will be able to convert Nagios event structures to a data stream (which is just raw data).
The next step is to retrieve the (potential multiple) data streams from the Nagios instance and store them in a database. Centreon Broker can listen on a or multiple sockets (IPv4, IPv6 or Unix) for a connection from the Nagios module. Each event data will be fetched and transfered to your favorite database.
- 100 -
5.1
Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and Centreon-Broker to send data its local MySql database. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
- 101 -
- 102 -
5.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
- 103 -
[sudo] password for cristian: root@central:/home/cristian# passwd vi /etc/hosts 127.0.0.1 127.0.1.1 10.77.3.120 10.77.3.121 localhost central.localdomain.com central.localdomain.com poller000.localdomain.com
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
5.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
aptitude install apache2 apache2-mpm-prefork libapache2-mod-php5 -y aptitude install php5 php5-mysql mysql-server libmysqlclient-dev -y aptitude install php-pear php5-ldap php5-snmp php5-gd -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
5.4
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
/usr/sbin/groupadd nagios /usr/sbin/usermod -a -G nagios nagios /usr/sbin/usermod -a -G nagios www-data
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker
- 105 -
make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
5.5
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install
5.6
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
5.7
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous.
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
- 107 -
Building Centreon Broker Overview To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...). Dependencies In binary form Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Debian libqt4-dev Qt (>= 4.5) Ubuntu Red Hat qt4-devel Debian librrd-dev RRDTool development files Ubuntu Red Hat rrdtool-devel Software
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: - 108 -
CMake will check for all necessary dependencies and indicates if they could not be found. Variables Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Description Base directory for Centreon Broker installation. If other prefixes are WITH_PREFIX expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed. Variable
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
binaries - 109 -
Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
Packages Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite.
- 110 -
cp redhat-init.d-broker.sh /etc/init.d/central-broker cp redhat-init.d-rrd.sh /etc/init.d/central-rrd root@central:/etc/init.d# chmod 777 central-broker root@central:/etc/init.d# chmod 777 central-rrd update-rc.d central-broker defaults update-rc.d central-rrd defaults chmod 777 R /var/run/centreon
5.8
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 111 -
Or more simply :
vi /etc/snmp/snmpd.conf
5.9
sysv-rc-conf
- 112 -
Check Apche2, MySQL , Nagios , central-broker, central-rrd , snmpd to startup at 2,3,4 and 5 runlevel. NDO2DB must be disabled! And reboot
5.10
- 113 -
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y -----------------------------------------------------------------------Start CentWeb Installation ------------------------------------------------------------------------
- 114 -
Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory default to [/usr/local/nagios/etc] > Path /usr/local/nagios/etc
OK
OK
OK OK OK
OK
OK
OK
- 115 -
Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl Change macros for dashboardBuilder.pl Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 116 -
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 117 -
Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin /usr/bin/ssh OK OK
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 118 -
/usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed
OK nagios nagios
OK OK OK OK OK
OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ OK Finding Nagios group : nagios Finding Apache user : www-data Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps OK Installing the plugins Trap binaries OK Change macros for snmptrapd.conf OK Change macros for snmptt.ini OK Install : snmptrapd.conf OK Install : snmp.conf OK Install : snmptt.ini OK Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ###############################################################################
- 119 -
# # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
or services centcore and censtorage wont start 5.11 Central: Finishing setup of Centreon
- 120 -
- 121 -
5.12
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
- 122 -
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
- 123 -
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
Name : Broker SQL DB Type : MySQL DB host : 127.0.0.1 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 127.0.0.1 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 127.0.0.1
- 124 -
Central-RRD
- 125 -
- 126 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 127 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 128 -
Modification Nagios
Pollers
Dans Configuration -> Centreon -> Pollers : Modifier les champs suivants :
Centreon Broker configuration path : /etc/centreon (l ou les fichiers .xml seront enregistr) Centreon Broker modules path : /usr/local/lib/centreon-broker/ (l ou se trouve les fichiers [0-9][0-9]-*.so)
Nagios.cfg
Dans Configuration -> Nagios -> nagios.cfg, Modifier les champs suivants :
reboot
Permet de vrifier que tous les process de la chaine nagios -> mysql fonctionnent correctement
netstat -taupe | grep -E "cbd|mysql|cent|nagios" | grep -v grep
Permet de verifier que tous les communications dans la chaine nagios -> mysql fonctionnent correctement
5.13
Now we start preparing an Ubuntu Server 10.04 system to become a Centreon Poller using Nagios engine to check hosts and services status and to send data to a Central. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 130 -
- 131 -
5.14
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you): - 132 -
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.121 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
5.15
Run the followings: System update Once its installed, proceed to a system update
aptitude update sudo aptitude full-upgrade y
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP - 133 -
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev y
5.16
/usr/sbin/useradd -m -s /bin/bash nagios passwd nagios Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- 134 -
5.17
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install cd /usr/local/nagios chmod 777 -R libexec vi /etc/sudoers nagios nagios nagios nagios nagios nagios nagios nagios ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: /etc/init.d/nagios restart /etc/init.d/nagios stop /etc/init.d/nagios start /etc/init.d/nagios reload /usr/local/nagios/bin/nagiostats /usr/local/nagios/bin/nagios * /usr/local/nagios/bin/ndo2db * /usr/local/nagios/bin/ndomod.o *
User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO
5.18
cd /usr/local/src
- 135 -
wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
5.19
Remember to allow remote connection in mysql server; and allow centreon user of mysql from any hosts!!!
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous. - 136 -
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
Overview
To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...).
Dependencies
In binary form
Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Debian libqt4-dev Qt (>= 4.5) Ubuntu Red Hat qt4-devel Debian librrd-dev RRDTool development files Ubuntu Red Hat rrdtool-devel Software
- 137 -
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: tar xzf centreon-broker-2.0.1.tar.gz cd centreon-broker-2.0.1 cd build
cmake .
CMake will check for all necessary dependencies and indicates if they could not be found.
Variables
Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Description Base directory for Centreon Broker installation. If other prefixes are WITH_PREFIX expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed. Variable
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
- 138 -
binaries Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
Packages
Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite.
- 139 -
modify the /etc/init.d/central-broker and the /etc/init.d/central-rrd as follow: from RunDir=/var/run/centreon to RunDir=/var/run cd /etc/init.d chmod 777 central-broker chmod 777 central-rrd
cd /etc/ mkdir centreon chmod 777 R centreon cd /usr/local mkdir centreon cd centreon mkdir log cd /usr/local chmod 777 R centreon cd /var/lib/centreon mkdir metrics mkdir status cd /var/lib/
- 140 -
5.20
vi /etc/default/snmpd
Where 10.77.3.121 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
Or more simply :
vi /etc/snmp/snmpd.conf
- 141 -
5.21
sysv-rc-conf
Check Nagios and snmpd to startup at 2,3,4 and 5 runlevel and reboot
- 142 -
5.22
Setting up key authentication using SSH On the central server generate a key pair using ssh-keygen. Accept all defaults (LEAVE BLANK PASSWORD).
root@central:/# cd /usr/local/nagios/libexec root@central:/usr/local/nagios/libexec# su nagios
$ ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/nagios/.ssh/id_rsa): Created directory '/home/nagios/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nagios/.ssh/id_rsa. Your public key has been saved in /home/nagios/.ssh/id_rsa.pub. The key fingerprint is: c3:27:df:68:67:ba:8a:60:1e:47:a1:8d:ad:ac:db:dc nagios@central The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | = o | | o + S . | | . o = o | | * . + + | | * = . . + | | o.+ E ..o. | +-----------------+
Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)
$ ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@poller000.localdomain.com The authenticity of host '10.77.0.49 (10.77.0.49)' can't be established. RSA key fingerprint is 5f:43:48:83:d0:42:eb:ab:42:08:4b:7b:31:ca:59:70. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.77.0.49' (RSA) to the list of known hosts. nagios@10.77.0.49's password: Now try logging into the machine, with "ssh 'nagios@10.77.0.49'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password. Verify that you could access to the satellite without password prompt:
ssh nagios@poller000.localdomain.com
From central centreon Synchronize commands with the satellite (only if you are using the same architecture on both side 32bits or 64bits):
scp /usr/local/nagios/libexec/* nagios@poller000.localdomain.com:/usr/local/nagios/libexec
- 143 -
5.23
On the poller:
cd /usr/local/nagios/etc rm *
Duplicate nagios.cfg:
- 144 -
5.24
Dsactivation de NDO
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg - 145 -
Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
- 147 -
Name : Broker SQL DB Type : MySQL DB host : 10.77.3.120 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 10.77.3.120 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 10.77.3.120
- 148 -
Central-RRD
- 149 -
- 150 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 151 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 152 -
reboot
- 153 -
6. Setup of a Central server with engine: Nagios, Broker: Centreon-Broker, database: external MySql and setup of its Poller server with engine: Nagios, Broker: Centreon-Broker 6.1 MySql: Ubuntu server setup Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 154 -
6.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@ mysql-cent:~$ sudo su [sudo] password for cristian: root@ mysql-cent:/home/cristian#
Last login: Mon Jan 30 11:09:51 2012 cristian@ mysql-cent:~$ sudo su [sudo] password for cristian: root@ mysql-cent :/home/cristian# passwd vi /etc/hosts 127.0.0.1 127.0.1.1 10.77.3.121 10.77.3.120 10.77.3.122 localhost mysql-cent.localdomain.com poller000.localdomain.com central.localdomain.com mysql-cent.localdomain.com
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.122 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
nameserver 10.77.3.0 nameserver 10.77.3.1 domain localdomain.com search localdomain.com Restart network services
cd /etc/init.d ./networking restart
- 156 -
6.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils sysv-rc-conf policykit ntp -y
PhpMyAdmin
aptitude install phpmyadmin -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
6.4
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
vi /etc/snmp/snmpd.conf
Or more simply :
vi /etc/snmp/snmpd.conf
6.5
sysv-rc-conf
- 158 -
6.6
LISTEN
- 159 -
Change from:
To:
6.7
Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and Centreon Broker to send data to an external MySql database Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
- 160 -
- 161 -
6.8
- 162 -
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
6.9
- 163 -
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
6.10
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group. - 164 -
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
6.11
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install
6.12
- 165 -
tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
6.13
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
- 166 -
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous.
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
Building Centreon Broker Overview To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...). Dependencies In binary form Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Qt (>= 4.5) Debian libqt4-dev Ubuntu - 167 Software
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: tar xzf centreon-broker-2.0.1.tar.gz cd centreon-broker-2.0.1 cd build
cmake .
CMake will check for all necessary dependencies and indicates if they could not be found. Variables Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Description Base directory for Centreon Broker installation. If other prefixes are WITH_PREFIX expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed. Variable
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
- 168 -
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
binaries Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
Packages Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite. - 169 -
cp redhat-init.d-broker.sh /etc/init.d/central-broker cp redhat-init.d-rrd.sh /etc/init.d/central-rrd root@central:/etc/init.d# chmod 777 central-broker root@central:/etc/init.d# chmod 777 central-rrd update-rc.d central-broker defaults update-rc.d central-rrd defaults chmod 777 R /var/run/centreon
6.14
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 170 -
Or more simply :
vi /etc/snmp/snmpd.conf
6.15
sysv-rc-conf
- 171 -
Check Apche2, MySQL , Nagios , central-broker, central-rrd , snmpd to startup at 2,3,4 and 5 runlevel. NDO2DB must be disabled! And reboot
6.16
- 172 -
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y -----------------------------------------------------------------------Start CentWeb Installation ------------------------------------------------------------------------
- 173 -
Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory default to [/usr/local/nagios/etc] > Path /usr/local/nagios/etc
OK
OK
OK OK OK
OK
OK
OK
- 174 -
Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl Change macros for dashboardBuilder.pl Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 175 -
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 176 -
Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin /usr/bin/ssh OK OK
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 177 -
/usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed
OK nagios nagios
OK OK OK OK OK
OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ OK Finding Nagios group : nagios Finding Apache user : www-data Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps OK Installing the plugins Trap binaries OK Change macros for snmptrapd.conf OK Change macros for snmptt.ini OK Install : snmptrapd.conf OK Install : snmp.conf OK Install : snmptt.ini OK Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ###############################################################################
- 178 -
# # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
6.17
- 179 -
- 180 -
- 181 -
- 182 -
6.18
- 183 -
6.19
Search for admin user of centreon in database and reset all informations
5f4dcc3b5aa765d61d8327deb882cf99
- 184 -
6.20
Dsactivation de NDO
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker
- 185 -
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
- 186 -
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
Name : Broker SQL DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 - 187 -
DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 127.0.01
- 188 -
Central-RRD
- 189 -
- 190 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 191 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 192 -
Modification Nagios
Pollers
Dans Configuration -> Centreon -> Pollers : Modifier les champs suivants :
Centreon Broker configuration path : /etc/centreon (l ou les fichiers .xml seront enregistr) Centreon Broker modules path : /usr/local/lib/centreon-broker/ (l ou se trouve les fichiers [0-9][0-9]-*.so)
Nagios.cfg
Dans Configuration -> Nagios -> nagios.cfg, Modifier les champs suivants :
Init script
TODO
Debian
Les init script sont dans /script. (redhat-init.d-broker.sh et/ou redhat-init.d-rrd.sh) Ils se dupliquent et les lignes de config son en ligne 99 -> 102
reboot
6.21
Now we start preparing an Ubuntu Server 10.04 system to become a Centreon Poller using Nagios engine to check hosts and services status and to send data to a MySql Server via centreon broker. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 194 -
6.22
- 195 -
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.121 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
6.23
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev y
6.24
/usr/sbin/useradd -m -s /bin/bash nagios passwd nagios Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- 197 -
/usr/sbin/usermod -a -G nagios www-data cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
6.25
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install cd /usr/local/nagios chmod 777 -R libexec vi /etc/sudoers nagios nagios nagios nagios nagios ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: /etc/init.d/nagios restart /etc/init.d/nagios stop /etc/init.d/nagios start /etc/init.d/nagios reload /usr/local/nagios/bin/nagiostats
- 198 -
User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO
6.26
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ *
- 199 -
6.27
Remember to allow remote connection in mysql server; and allow centreon user of mysql from any hosts!!!
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous.
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
Overview
To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...).
- 200 -
Dependencies
In binary form
Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Debian libqt4-dev Qt (>= 4.5) Ubuntu Red Hat qt4-devel Debian librrd-dev RRDTool development files Ubuntu Red Hat rrdtool-devel Software
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: tar xzf centreon-broker-2.0.1.tar.gz cd centreon-broker-2.0.1 cd build
cmake .
CMake will check for all necessary dependencies and indicates if they could not be found.
- 201 -
Variables
Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Description Base directory for Centreon Broker installation. If other prefixes are WITH_PREFIX expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed. Variable
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
binaries Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
- 202 -
Packages
Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite.
- 203 -
modify the /etc/init.d/central-broker and the /etc/init.d/central-rrd as follow: from RunDir=/var/run/centreon to RunDir=/var/run cd /etc/init.d chmod 777 central-broker chmod 777 central-rrd
cd /etc/ mkdir centreon chmod 777 R centreon cd /usr/local mkdir centreon cd centreon mkdir log cd /usr/local chmod 777 R centreon cd /var/lib/centreon mkdir metrics mkdir status cd /var/lib/ chmod 777 R centreon
6.28
vi /etc/default/snmpd
Where 10.77.3.121 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 204 -
Or more simply :
vi /etc/snmp/snmpd.conf
6.29
sysv-rc-conf
- 205 -
Check Nagios and snmpd to startup at 2,3,4 and 5 runlevel and reboot
- 206 -
6.30
Setting up key authentication using SSH On the central server generate a key pair using ssh-keygen. Accept all defaults (LEAVE BLANK PASSWORD).
root@central:/# cd /usr/local/nagios/libexec root@central:/usr/local/nagios/libexec# su nagios
$ ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/nagios/.ssh/id_rsa): Created directory '/home/nagios/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nagios/.ssh/id_rsa. Your public key has been saved in /home/nagios/.ssh/id_rsa.pub. The key fingerprint is: c3:27:df:68:67:ba:8a:60:1e:47:a1:8d:ad:ac:db:dc nagios@central The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | = o | | o + S . | | . o = o | | * . + + | | * = . . + | | o.+ E ..o. | +-----------------+
Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)
$ ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@poller000.localdomain.com The authenticity of host '10.77.0.49 (10.77.0.49)' can't be established. RSA key fingerprint is 5f:43:48:83:d0:42:eb:ab:42:08:4b:7b:31:ca:59:70. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.77.0.49' (RSA) to the list of known hosts. nagios@10.77.0.49's password: Now try logging into the machine, with "ssh 'nagios@10.77.0.49'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password. Verify that you could access to the satellite without password prompt:
ssh nagios@poller000.localdomain.com
From central centreon Synchronize commands with the satellite (only if you are using the same architecture on both side 32bits or 64bits):
scp /usr/local/nagios/libexec/* nagios@poller000.localdomain.com:/usr/local/nagios/libexec
- 207 -
6.31
On the poller:
cd /usr/local/nagios/etc rm *
Duplicate nagios.cfg:
- 208 -
6.32
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker - 209 -
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
- 210 -
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
- 211 -
Name : Broker SQL DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 127.0.0.1
- 212 -
Central-RRD
- 213 -
- 214 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 215 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 216 -
reboot
- 217 -
7. Setup of two Central server with engine: Nagios, Broker: Centreon-Broker, database: external MySql and setup of a Poller server with engine: Nagios, Broker: Centreon-Broker 7.1 MySql: Ubuntu server setup Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 218 -
7.2
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@ mysql-cent:~$ sudo su [sudo] password for cristian: root@ mysql-cent:/home/cristian#
Last login: Mon Jan 30 11:09:51 2012 cristian@ mysql-cent:~$ sudo su [sudo] password for cristian: root@ mysql-cent :/home/cristian# passwd vi /etc/hosts 127.0.0.1 127.0.1.1 10.77.3.121 10.77.3.120 10.77.3.122 localhost mysql-cent.localdomain.com poller000.localdomain.com central.localdomain.com mysql-cent.localdomain.com
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.122 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
nameserver 10.77.3.0 nameserver 10.77.3.1 domain localdomain.com search localdomain.com Restart network services
cd /etc/init.d ./networking restart
- 220 -
7.3
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils sysv-rc-conf policykit ntp -y
PhpMyAdmin
aptitude install phpmyadmin -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
7.4
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
vi /etc/snmp/snmpd.conf
Or more simply :
vi /etc/snmp/snmpd.conf
7.5
sysv-rc-conf
- 222 -
7.6
LISTEN
- 223 -
Change from:
To:
7.7
Now we start preparing an Ubuntu Server 10.04 system to become a Central Centreon using Nagios engine to check hosts and services status and Centreon Broker to send data to an external MySql database Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created cristian/password ( sudo password = password).
- 224 -
- 225 -
7.8
- 226 -
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.120 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
7.9
- 227 -
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl snmptrapfmt snmptt -y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev -y
7.10
On older Ubuntu server editions you will need to also add a nagios group (it's not created by default). You should be able to skip this step on desktop, or newer server editions of Ubuntu. Create a new nagios group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group. - 228 -
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
7.11
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install
7.12
- 229 -
tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
make ndo2db daemon autorun Install the ndo init script by copying it from the ndoutils to the init directory and making it executable by running
cd /usr/local/src/ndoutils-1.4b9 cp daemon-init /etc/init.d/ndo2db chmod +x /etc/init.d/ndo2db
Then add it to your init runlevel to load it automatically when starting/restarting your server. For Debian/Ubuntu do as root or with sudo:
update-rc.d ndo2db defaults
7.13
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
- 230 -
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous.
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
Building Centreon Broker Overview To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...). Dependencies In binary form Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Qt (>= 4.5) Debian libqt4-dev Ubuntu - 231 Software
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: tar xzf centreon-broker-2.0.1.tar.gz cd centreon-broker-2.0.1 cd build
cmake .
CMake will check for all necessary dependencies and indicates if they could not be found. Variables Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Description Base directory for Centreon Broker installation. If other prefixes are WITH_PREFIX expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed. Variable
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
- 232 -
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
binaries Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
Packages Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite. - 233 -
cp redhat-init.d-broker.sh /etc/init.d/central-broker cp redhat-init.d-rrd.sh /etc/init.d/central-rrd root@central:/etc/init.d# chmod 777 central-broker root@central:/etc/init.d# chmod 777 central-rrd update-rc.d central-broker defaults update-rc.d central-rrd defaults chmod 777 R /var/run/centreon
7.14
vi /etc/default/snmpd
Where 10.77.3.120 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 234 -
Or more simply :
vi /etc/snmp/snmpd.conf
7.15
sysv-rc-conf
- 235 -
Check Apche2, MySQL , Nagios , central-broker, central-rrd , snmpd to startup at 2,3,4 and 5 runlevel. NDO2DB must be disabled! And reboot
7.16
- 236 -
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### -----------------------------------------------------------------------Checking all needed binaries -----------------------------------------------------------------------rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK You will now read Centreon Licence. Press enter to continue.
Do you accept GPL license ? [y/n], default to [n]: >y -----------------------------------------------------------------------Please choose what you want to install -----------------------------------------------------------------------Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y -----------------------------------------------------------------------Start CentWeb Installation ------------------------------------------------------------------------
- 237 -
Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK Where is your Centreon log directory default to [/usr/local/centreon/log] > Do you want me to create this directory ? [/usr/local/centreon/log] [y/n], default to [n]: > y Path /usr/local/centreon/log OK Where is your Centreon etc directory default to [/etc/centreon] >y You select slash... Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon Where is your Centreon generation_files directory? default to [/usr/local/centreon] > Path /usr/local/centreon Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is the RRD perl module installed [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 /usr/bin/rrdtool /usr/bin/mail Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php Where is installed Nagios ? default to [/usr/local/nagios] > Path /usr/local/nagios Where is your nagios config directory default to [/usr/local/nagios/etc] > Path /usr/local/nagios/etc
OK
OK
OK OK OK
OK
OK
OK
- 238 -
Where is your Nagios var directory ? default to [/usr/local/nagios/var] > Path /usr/local/nagios/var Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec] > Path /usr/local/nagios/libexec /usr/local/nagios/bin//nagios Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos] > > Path /usr/local/nagios/share/images/logos /usr/local/nagios/bin//nagiostats p1_file : /usr/local/nagios/bin/p1.pl /usr/bin/php /usr/bin/perl Finding Apache group : Finding Apache user : Finding Nagios user : Finding Nagios group : /usr/local/nagios/bin//ndomod.o
OK
OK OK
-----------------------------------------------------------------------Configure Sudo -----------------------------------------------------------------------Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers Nagios init script Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo
OK OK
OK
-----------------------------------------------------------------------Configure Apache server -----------------------------------------------------------------------Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service Preparing Centreon temporary files Change right on /usr/local/centreon/log Change right on /etc/centreon Change right on /usr/local/nagios/share/images/logos Install nagios documentation Change macros for insertBaseConf.sql Change macros for php files Change right on /usr/local/nagios/etc Copy CentWeb in system directory Install CentWeb (web front of centreon) Install libraries Copying libinstall Change macros for centreon.cron Install Centreon cron.d file Change macros for centAcl.php Change macros for downtimeManager.php Change macros for eventReportBuilder.pl Change macros for dashboardBuilder.pl Install cron directory Change right for eventReportBuilder.pl Change right for dashboardBuilder.pl
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 239 -
-----------------------------------------------------------------------Pear Modules -----------------------------------------------------------------------Check PEAR modules PEAR 1.4.9 1.9.0 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.3 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y Upgrading PEAR modules Installing PEAR modules DB DB_DataObject DB_DataObject_FormBuilder MDB2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL Net_SMTP Net_Traceroute Net_Ping Validate XML_RPC SOAP Log Check PEAR modules PEAR DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Archive_Tar Auth_SASL Console_Getopt Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate XML_RPC SOAP Log All PEAR modules
1.7.6 1.8.4 1.0.0RC4 2.0.0 1.1.0 1.6.1 1.0.1 1.2.8 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11 1.4.9 1.7.6 1.8.4 1.0.0RC4 2.0.0 1.4.6 1.2.2 3.2.5 1.1.0 1.6.1 1.1 1.0.1 1.2 1.2.8 1.0.1 0.21 2.4.1 0.6.2 1.4.5 0.10.1 1.9.11
1.7.14 1.9.6 1.0.1 2.4.1 1.5.1 1.8.3 1.0.6 1.6.1 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7 1.9.4 1.7.14 1.9.6 1.0.1 2.4.1 1.4.7 1.2.5 3.2.13 1.5.1 1.8.3 1.3.3 1.0.6 1.2.3 1.6.1 1.0.10 0.21.3 2.4.5 0.8.5 1.5.5 0.13.0 1.12.7
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
- 240 -
Start CentStorage Installation -----------------------------------------------------------------------Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql Creating Centreon Directory '/var/lib/centreon/status' Creating Centreon Directory '/var/lib/centreon/metrics' Change macros for centstorage binary Install CentStorage binary Install library for centstorage Change right : /var/run/centreon Change macros for centstorage init script Do you want me to install CentStorage init script ? [y/n], default to [n]: >y CentStorage init script installed Do you want me to install CentStorage run level ? [y/n], default to [n]: >y update-rc.d: warning: /etc/init.d/centstorage missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Configuration file /etc/centreon/conf.pm not found. Exiting. CentStorage stop FAIL Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for purgeLogs OK Install purgeLogs OK Change macros for purgeCentstorage OK Install purgeCentstorage OK Change macros for centreonPurge.sh OK Install centreonPurge.sh OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK -----------------------------------------------------------------------Start CentCore Installation -----------------------------------------------------------------------Where is your CentCore binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin /usr/bin/ssh OK OK
OK
OK nagios nagios
OK OK OK OK OK OK OK OK
OK
- 241 -
/usr/bin/scp Finding Nagios group : Finding Nagios user : Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change CentCore Macro Copy CentCore in binary directory Change right : /var/run/centreon Change right : /var/lib/centreon Replace CentCore init script Macro Do you want me to install CentCore init script ? [y/n], default to [n]: >y CentCore init script installed
OK nagios nagios
OK OK OK OK OK
OK
Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: warning: /etc/init.d/centcore missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK -----------------------------------------------------------------------Start CentPlugins Installation -----------------------------------------------------------------------Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed -----------------------------------------------------------------------Start CentPlugins Traps Installation -----------------------------------------------------------------------Where is your SNMP configuration directory default to [/etc/snmp] > Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ OK Finding Nagios group : nagios Finding Apache user : www-data Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps OK Installing the plugins Trap binaries OK Change macros for snmptrapd.conf OK Change macros for snmptt.ini OK Install : snmptrapd.conf OK Install : snmp.conf OK Install : snmptt.ini OK Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK ###############################################################################
- 242 -
# # # Go to the URL : http://central.domain.com/centreon/ # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------# # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
7.17
- 243 -
- 244 -
- 245 -
- 246 -
7.18
- 247 -
7.19
Search for admin user of centreon in database and reset all informations
5f4dcc3b5aa765d61d8327deb882cf99
- 248 -
7.20
Dsactivation de NDO
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker
- 249 -
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
- 250 -
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
Name : Broker SQL DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 - 251 -
DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 127.0.01
- 252 -
Central-RRD
- 253 -
- 254 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 255 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 256 -
Modification Nagios
Pollers
Dans Configuration -> Centreon -> Pollers : Modifier les champs suivants :
Centreon Broker configuration path : /etc/centreon (l ou les fichiers .xml seront enregistr) Centreon Broker modules path : /usr/local/lib/centreon-broker/ (l ou se trouve les fichiers [0-9][0-9]-*.so)
Nagios.cfg
Dans Configuration -> Nagios -> nagios.cfg, Modifier les champs suivants :
Init script
TODO
Debian
Les init script sont dans /script. (redhat-init.d-broker.sh et/ou redhat-init.d-rrd.sh) Ils se dupliquent et les lignes de config son en ligne 99 -> 102
reboot
7.21
Now we start preparing an Ubuntu Server 10.04 system to become a Centreon Poller using Nagios engine to check hosts and services status and to send data to a MySql Server via centreon broker. Start with ubuntu-10.04.3-server-amd64.iso a default system setup. User created Cristian/password ( sudo password = password).
- 258 -
7.22
- 259 -
Graph this data and manage this system at https://landscape.canonical.com/ 0 packages can be updated. 0 updates are security updates. Last login: Mon Jan 30 11:09:51 2012 cristian@central:~$ sudo su [sudo] password for cristian: root@central:/home/cristian#
Please verify that you are working with fixed IP address. If not, please change your settings. You should see something like this at the end of the file (the value should be different for you):
auto lo iface lo inet loopback # The primary network interface auto eth0 # iface eth0 inet dhcp iface eth0 inet static address 10.77.3.121 netmask 255.255.252.0 network 10.77.0.0 broadcast 10.77.3.255 gateway 10.77.2.255
7.23
The headers should be already present. If you are using a virtual machine, its time to install the appropriate tools (its up to you). System
aptitude install sysutils policykit ntp -y
RRDTool
aptitude install rrdtool librrds-perl -y
Perl
aptitude install libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha1-perl libgd-gd2-perl -y
SNMP
aptitude install snmp snmpd libnet-snmp-perl libsnmp-perl y
GD-Libraries
aptitude install libgd2-xpm libgd2-xpm-dev libpng12-dev y
7.24
/usr/sbin/useradd -m -s /bin/bash nagios passwd nagios Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- 261 -
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios3.3.1/nagios-3.3.1.tar.gz tar -xzf nagios-3.3.1.tar.gz cd nagios ./configure --prefix=/usr/local/nagios --with-command-group=nagios --enablenanosleep --enable-event-broker make all make install make install-init make install-commandmode make install-config cd /usr/local/nagios/var/ mkdir spool cd spool mkdir checkresults cd /usr/local/nagios/ chown nagios:nagios -R var chmod 777 -R var export PATH="$PATH:/usr/local/nagios/bin/"
7.25
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagiosplugins-1.4.15.tar.gz tar -xzf nagios-plugins-1.4.15.tar.gz cd nagios-plugins-1.4.15 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --withopenssl=/usr/bin/openssl --enable-perl-modules make make install cd /usr/local/nagios chmod 777 -R libexec vi /etc/sudoers nagios nagios nagios nagios nagios nagios nagios ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: ALL=NOPASSWD: /etc/init.d/nagios restart /etc/init.d/nagios stop /etc/init.d/nagios start /etc/init.d/nagios reload /usr/local/nagios/bin/nagiostats /usr/local/nagios/bin/nagios * /usr/local/nagios/bin/ndo2db *
- 262 -
nagios
ALL=NOPASSWD: /usr/local/nagios/bin/ndomod.o *
User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO
7.26
cd /usr/local/src wget http://prdownloads.sourceforge.net/sourceforge/nagios/ndoutils-1.4b9.tar.gz tar -xzf ndoutils-1.4b9.tar.gz cd ndoutils-1.4b9 wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch patch -p1 -N < ndoutils1.4b9_light.patch
manual installation : After creating the binaries and libraries they have to be copied
cd /usr/local/src/ndoutils-1.4b9/src cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o cp ndo2db-3x /usr/local/nagios/bin/ndo2db cd /usr/local/src/ndoutils-1.4b9/config cp ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg cp ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg chmod 777 /usr/local/nagios/bin/ * chown nagios:nagios /usr/local/nagios/bin/ndo*
- 263 -
7.27
Remember to allow remote connection in mysql server; and allow centreon user of mysql from any hosts!!!
Central-Broker (TCP-IPv4) ==> Central-Broker (Broker SQL) ==127.0.0.1:3306==> MySQL base Centstorage
Central-RRD (TCP-IPv4) ==> Central-RRD (RRD File Generator) ==File_system==> Folder of metrics and status
Comment compiler Centreon-Broker Pour la partie Compilation merci de se rfrer au lien ci-dessous.
http://forge.centreon.com/projects/centreon-broker/wiki/Build http://forge.centreon.com/projects/centreon-broker/wiki/Install
Overview
To build Centreon Broker, you will need the following external dependencies :
a C++ compilation environment. CMake, a cross-platform build system. the Qt framework with QtCore, QtSql and QtXml modules. RRDTool development files (for the RRD module).
And you need to get Centreon Broker sources (see in the "Checkout Centreon Broker" section). Centreon Broker is compatible only with Unix-like platforms (Linux, FreeBSD, Solaris, ...).
Dependencies
In binary form
Some OS provides binary versions of some dependencies required by Centreon Broker. To install them, use the standard package installation tool of your plateform (apt on Debian and Ubuntu, yum on Fedora, CentOS, RedHat) and install the following packages: Warning: Check the package version of CMake (>= 2.8) and Qt (>= 4.5) before installation. - 264 -
OS Version Package Name Debian build-essential C++ compilation environment Ubuntu Red Hat gcc-c++, make Debian CMake (>= 2.8) cmake Ubuntu Red Hat Debian libqt4-dev Qt (>= 4.5) Ubuntu Red Hat qt4-devel Debian librrd-dev RRDTool development files Ubuntu Red Hat rrdtool-devel
Software
Compilation configuration
At the root of the project directory you'll find a build directory which holds build scripts. Generate the Makefile by running the following command: tar xzf centreon-broker-2.0.1.tar.gz cd centreon-broker-2.0.1 cd build
cmake .
CMake will check for all necessary dependencies and indicates if they could not be found.
Variables
Your Centreon Broker can be tweaked to your particular needs using CMake's variable system. Variables can be set like this:
$> cmake -D<variable1>=<value1> [-D<variable2>=<value2>] .
Here's the list of variables available and their description: Variable WITH_PREFIX Description Base directory for Centreon Broker installation. If other prefixes are - 265 -
expressed as relative paths, they are relative to this path. WITH_PREFIX_ARCHIVE Path in which development libraries (static libraries) will be installed. WITH_PREFIX_BINARY Path in which binaries will be installed. WITH_PREFIX_LIBRARY Where shared objects (like @em cbmod.so) will be installed. WITH_PREFIX_MODULES Where Centreon Broker modules will be installed.
Example
$> cmake -DWITH_PREFIX=/usr/local/centreon-broker DWITH_PREFIX_LIBRARY=/usr/lib/nagios .
Compilation
Once properly configured, the compilation process is really simple. Just run:
$> make
Installation
See the broker installation page.
binaries Centreon Engine / Nagios modules Centreon Broker modules development headers development libraries
Each of these groups can have a separate installation directory which are configurable as specified in the "Building Centreon Broker" section. Once Centreon Broker has been successfully built, the install process is very simple. Just run the following command as a priviledged user:
$> make install
Packages
Centreon Broker can be packaged directly as a RPM or a DEB package using CPack (part of the CMake software suite). To generate the appropriate package, refer to the @ref build "Building Centreon Broker" section and set the following variables to enable package creation:
CPACK_BINARY_DEB for Debian package generation CPACK_BINARY_RPM for RPM package generation
- 266 -
Also note that Merethis provides RPM packages of Centreon Broker using its Centreon Enterprise Server (CES) product.
Pour les installations sur Debian, il faut ajouter la librairie librrd-dev en plus. Bien noter le rsultat du make install pour avoir les chemins qui seront utile par la suite.
modify the /etc/init.d/central-broker and the /etc/init.d/central-rrd as follow: from RunDir=/var/run/centreon to RunDir=/var/run cd /etc/init.d chmod 777 central-broker
- 267 -
cd /etc/ mkdir centreon chmod 777 R centreon cd /usr/local mkdir centreon cd centreon mkdir log cd /usr/local chmod 777 R centreon cd /var/lib/centreon mkdir metrics mkdir status cd /var/lib/ chmod 777 R centreon
7.28
vi /etc/default/snmpd
Where 10.77.3.121 is the host / network allowed to ask for snmp entries.
#TRAPDRUN=no TRAPDRUN=yes
- 268 -
com2sec readonly
192.168.0.0/24
public private
Or more simply :
vi /etc/snmp/snmpd.conf
7.29
sysv-rc-conf
- 269 -
Check Nagios and snmpd to startup at 2,3,4 and 5 runlevel and reboot
- 270 -
7.30
Setting up key authentication using SSH On the central server generate a key pair using ssh-keygen. Accept all defaults (LEAVE BLANK PASSWORD).
root@central:/# cd /usr/local/nagios/libexec root@central:/usr/local/nagios/libexec# su nagios
$ ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/nagios/.ssh/id_rsa): Created directory '/home/nagios/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nagios/.ssh/id_rsa. Your public key has been saved in /home/nagios/.ssh/id_rsa.pub. The key fingerprint is: c3:27:df:68:67:ba:8a:60:1e:47:a1:8d:ad:ac:db:dc nagios@central The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | = o | | o + S . | | . o = o | | * . + + | | * = . . + | | o.+ E ..o. | +-----------------+
Transfer the public key to the satellite monitor for the Nagios daemon owner. (Replace {IP_ADDRESS} with the IP address of the satellite monitor.)
$ ssh-copy-id -i ~/.ssh/id_rsa.pub nagios@poller000.localdomain.com The authenticity of host '10.77.0.49 (10.77.0.49)' can't be established. RSA key fingerprint is 5f:43:48:83:d0:42:eb:ab:42:08:4b:7b:31:ca:59:70. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.77.0.49' (RSA) to the list of known hosts. nagios@10.77.0.49's password: Now try logging into the machine, with "ssh 'nagios@10.77.0.49'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
The last command will ask for the password of nagios on the satellite monitor. If these steps are succesfully completed, you should be able to log on to the satellite monitor via SSH without entering a password. Verify that you could access to the satellite without password prompt:
ssh nagios@poller000.localdomain.com
From central centreon Synchronize commands with the satellite (only if you are using the same architecture on both side 32bits or 64bits):
scp /usr/local/nagios/libexec/* nagios@poller000.localdomain.com:/usr/local/nagios/libexec
- 271 -
7.31
On the poller:
cd /usr/local/nagios/etc rm *
Duplicate nagios.cfg:
- 272 -
7.32
Configuration -> Centreon -> ndo2db.cfg : disable! Disable also ndomod.cfg Administration -> Options -> Monitoring : s Monitoring database layer change to Centreon Broker - 273 -
Activation de Centreon-Broker
Pour ajouter des broker dans centreon, aller dans Configuration -> Centreon -> Centreon-Broker : Configuration
Central-Broker
- 274 -
Complter longlet "Logger" avec lajout dun "Core File" (il faut que larborescence existe sinon cbd se plantera)
Complter longlet "Output" avec lajout (dans l'ordre) dun "SQL Broker SQL Database", un "Storage Perfdata Generator (Centreon Storage)" et dun "TCP - Ipv4"
- 275 -
Name : Broker SQL DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : Perfdata Master Interval Length : 60 RRD Length : 155552000 DB Type : MySQL DB host : 10.77.3.122 DB Port : 3306 DB user : centreon DB password : password DB name : centstorage Name : RRD Master Connection port : 5669 Host to connect to : 127.0.0.1
- 276 -
Central-RRD
- 277 -
- 278 -
Complter longlet "Output" avec lajout dun "RRD RRD File Generator"
Name : RRD-File Metrics RRD Directory : /var/lib/centreon/metrics Status RRD Directory : /var/lib/centreon/status
Central-Module
- 279 -
Il n'y a pas d'input pour le module Complter longlet "Logger" avec lajout dun "Core File"
- 280 -
reboot
7.33
Clone the Central1 to Central2 and remember to use them just as Central server, not as Pollers.
- 281 -
To run as root, you can use a tool like sudo. To set the setuid permissions, use the command: chmod u+s yourpluginfile check_icmp: Failed to obtain ICMP socket: Operation not permitted
chmod u+s check_centreon_ping chmod u+s check_icmp
cd /var/lib mkdir centreon cd centreon mkdir centplugins cd /var/lib chmod 777 -R centreon
8.1
nagvis
Pr requis
Le paquet curl doit tre prsent sur le serveur debian
apt-get install curl install graphviz
L'installation tlchargera automatiquement la dernire version de Nagvis si vous tes connect Internet avec le serveur. Malheureusement dans certaine entreprise, vous n'avez pas accs Internet - 282 -
pour les serveurs. Dans ce cas, copiez l'archive de Nagvis, pralablement tlcharge, dans le dossier /tmp
# DO NOT MODIFY HERE ! sqlmoduleconf="USE $CENTREONDB; INSERT INTO options (\`key\`,\`value\`) INSERT INTO options (\`key\`,\`value\`) INSERT INTO options (\`key\`,\`value\`) INSERT INTO options (\`key\`,\`value\`) INSERT INTO options (\`key\`,\`value\`)
sqlclean="DROP TABLE IF EXISTS $CENTREONDB.centreonnagvis; DROP DATABASE IF EXISTS $NAGVISDB;" sqlcentreon="use $CENTREONDB; CREATE TABLE centreonnagvis int(10) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;" ( acl_group_id int(10) NOT NULL, roleId
sqlacl="GRANT ALL PRIVILEGES ON $NAGVISDB.* to '$NAGVISUSER'@'$LOCALMACHINE' identified by '$NAGVISPASS'; GRANT SELECT on $CENTREONDB.centreonnagvis to '$NAGVISUSER'@'$LOCALMACHINE'; GRANT SELECT on $CENTREONDB.acl_groups to '$NAGVISUSER'@'$LOCALMACHINE'; GRANT SELECT on $CENTREONDB.session to '$NAGVISUSER'@'$LOCALMACHINE';
- 283 -
SELECT on $CENTREONDB.acl_group_contacts_relations to '$NAGVISUSER'@'$LOCALMACHINE'; SELECT on $CENTREONDB.contact to '$NAGVISUSER'@'$LOCALMACHINE'; SELECT on $NAGVISDB.roles to '$CENTREONUSER'@'$LOCALMACHINE'; PRIVILEGES;"
sqlnagvisdb="CREATE DATABASE IF NOT EXISTS $NAGVISDB DEFAULT CHARACTER SET latin1 ; USE $NAGVISDB ; DROP TABLE IF EXISTS perms ; CREATE TABLE perms ( permId int(10) NOT NULL AUTO_INCREMENT, \`mod\` varchar(100) DEFAULT NULL, \`act\` varchar(100) DEFAULT NULL, \`obj\` varchar(100) DEFAULT NULL, PRIMARY KEY ( permId ), UNIQUE KEY permId ( \`mod\` , \`act\` , \`obj\` ) ) ENGINE=MyISAM AUTO_INCREMENT=150 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS roles ; CREATE TABLE roles ( roleId int(10) NOT NULL AUTO_INCREMENT, name varchar(100) DEFAULT NULL, PRIMARY KEY ( roleId ), UNIQUE KEY roleId ( name ) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS roles2perms ; CREATE TABLE roles2perms ( roleId int(10) DEFAULT NULL, permId int(10) DEFAULT NULL, UNIQUE KEY roleId ( roleId , permId ) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS users ; CREATE TABLE users ( userId int(10) NOT NULL AUTO_INCREMENT, name varchar(100) DEFAULT NULL, password varchar(40) DEFAULT NULL, PRIMARY KEY ( userId ), UNIQUE KEY userId ( name ) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS users2roles ; CREATE TABLE users2roles ( userId int(10) DEFAULT NULL, roleId int(10) DEFAULT NULL, UNIQUE KEY userId ( userId , roleId ) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS version ; CREATE TABLE version ( version varchar(100) NOT NULL DEFAULT '', PRIMARY KEY ( version ) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
LOCALMACHINE correspond au nom du serveur pour la connexion MySql. Dans notre cas les connexions MySql pour Centreon se font avec centreon@localhost, car notre serveur comprend la base MySql. Dans le cas d'une base externe, il faudra mettre le nom du serveur.
#!/bin/bash TMP="/tmp" MODULE_NAME="nagvis" LOCALMACHINE="localhost"
- 284 -
Ces lignes correspondent aux paramtrages de Nagvis, normalement il faut laisser par dfaut.
NAGVISBRANCH="1.5" NAGVISVER="${NAGVISBRANCH}.9" NAGVISDL="http://downloads.sourceforge.net/project/nagvis/NagVis%20$NAGVISBRANCH /nagvis-$NAGVISVER.tar.gz" NAGVISPATH="/usr/local/nagvis" NAGVISURI="/nagvis"
Il reste saisir les paramtres pour Mysql, et la cration du user nagvis pour la base Mysql.
MYSQLUSER="root" MYSQLPASSWD="passwd mysql" MYSQLHOST="localhost" MYSQLPORT="3306" CENTREONDB="centreon" CENTREONUSER="centreon" CENTREONPASSWD="passwd centreon" CENTSTATUSDB="centstatus" NAGVISDB="nagvis" NAGVISUSER="nagvis" NAGVISPASS="passwd nagvis" INSTANCE="Central"
Lancez l'installation
./setup.sh -i Parsing arguments Checking existing installation Checking database centreon for centreonnagvis table Checking database nagvis Checking centreon module /usr/local/centreon/www/modules/nagvis folder Deploy module Deploying databases modifications > creating table centreon nagvis in centreon > creating database nagvis > populating nagvis database Install module Getting nagvis --2011-07-24 19:47:04--
- 285 -
http://downloads.sourceforge.net/project/nagvis/NagVis%201.5/nagvis-1.5.9.tar.gz Rsolution de downloads.sourceforge.net... 216.34.181.59, 216.34.181.59 Connexion vers downloads.sourceforge.net|216.34.181.59|:80...connect. requte HTTP transmise, en attente de la rponse...302 Found Emplacement: http://freefr.dl.sourceforge.net/project/nagvis/NagVis%201.5/nagvis-1.5.9.tar.gz [suivant] --2011-07-24 19:47:04-http://freefr.dl.sourceforge.net/project/nagvis/NagVis%201.5/nagvis-1.5.9.tar.gz Rsolution de freefr.dl.sourceforge.net... 88.191.250.132 Connexion vers freefr.dl.sourceforge.net|88.191.250.132|:80...connect. requte HTTP transmise, en attente de la rponse...200 OK Longueur: 3298253 (3,1M) [application/x-gzip] Sauvegarde en : nagvis-1.5.9.tar.gz 100%[===============================================>] 3 298 253 9,3s 2011-07-24 19:47:14 (347 KB/s) - nagvis-1.5.9.tar.gz sauvegard [3298253/3298253] installing nagvis 315K/s ds
Celui-ci n'est pas administrateur. Faire de mme pour l'utilisateur exploitant et son groupe de contact associ niveau2
- 287 -
exploitant et niveau2 devront tre slectionns pour le groupe d'accs nagvisRW Nous donnerons accs aux menus de Centreon avec les groupes d'accs aux Menus MNUniveau1 et MNUniveau2.
- 288 -
Le niveau 1 aura une vue limite au monitoring en temps rel de la supervision. Ne pas oublier d'associer le groupe d'accs nagvisRO.
- 289 -
Le niveau 2 aura une vue plus tendue. Ne pas oublier d'associer le groupe d'accs nagvisRW.
Ensuite nous utiliserons un groupe d'accs aux ressources nomm All Ressources (celui cr par dfaut lors de l'installation de Centreon) et nous ajouterons les deux groupes d'accs nagvisRW et nagvisRO.
- 290 -
Pour information, nous crerons le groupe d'accs aux actions pour le niveau2 et nous ajouterons le groupe d'accs nagvisRW. Les actions permises par ce groupe seront coches dans la liste propose.
Dans notre exemple le groupe nagvisRO (nagios en lecture seule) sera associ au groupe Users (read-only) et le groupe nagvisRW (admin nagvis) sera associ au groupe Administrators. N'oubliez pas de sauvegarder.
Vrification
Et voila, votre module est fonctionnel. Vous pouvez le tester en vous connectant en exploitant. La vue Nagvis est parfaitement intgre dans l'interface Centreon.
- 291 -
Un conseil, n'oublier pas de changer le mot de passe par dfaut de l'administrateur nagiosadmin propos par Nagvis.
Cette situation est tout fait normale, car il n'y a pas de relation entre les utilisateurs Centreon et un utilisateur Nagvis en lecture seule (Il n'existe pas en fait). Pour remdier, se connecter en administrateur (par exemple en exploitant). Slectionnez le menu User Menu / Manage Users
- 292 -
Lui affecter le rle Users (read-only). N'oubliez pas de sauvegarder et quitter l'interface. Vous pouvez utiliser sans problme le compte supervision.
8.2
syslog
Pr requis
Il nous faut installer la librairie libssh2 pour la connexion ssh entre le serveur de supervision et syslog, les outils de dveloppement php5.
apt-get install libssh2-1-dev php5-dev apt-get install libssh2-php apache2ctl -k graceful pecl install -f ssh2-beta
- 293 -
- 294 -
You will now read Centreon Syslog module Licence. Press enter to continue.
Accepter la licence
-----------------------------------------------------------------------Load parameters -----------------------------------------------------------------------Please specify the directory with contain "instCentWeb.conf" > /etc/centreon
Slectionnez Administration / Modules. Cliquez sur l'icne droite pour installer le module.
- 296 -
Une nouvelle vue Syslog a t cr dans la section Monitoring, mais celle-ci n'est pas encore fonctionnelle. Il faut configurer l'authentification ssh entre le serveur de supervision et le serveur syslog.
Configuration du module
Avant de raliser la configuration du module, affectez un mot de passe l'utilisateur syslog sur le serveur Syslog.
root@syslog:~# passwd syslog Entrez le nouveau mot de passe UNIX : syslog2011 Retapez le nouveau mot de passe UNIX : syslog2011 passwd : le mot de passe a t mis jour avec succs
- 297 -
- 298 -
Onglet Database : Saisir l'adresse IP du serveur Syslog, le nom de la base Syslog et le mot de passe syslogadmin
Onglet SSH : Saisir l'adresse IP du serveur Syslog, le mot de passe de l'utilisateur syslog
Onglet Configuration : Saisir le chemin du fichier de configuration de syslog sur le serveur Syslog. Sauvegarder la configuration en cliquant sur le bouton Save.
Il faut exporter le fichier de configuration vers le serveur Syslog. Cliquer sur le bouton Export Configuration
- 299 -
Le fichier a bien t envoy. Attention, il y a un problme de configuration dans la connexion Mysql que je n'arrive pas expliquer actuellement. Remettre l'adresse ip du serveur Syslog dans l'onglet Database.
Sauvegarder la configuration sans l'exporter. Retour la vue Monitoring, il n'y a toujours pas de donnes affiches ! En fait le serveur Mysql de Syslog n'accepte pas les connexions externes. Il faut donc modifier le fichier de configuration my.cnf du serveur Syslog.
bind-address = 172.16.209.132
- 300 -
Cliquez sur Search, vous avez un message d'erreur. C'est un fonctionnement normal. La table des logs de la journe actuelle n'est pas encore prsente. Il faudra attendre 23 h 59 pour que le script /usr/bin/syslog/tableLogRotate.php s'excute. Il y a possiblit de forcer son excution en se connectant sur le serveur Syslog.
root@syslog:/usr/bin/syslog# php tableLogRotate.php BEGIN TABLES LOGS ROTATION AT 2011-05-06 15:53:10 DROP TABLE all_logs RENAME TABLE logs TO logs20110507 CREATE TABLE logs CREATE MERGE TABLE all_logs
- 301 -
END OF TABLES LOGS ROTATION AT 2011-05-06 15:53:10 BEGIN TABLES CACHE ROTATION AT 2011-05-06 15:53:10 DROP TABLE all_cache RENAME TABLE cache TO cache20110507 CREATE MERGE TABLE all_cache END OF TABLES CACHE ROTATION AT 2011-05-06 15:53:10
La table est cre, vous pouvez retourner sur Centreon et visualiser les logs.
Vous avez la possibilit de filtrer sur une priode de date et d'exporter au format csv ou open office.
Nous rajoutons le suffixe -text aux champs syslogfacility et syslogpriority. N'oubliez pas de relancer le serveur syslog.
/etc/init.d/rsyslog restart
- 302 -
Les champs se remplissent aussitt avec du texte, le champ Severity change de couleur en fonction de la criticit de l'vnement comme ci-dessous.
L'installation de notre Syslog est termine. Pour effectuer une ventuelle mise jour du module, visiter cette page. Il restera complter l'installation du module de langue franais. Nous allons, maintenant, aborder la centralisation des vnements windows par l'intermdiaire de Centreon E2S.
8.3
geolocation
- 303 -