Help! I have to change the IP Address of a Centreon server - Part I

  • 18 March 2022
  • 2 replies
  • 3368 views

Userlevel 4
Badge +5


1. Simple architecture

 

Before changing:

  • Central server:

    • Address: 192.168.1.48

After changing:

  • Central server:

    • Address: 192.168.1.64

Configuration:

  • Before changing, connect to the Centreon web interface and check that everything is fine.

  • Change the IP address of your virtual machine
  • Then check the status of all processes

systemctl status php-fpm httpd24-httpd mariadb centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd

  • You will probably notice that some Centreon processes are not running.

● centreon.service - One Service to rule them all.
Loaded: loaded (/usr/lib/systemd/system/centreon.service; disabled; vendor preset: disabled)
Active: inactive (dead)
● cbd.service - Centreon Broker watchdog
Loaded: loaded (/usr/lib/systemd/system/cbd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
● centengine.service - Centreon Engine
Loaded: loaded (/usr/lib/systemd/system/centengine.service; disabled; vendor preset: disabled)
Active: inactive (dead)
● gorgoned.service - Centreon Gorgone
Loaded: loaded (/etc/systemd/system/gorgoned.service; disabled; vendor preset: disabled)
Active: inactive (dead)

  • Start processes that are not running
systemctl restart centreon cbd centengine gorgoned

  • Log in to the Centreon web interface via the new IP. You will notice that the Central server is not updated. Just wait a little while and everything will be fine.

 

2. Distributed architecture

 

2.1. Changing the IP address of Centreon Central

 

Before changing:

  • Central server:

    • Address: 192.168.1.48

  • Poller:

    • Address: 192.168.1.73

After changing:

  • Central server:

    • Address: 192.168.1.85

  • Poller:

    • Address: 192.168.1.73

Configuration:

  • Before changing, check the network flows on TCP ports 5556 and 5669 on the Central and the Poller.


[root@Central ~]# netstat -plantu | grep 5556
tcp 0 0 192.168.1.48:54044 192.168.1.73:5556 ESTABLISHED 14390/gorgone-proxy


[root@Central ~]# netstat -plantu | grep 5669
tcp 0 0 192.168.1.48:5669 192.168.1.73:60716 ESTABLISHED 8517/cbd


[root@Poller ~]# netstat -plantu | grep 5556
tcp 0 0 192.168.1.73:5556 192.168.1.48:54044 ESTABLISHED 8112/perl


[root@Poller ~]# netstat -plantu | grep 5669
tcp 0 0 192.168.1.73:60716 192.168.1.48:5669 ESTABLISHED 8248/centengine

  • Connect to the Centreon web interface and check that everything is fine.
  • Change the IP address of your Centreon Central

  • Log in to Centreon web interface via the new IP Address ( here 192.168.1.85)

  • Check the status of all processes on the Central

[root@Central ~]# systemctl status php-fpm httpd24-httpd mariadb centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd

  • You will probably notice that some Centreon processes are not running.
● centreon.service - One Service to rule them all.
Loaded: loaded (/usr/lib/systemd/system/centreon.service; disabled; vendor preset: disabled)
Active: inactive (dead)

● cbd.service - Centreon Broker watchdog
Loaded: loaded (/usr/lib/systemd/system/cbd.service; enabled; vendor preset: disabled)
Active: inactive (dead)

● centengine.service - Centreon Engine
Loaded: loaded (/usr/lib/systemd/system/centengine.service; disabled; vendor preset: disabled)
Active: inactive (dead)

● gorgoned.service - Centreon Gorgone
Loaded: loaded (/etc/systemd/system/gorgoned.service; disabled; vendor preset: disabled)
Active: inactive (dead)
  • Start processes that are not running


[root@Central ~]# systemctl restart centreon cbd centengine gorgoned

  • You will notice that the Poller is not updated
  • Go to menu: Configuration  >  Pollers  >  Broker configuration
  • Choose the name of the Poller ( here poller-module) and the tab Output. Change the field Host to connect to by the IP address of the new Central
  • Restart gorgone

[root@Central ~]# systemctl restart gorgoned

  • Export the configuration

From the Pollers listing, select the Poller and click on Export configuration.

Then check the four first boxes, select the Restart method and click on Export.

 

2.2. Changing the IP address of Centreon Poller

Before changing:

  • Central server:

    • Address: 192.168.1.85

  • Poller:

    • Address: 192.168.1.73

After changing:

  • Central server:

    • Address: 192.168.1.85

  • Poller:

    • Address: 192.168.1.15

Configuration:

  • Before changing, check the network flows on TCP ports 5556 and 5669 on the Central and the Poller.


[root@Central ~]# netstat -plantu | grep 5556
tcp 0 0 192.168.1.85:54802 192.168.1.73:5556 ESTABLISHED 2692/gorgone-proxy

[root@Central ~]# netstat -plantu | grep 5669
tcp 0 0 192.168.1.85:5669 192.168.1.73:49610 ESTABLISHED 2110/cbd

[root@Poller ~]# netstat -plantu | grep 5556
tcp 0 0 192.168.1.73:5556 192.168.1.85:54802 ESTABLISHED 8419/perl

[root@Poller ~]# netstat -plantu | grep 5669
tcp 0 0 192.168.1.73:49610 192.168.1.85:5669 ESTABLISHED 8480/centengine

  • Connect to the Centreon web interface and check that everything is fine
  • Change the IP address of your Centreon Poller

  • Log in to Centreon web interface via  IP Address 192.168.1.85. You will notice that the Poller is not updated
  • Go to Configuration > Poller and click on the name of your Poller. Then replace the old IP with the new IP of your Poller. Click on Save
  • The Poller is still not updated

  • Export the configuration

From the Pollers listing, select the Poller and click on Export configuration.

 

3. Distributed architecture with Remote DBMS

 

3.1. Changing the IP address of Remote DBMS

 

Before changing:

  • Central server:

    • Address: 192.168.1.50

  • Database:

    • Address: 192.168.1.7

After changing:

  • Central server:

    • Address: 192.168.1.50

  • Database:

    • Address: 192.168.1.56

Configuration:

  • Log in to the web interface after changing the IP address of the monitoring database. You will get the following message.

  • Connect to your Central via SSH and replace the old database IP with the new IP in some files


[root@central ~]# vi /etc/centreon/config.d/10-database.yaml

[root@central ~]# vi /etc/centreon/centreon.conf.php

[root@central ~]# vi /etc/centreon/conf.pm
  • The web interface is now available but the Central is not updated.

  • Go to Configuration  >  Pollers  >  Broker configuration > central-broker-master. Replace the old Database IP with the new IP

  • From your web interface, go to Configuration > Pollers, select Central from the listing and click on Export configuration

 

3.2. Changing the IP address of Centreon Central

 

Before changing:

  • Central server:

    • Address: 192.168.1.50

  • Database:

    • Address: 192.168.1.56

After changing:

  • Central server:

    • Address: 192.168.1.27

  • Database:

    • Address: 192.168.1.56

Configuration:

  • Before changing, check the network flows on TCP ports 3306

[root@central ~]# netstat -plantu | grep 3306

tcp 0 0 192.168.1.50:48926 192.168.1.56:3306 ESTABLISHED 27984/cbd
  • Log in to the web interface after changing the IP address of the Central Server. You will get the following message.
  • In the database you will see the old Central IP address.
MariaDB [mysql]> select User, Host, Password from user;
+-------------+-------------------+-------------------------------------------+
| User | Host | Password |
+-------------+--------------------+-------------------------------------------+
| mariadb.sys | localhost | |
| root | localhost | *FF9CD9A43775B1A6C32732EC54811A2CD2FC21D0 |
| mysql | localhost | invalid |
| root | 192.168.1.50 | *FF9CD9A43775B1A6C32732EC54811A2CD2FC21D0 |
| centreon | 192.168.1.50 | *FF9CD9A43775B1A6C32732EC54811A2CD2FC21D0 |
+-------------+---------------------+-------------------------------------------+
  • Recreate these users with root privileges needed (Replace 192.168.1.27 with your new Central IP address).

drop user 'root'@'192.168.1.50';
drop user 'centreon'@'192.168.1.50';

You can find the password used by the centreon user under: /etc/centreon/config.d/10-database.yaml

CREATE USER 'root'@'192.168.1.27' IDENTIFIED BY 'centreon';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.27' WITH GRANT OPTION;
FLUSH PRIVILEGES;

CREATE USER 'centreon'@'192.168.1.27' IDENTIFIED BY 'centreon';
GRANT ALL PRIVILEGES ON *.* TO 'centreon'@'192.168.1.27' WITH GRANT OPTION;
FLUSH PRIVILEGES;

MariaDB [mysql]> select User, Host, Password from user;
+-------------+--------------+-------------------------------------------+
| User | Host | Password |
+-------------+--------------+-------------------------------------------+
| root | 192.168.1.27 | *FF9CD9A43775B1A6C32732EC54811A2CD2FC21D0 |
| centreon | 192.168.1.27 | *FF9CD9A43775B1A6C32732EC54811A2CD2FC21D0 |
+-------------+--------------+-------------------------------------------+

  • Log in to the web interface

In the second part, we will see how to change the IP when a MAP or MBI server comes into play.

 

4. Centreon MAP (Part II)

5. Centreon MBI (Part II)


2 replies

Userlevel 4
Badge +5

The second part here :

 

Badge +4

Hi,

 

How to change IP of a poller when we have a Remote between them?

I tried chapter 2.2 without success.

Reply