Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Synchronization between Central and Remote #6939

Closed
aurelienfx opened this issue Nov 5, 2018 · 19 comments
Closed

Synchronization between Central and Remote #6939

aurelienfx opened this issue Nov 5, 2018 · 19 comments

Comments

@aurelienfx
Copy link

aurelienfx commented Nov 5, 2018


BUG REPORT INFORMATION

Centreon Web version: 18.10

Centreon Engine version: 18.10

Centreon Broker version: 18.10

OS: CentOS 7 up to date

Additional environment details (AWS, VirtualBox, physical, etc.):
physical server, 4Go of RAM, time synchronised by chrony on a domain ntp server

Steps to reproduce the issue:

  1. Install a central with database
    2.Launch all services (cbd, centcore, centegine, centreontrapd)
  2. Activate remote with
    # /usr/share/centreon/bin/centreon -u admin -p centreon -a enableRemote -o CentreonRemoteServer -v @IP_CENTREON_CENTRAL
  3. The command is ok
  4. I add the remote in the Central with the wizzard, export the configuration and restart central and poller

Describe the results you received:
On the central the configuration is ok :
https://slack-files.com/T08DULM43-FDUGPVDUJ-6723ee5766

But when I try to consult a host on the remote :
https://slack-files.com/T08DULM43-FDUNJG8VB-47f243ccaa

Describe the results you expected:
Can consult correctly the host

Additional information you think important (e.g. issue happens only occasionally):
On the central, I've a status unknown on broker-stats for the remote.

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 6, 2018

Hi,

Can you open two terminal, 1 on Centreon centraland 1 on Remote Server and watch /var/log/centreon/worker.log
Then go to "Configuration > Pollers", select the Remote Server, check 4 first boxes and export the Configuration.

Can you put the result of both logs file?

@lpinsivy lpinsivy added status/more-info-needed Waiting for more information area/remote-server labels Nov 6, 2018
@aurelienfx
Copy link
Author

ok, so there is the result of /var/log/centreon/workger.log on the central :

[2018:11:06 03:47:44] Checking for pending export tasks: #1
[2018:11:06 03:47:44] Checking for pending import tasks: None found
[2018:11:06 03:47:44] Worker cycle completed.
[2018:11:06 03:50:57] Checking for pending export tasks: #2
[2018:11:06 03:50:57] Checking for pending import tasks: None found
[2018:11:06 03:50:57] Worker cycle completed.
[2018:11:06 03:52:19] Checking for pending export tasks: #3
[2018:11:06 03:52:19] Checking for pending import tasks: None found
[2018:11:06 03:52:19] Worker cycle completed.

On the remote :
[2018:11:06 03:47:46] Checking for pending export tasks: None found
[2018:11:06 03:47:46] Checking for pending import tasks:
[2018:11:06 03:50:59] Checking for pending export tasks: None found
[2018:11:06 03:50:59] Checking for pending import tasks:
[2018:11:06 03:52:21] Checking for pending export tasks: None found
[2018:11:06 03:52:21] Checking for pending import tasks:

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 6, 2018

@aurelienfx thank you for your answer.

To continue the debug, can you execute the following SQL request on both servers:

# mysql -u root centreon -e "select * from task;"

Then can you send me by private message the content of /usr/share/centreon/filesGeneration/export/<poller_id> directory? (poller_id is the ID of the Remote Server)

@aurelienfx
Copy link
Author

On the RS : https://slack-files.com/T08DULM43-FDW9JBEUQ-639c554e7b
On the central : https://slack-files.com/T08DULM43-FDX1VVDAN-fbf6c34bda

The private is message is coming

@aurelienfx
Copy link
Author

Content of the directory sent by slack

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 6, 2018

Ok the import task crash on your Remote Server.

You need to execute the following command on your remote server using 'centreon' user:

# su - centreon
$ /usr/share/centreon//bin/centreon -u admin -p <encrypt_password> -w -o CentreonWorker -a processQueue

<encrypt_password> is the encrypted password of the admin user in centreon.contact table (on database)

or use directly:

# su - centreon
$ /usr/share/centreon//bin/centreon -u admin -p <clear_password> -w -o CentreonWorker -a processQueue

Can you send put here the result?

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 6, 2018

Can you let me know if on the Remote Server you have the following files:

# ls /etc/centreon/*.conf
/etc/centreon/instCentCore.conf  /etc/centreon/instCentPlugins.conf  /etc/centreon/instCentWeb.conf

