"User is blocked" error message on Centreon login page

  • 2 November 2022
  • 0 replies
  • 4280 views

Userlevel 4
Badge +6

Symptoms

 

Authentication to Centreon fails in the following cases:

  • After a fresh installation or an update, the following error message occurs during the authentication process: “User is blocked”.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • This message appears after a mistake in the configuration in MAP or Autodiscovery:
    [API] [127.0.0.1] Authentication failed for 'admin'

 

  • In the /var/log/centreon/login.log file, you meet many errors as follows:
    [WEB] [127.0.0.1] Authentication failed for 'admin'

 

  • This error occurs in the MAP diagnostic:
    [ERROR] Could not authenticate using admin (error 500)

 

Problem

 

There is no specific user defined for Autodiscovery and MAP. As recommended, you need to use specific users for those modules.

For example, the user for Autodiscovery could be autodisco and the user for MAP could be admin_map.

 

Solution

 

Given that the blocked account is Admin.

Step 1: Unblock the Admin user

 

Before version 22.04

  1. Enter this command:
    mysql -uroot centreon
  2. Retrieve the id corresponding to the user blocked:
    select contact_name,contact_id from contact\G
  3. Enter the following command to change your password, where pwd is the password you want and id is the id previously retrieved:
    UPDATE contact SET contact_passwd = md5('$pwd') WHERE contact_id= $id;

From version 22.04

Go to http://phptester.net/

  1. Edit the following script with the password you want (centreon in the example below) and paste it in the phptester site:
    <?php
    echo password_hash('centreon', PASSWORD_BCRYPT);
  2. Click on Click to test your php code.
  3. Copy the password (see example in the screenshot above) and paste it in the following command, where here is the password to paste and contact_id is the blocked user id. Then run the query:
    INSERT INTO contact_password (password, contact_id, creation_date) VALUES ('here', <contact_id>, (SELECT UNIX_TIMESTAMP(NOW())));

 

Step 2: Change the MAP configuration

 

  1. Make sure the account in the /etc/centreon-studio/studio-config.properties file is not the default Admin account used to administrate Centreon. If so, edit the file.
  2. If you have edited the file, enter this command to apply the change:
    systemctl restart centreon-map

 

Step 3: Change the Autodiscovery configuration

  1. Make sure the account in the /etc/centreon-gorgone/config.d/31-centreon-api.yaml file is not the default Admin account used to administrate Centreon. If so, edit the file.
  2. If you have edited the file, enter this command to apply the change:
    systemctl restart gorgoned

 

Step 4: Unblock the Admin user in the database

 

Enter the following commands:

mysql -uroot

update centreon.contact set login_attempts=NULL, blocking_time=NULL;

 

Still stuck?

 

If you are still stuck for MAP, follow this procedure:

  1. Edit /etc/centreon-studio/studio-config.properties, and change broker.tls to "true" as follows:
    broker.tls=true
  2. Then edit the first line in /etc/centreon-studio/centreon-map.conf, as follows:
    RUN_ARGS="--spring.profiles.active=prod,tls_broker"
  3. Enter this command to apply the change:
    systemctl restart centreon-map systemctl restart cbd

See also

 


0 replies

Be the first to reply!

Reply