Skip to main content

Hello,
I was trying to import check commands using clapi. Failed with output:

PHP Warning:  Undefined array key 91 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

Did you have any expirience with this?

Got exactly the same problem with version 24.04.2, I would like to import the config from an old version in a brand new Centreon Server but I got this message from the command-line…

Tried with the GUI import-export but this stays like running for hours and nothing happens…

Don’like GUI because of that…

Command-line should be much more useful to show what’s wrong...


Hello

I also had this problem when importing txt file with CLAPI on 24.04 from 21.04.
I fact I have several Powershell scripts which parse the old config and extract Hosts and Services only (encoding to UTF8).

When I put them in a folder on the new Centreon server and import them with:
/usr/share/centreon/bin/centreon -u admin -p password -i /tmp/export.txt
I got the error.

I try several thing to finaly go with a dos2unix /tmp/export.txt before restarting the import and the imprt was ok.

Pierre


Hello, 

Did you find a solution to this issue ? I have the same and I can’t find any solution. 

 

Thank you


Hi folks,

Sorry not being very helpful with the problems you’re experiencing but I wish to also report that CLAPI (ie: The PHP script /usr/share/centreon/bin/centreon), which is, AFAIK, the first and still not officially deprecated API, suffers from numerous very annoying problems, both long lasting ones and, more recently, new introduced ones (!). I had also a few time ago the example of a only partially fixed bug which clearly demonstrated the lack of test before patch releases.
It makes no doubt Centreon has neglected this, although central, part of the software. And this is really sad.
I don’t have any doubt also of the need and advantages of a modern REST HTTP API (state-of-the-art designed, ACL aware, etc…), but I can’t be satisfied if such work-in-progress enhancement is made at the expense of the maintaining of legacy (and “native”) API.
I don’t think a lot of historic users nor customers can be.


Reply