Skip to main content

Hi,

I’ve updated my Centreon HA servers from 23.04 to 24.04, but since then I have 2 problems :

- I can't reload the configuration from the Pollers > Export configuration menu.
With the help of this topic: upgrade 22.04 to 22.10 : many php mwarning with php-pecl-gnupg


I get this error:

I found this message in the log file /var/log/centreon/centreon-web.log

d2024-07-09T12:11:31+0200] 0ERROR] RCentreon\Application\Controller\Configuration\MonitoringServerController:229]: Generation error on monitoring server #6: Authentication token expired

I haven't found anyone with the same problem and don't know where to look to fix this token problem.

 

- cron jobs managed with gorgone no longer run since the update
I received alerts for partition tables that were out of date and checked the logs.
 > I've had errors with the autodiscovery module, which we don't use, so I've disabled it by renaming the yaml configuration files to .disabled.

2024-07-09 17:31:55 - ERROR - Oautodiscovery] -class- host discovery - cannot get platform versions - configuration missing


> During the update, the /etc/centreon-gorgone/config.d/31-centreon-api.yaml file was renamed to 31-centreon-api.yaml.rpmsave and a new centreon-api.yaml.new file appeared.
I compared these two files, which are identical except for the password defined for the centreon-gorgone user in the old file. So I renamed 31-centreon-api.yaml.rpmsave to 31-centreon-api.yaml as before the update and restarted the gorgone service.


But I can't figure out why the cron jobs aren't running.

English is not my native language, so sorry if this is not understandable. I'll rewrite if necessary.

Thanks for your help

 

Hi,

After disabling autodiscovery, the logs are cleaner.
I was able to find a new error for cron job problems.

Use of uninitialized value $1 in lc at /usr/share/perl5/vendor_perl/gorgone/modules/core/cron/class.pm line 400.

 

Best regards,


Hi,

Does anyone have a clue to the problems encountered?

regards,


Hi,

Does anyone have a clue to the problems encountered?

regards,

Hello, got the same error here.
All LDAP account can’t export configuration, but the local admin account can.
I searched everywhere and i got no clue either.
It append somewhere between 23.10.12
Regards


Hello,

I still have the problem.
Nobody can help me ?
I have to run cron jobs manually every week …

Regards


Hello,

For Gorgone and the crons jobs, this is a whitelist issue. The fix is ready but not yet released for some reason.

You can manually apply the fix on both nodes by:

  • Adding a YAML file in the /etc/centreon-gorgone/config.d/whitelist.conf.d/ folder with the content:
- ^/usr/bin/php (-q )?/usr/share/centreon/cron/[\w,\s.-]+ >> /var/log/centreon-gorgone/[\w,\s.-]+\s+2>&1$
- ^/usr/bin/php -q /usr/share/centreon/www/modules/centreon-bi-server/tools/purgeArchivesFiles\.php >> /var/log/centreon-gorgone/centreon-bi-archive-retention\.log 2>&1$
- ^/usr/share/centreon/cron/eventReportBuilder --config=/etc/centreon/conf\.pm >> /var/log/centreon-gorgone/eventReportBuilder\.log 2>&1$
- ^/usr/share/centreon/cron/dashboardBuilder --config=/etc/centreon/conf\.pm >> /var/log/centreon-gorgone/dashboardBuilder\.log 2>&1$
- ^/usr/share/centreon/www/modules/centreon-dsm/+cron/centreon_dsm_purge\.pl --config=\"/etc/centreon/conf.pm\" --severity=\S+ >> /var/log/centreon-gorgone/centreon_dsm_purge\.log 2>&1\s*$
- ^/usr/share/centreon-bi-backup/centreon-bi-backup-web\.sh >> /var/log/centreon-gorgone/centreon-bi-backup-web\.log 2>&1$
- ^/usr/share/centreon/www/modules/centreon-autodiscovery-server/+cron/centreon_autodisco.pl --config='/etc/centreon/conf.pm' --config-extra='/etc/centreon/centreon_autodisco.pm' --severity=\S+ >> /var/log/centreon-gorgone/centreon_service_discovery.log 2>&1$
  • Making sure Gorgone can read that file: chown centreon-gorgone: etc/centreon-gorgone/config.d/whitelist.conf.d/<the new file>

