Announcement

Collapse
No announcement yet.

Cannot do export for Service template or for services

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot do export for Service template or for services

    Hi,

    I use Centreon 2.8.16 on centos.

    I can export via command line all objects 8Hosts, CMD, Timeperiods .... etc) : except "Services" and "Service Templates":

    EX:
    /usr/bin/centreon -u admin -p $PASSWD -o service -a export
    Unknown object : STPL


    EX:
    /usr/bin/centreon -u admin -p $PASSWD -o STPL -a export
    STPL;ADD;generic-service;generic-service;
    Unknown object : TP



    Please note that I can do "-a show" on Services and "Services template".

    When I run the debug mode I get :

    /usr/bin/centreon -vv -u admin -p $PASSWD -o STPL -a export
    PHP Warning: Illegal string offset 'service_register' in /usr/share/centreon/www/class/centreon-clapi/centreonServiceTemplate.class.php on line 919
    PHP Warning: Invalid argument supplied for foreach() in /usr/share/centreon/lib/Centreon/Object/Object.php on line 277
    PHP Warning: Illegal string offset 'service_id' in /usr/share/centreon/www/class/centreon-clapi/centreonServiceTemplate.class.php on line 932
    PHP Warning: Illegal string offset 'service_id' in /usr/share/centreon/www/class/centreon-clapi/centreonServiceTemplate.class.php on line 936
    Unknown object : STPL


    Any idea ?

    Thanks a lot

  • #2
    Hello,

    The syntax is not correct /usr/bin/centreon -u admin -p $PASSWD -o service -a export

    see the documentation https://documentation.centreon.com/d...rt_export.html

    there's an example,I adapted it

    Code:
    /usr/bin/centreon -u admin -p centreon -o STPL -a show | awk -F\; 'NR > 2 { print "--select=\"STPL;" $2 "\"" }' | xargs --verbose php /usr/bin/centreon -u admin -p centreon -e
    Visiter mon site perso http://eric.coquard.free.fr/atelier/

    Comment

    Working...
    X