Nagios3 Centreon2 Ubuntu ndo2

From Wiki Centreon

Jump to: navigation, search
Create NDO DB

We will install the MySQL base for NDO. In addition to the tables of NDO 1.4-b7 there is another one : "centreon_acl". Please enter the commands according to the following example:

# mysql -u root 
 mysql> CREATE DATABASE `ndo` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
 mysql> exit
# mysql -u root ndo < /usr/local/src/centreon-2.0/www/install/createNDODB.sql
# mysql -u root 
 mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON `ndo` . * TO 'centreon'@'localhost';
 mysql> exit

Note

  1. if you defined a password for MySQL (recommended) you should append the option "-p" to root so the system will ask you for a password.
  2. it is possible that you get a syntax error. In this case you should replace 'ndo' by ndo (without quotes).
  3. if you changed the name of the centreon data base you have to replace centreon with the name you specified. User and name of the database are identical! You also have to change the contents of the field db_user in the table cfg_ndo2db of this database (e.g. cent_db).
# mysql -u root
 mysql> use centreon;
 mysql> update cfg_ndo2db set db_user = 'centreon';
 mysql> exit;

Set the password to 'centreon' mysql user connect to database to (DBNDOConnect.php)

# mysql -u root
  mysql> use centreon;
  mysql> update cfg_ndo2db set db_pass = 'XXXXXXXX';
  mysql> exit;
Update NDO2DB Config file

When using the install documentation for fedora it instructs to copy the ndo2db.cfg file from the centreon source. This file is set to set up a unix socket by default. Centreon however by default is looking for a TCP socket. So it cannot connect with error messager " ndomod: Could not open data sink! I'll keep trying, but some output may get lost..." . You modified the ndo2db file to use a TCP socket.

sudo  vi /usr/local/nagios/etc/ndo2db.cfg
  # SOCKET TYPE
  socket_type=tcp
  # DATABASE USERNAME/PASSWORD
  db_user=centreon
  db_pass= <the password you set on Web Installation of Centreon>
  db_name=ndo

Information:

In order to use NDOutils and get graph and Centreon, you must export the configuration in the Centreon Web interface. Afterwords, you must execute NDOutils with the "ndo2db.cfg" file configuration. You can watch the "nagios.log" log file to verify the launching.

# /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg

or better

# /etc/init.d/ndo2db start
# /etc/init.d/nagios start

and then

# tail -f /usr/local/nagios/var/nagios.log | grep ndomod

(A line like "ndomod: Successfully connected to data sink." must appear)

Personal tools