Skip to main content

Hello all,

I desesperately try to migrate an old Centreon to the present version 24.04.4-1, I used the way described in the help pages, but that didn’t work, I now try to use clapi and export part of the centreon config, because the full one is so enormous that it cannot be exported as one only file…
But when I try to import on the new Centreon 24.04.4-1, I always get this message…

PHP Warning:  Undefined array key 475 in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 981
PHP Warning:  Trying to access array offset on value of type null in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 981
PHP Fatal error:  Uncaught Error: Class "\CentreonClapi\centreon" not found in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php:983
Stack trace:
#0 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(848): CentreonClapi\CentreonAPI->iniObject()
#1 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(819): CentreonClapi\CentreonAPI->launchActionForImport()
#2 /usr/share/centreon/bin/centreon(196): CentreonClapi\CentreonAPI->import()
#3 {main}
  thrown in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 983

Is centreon-clapi no longer able to import older exports ?

How could I solve that ?

Hello,

Unfortunately, old versions of CLAPI can sometimes skip important values needed by the newer version of CLAPI.

Do you have the line of the CLAPI import that is causing the issue?


# centreon -u <user> -p <password> -i /tmp/services.txt

Was the command that generated the output written in my initial post… (user and password have been removed here, of course)
 


Hello,

Is there any messages before this line? If not, you should try to redo the import, you will have a lot of line  with “object already exists” but you should be able to detect what line is causing the issue. 
The output will look like:

Line X: Object already exists
<PHP ERROR MESSAGE>

The error is most likely caused by the line X+1.


The only message I get is:

PHP Warning:  Undefined array key 475 in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 981
PHP Warning:  Trying to access array offset on value of type null in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 981
PHP Fatal error:  Uncaught Error: Class "\CentreonClapi\centreon" not found in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php:983
Stack trace:
#0 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(848): CentreonClapi\CentreonAPI->iniObject()
#1 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(819): CentreonClapi\CentreonAPI->launchActionForImport()
#2 /usr/share/centreon/bin/centreon(196): CentreonClapi\CentreonAPI->import()
#3 {main}
  thrown in /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php on line 983


No “Line X: Object already exists” message at all...


Reply