For the token error message, you probably have expired tokens that were not removed.

You can find and remove them in the database:

MariaDB [centreon]> SELECT id,token, FROM_UNIXTIME(expiration_date) FROM security_token;
+-------+------------------------------------------------------------------+--------------------------------+
| id | token | FROM_UNIXTIME(expiration_date) |
+-------+------------------------------------------------------------------+--------------------------------+
| 34206 | xg1qXt1CgpljlWB0fpfMSogWOs00e14E56DRhV74arK4HDohZXbGa2sY9vNbQjEm | 2024-08-05 14:25:41 |
| 34228 | m748cguehibd71vdcr9tpvsurr | 2024-08-14 12:39:02 |
| 34229 | bcv7nohorjg5kf008np2nith1c | 2024-08-14 11:18:29 |
+-------+------------------------------------------------------------------+--------------------------------+
3 rows in set (0,001 sec)

MariaDB [centreon]> DELETE FROM security_token WHERE id = 34206;
Query OK, 1 row affected (0,002 sec)

 


Hi @itoussies ,

 

Thank you for your reply.

I've created the whitelist file, I'll see next week if the correction works (tomorrow is a public holiday in France and I'm not working this Friday).


As for the token, you're right. The tokens haven't been purged since the update. Is this linked to the cron problem?

After deletion, export works.

 


I forgot to mention this, you may need to restart Gorgone for the whitelist issue.
As for the token, this is not linked to that issue.


Hi, got the token issue too, last week i purged the token, today same problem..
And when I check in bdd i got +-----+----------------------------+--------------------------------+
| id  | token                      | FROM_UNIXTIME(expiration_date) |
+-----+----------------------------+--------------------------------+
| 602 | lh6itt2qehacinpibon5s4gg88 | 2024-08-14 14:07:12            |
| 603 | kkrbgb0sf2jsf7dpna0o0s9e8m | 2024-08-17 12:08:31            |
| 604 | 48olf6fgo3qg11du72b1107dml | 2024-08-18 20:53:47            |
| 605 | 642ijv0upejjdqpo8n4le1qtah | 2024-08-19 13:11:59            |
| 606 | nt949es349omngf9gqj3i9o6g3 | 2024-08-19 13:03:54            |
| 607 | epi32777d9nm23fu6g1tenqv18 | 2024-08-19 11:15:18            |
+-----+----------------------------+--------------------------------+
6 rows in set (0,001 sec)

Any idea to prevente that ?


Hi,

I checked the cron, the problem is solved.

For the token, as for jdziadek, the problem came back.

 

Any idea how to fix the problem ?

 


Hello,
Unfortunately there is no fix at the moment. Using Centreon with a private windows is a temporary solution until the fix is released.


 Hello,

Just a correction, the Gorgone HA fix was in fact released in June https://docs.centreon.com/fr/docs/releases/centreon-os/#24041-2 but there’s still something missing for the token issue (even for some normal Centreon platforms).

 

Until the official fix:

  • For Centreon (no HA), make sure the log file /var/log/centreon/centreon-tokens.log UNIX rights are -rwxr-xr-x / 755 OR in /etc/cron.d/centreon replace the outdated token scheduled cron by
    0 * * * * root /usr/bin/php -q /usr/share/centreon/cron/outdated-token-removal.php >> /var/log/centreon/centreon-tokens.log 2>&1

     

  • For Centreon HA: Add this entry to /etc/centreon-gorgone/config.d/cron.d/10-centreon-ha.yaml:
    - id: outdated_token_removal
    timespec: "0 * * * *"
    action: COMMAND
    parameters:
    - command: "/usr/bin/php -q /usr/share/centreon/cron/outdated-token-removal.php >> /var/log/centreon-gorgone/centreon-tokens.log 2>&1"
    timeout: 120
    keep_token: true

 


Reply