@aurelienfx
Copy link
Author

When I pass the command it answer : Invalid credentials
The credentials are correct, because I'm logged on graphical interface with this credentials.
And when I try
/usr/share/centreon//bin/centreon -u admin -p <clear_password> -a POLLERLIST

The result is ok

The 3 .conf are present on the /etc/centreon.

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 7, 2018

To select the encrypted password of admin user please execute this request:

# mysql -u root centreon -p -e "select contact_passwd from contact where contact_id = 1"

@aurelienfx
Copy link
Author

The result of :
/usr/share/centreon//bin/centreon -u admin -p <encrypt_password> -w -o CentreonWorker -a processQueue

on the remote server

https://slack-files.com/T08DULM43-FDXGQ9EJG-6bec43404f

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 7, 2018

@aurelienfx so if you check the centreon.task table on Remote Server, all task must be "complete"?
Do you have hosts and services configuration in 'centreon.host' and 'centreon.service' tables on Remote Server?

@aurelienfx
Copy link
Author

The content of the tables :
centreon.task : https://slack-files.com/T08DULM43-FDX76T5DX-dee5f9a2ec
centreon.host :https://slack-files.com/T08DULM43-FDXKZ5ZS8-0c27745238
centreon.service: https://slack-files.com/T08DULM43-FDY1GGW13-8a683b4e56

what do you mean by centreon.task must be complete ?

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 7, 2018

@aurelienfx I was expecting the content of the table not the description of the schema ;)

@aurelienfx
Copy link
Author

lpinsivy

This is the 3 tables on the zip : https://slack-files.com/T08DULM43-FDY084U8H-c17b9e46ba

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 8, 2018

  1. Delete followings files on your both servers:
  • /var/log/centreon/worker.log
  • /var/log/centreon/centcore.log
  1. Delete all entries in centreon.task on both servers:

mysql> use centreon;
mysql> DELETE FROM task;

  1. Enable debug mode of Centcore on both servers by editing /etc/sysconfig/centcore and change "error" to "debug" then go to "Administration > Parameters > Debug" and enable Centcore debug; then restart Centcore.

  2. Generate, test, move and export configuration of the Remote Server from Centreon central UI

  3. Put the following informations:

  • /var/log/centreon/centcore.log (both servers)
  • /var/log/centreon/worker.log (both servers)
  • content (zip file) of /usr/share/centreon/filesGeneration/export/<poller_id> (on central server)
  • content of centreon.task table (both servers)

@aurelienfx
Copy link
Author

This is the result of previous command :
https://slack-files.com/T08DULM43-FDYQ2B42E-c56206d29e

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 8, 2018

Thank you for the result.

Everything works perfectly on Centreon Central server.
The issue is on Remote Server, the task to import data failed during the import of configuration process (the task is in inprogress status.

Can you:

  • send me the /var/log/centreon/sql-error.log of the Remote Server
  • send me the files included in /etc/centreon directory (by MP because they contain your credentials information)

@aurelienfx
Copy link
Author

content sent by slack

@lpinsivy
Copy link
Contributor

lpinsivy commented Nov 8, 2018

After analysis, the data import process is stopped by the centcore process because the timeout has been reached.
By increasing the execution time in "Administration > Parameters > Centcore" and after restarting the Centcore process, the import is now complete.

The previous error message was:

2018-11-08 13:54:05 - cmd: /usr/share/centreon//bin/centreon -u admin -p xxxxxxxxxx -w -o CentreonWorker -a processQueue >> /var/log/centreon/worker.log
2018-11-08 13:54:10 - Receiving die: Timeout by signal ALARM

2018-11-08 13:54:10 - Dont die...
2018-11-08 13:54:10 - Receiving die: Timeout by signal ALARM

2018-11-08 13:54:10 - Dont die...
2018-11-08 13:54:10 - Timeout by signal ALARM

2018-11-08 13:54:10 - Killing child process [3926] ...
2018-11-08 13:54:10 - Killed
2018-11-08 13:54:10 - Result : 

Now the /var/log/centreon/worker.log file contains complete logs:

[2018:11:08 01:54:05] Checking for pending export tasks: None found
[2018:11:08 01:54:05] Checking for pending import tasks: #16 (parent ID #16)
[2018:11:08 01:54:05] Worker cycle completed.

@lpinsivy lpinsivy closed this as completed Nov 8, 2018
@lpinsivy lpinsivy added kind/question and removed area/remote-server status/more-info-needed Waiting for more information labels Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants