Solved

How poller reloading works following an API command ?

  • 9 March 2022
  • 1 reply
  • 357 views

Badge +5

Hi,

I Try to understand how work the reaload of a poller when i add an host from the API.

Because my poller does not reload when i do it. There is a command ? Thanks.

icon

Best answer by Kriko 10 March 2022, 08:21

View original

1 reply

Userlevel 5
Badge +16

Hello @ArnaudM 

By default, when you add a object in Centreon (by API or not), you still need to perform by yourself the export of the poller.
There is no auto triggers.

 

But even if it’s not listed on the documentation of our API, you can the CLAPI command trought the API v1 to perform the reload of a poller after adding an host:
 

curl -X POST 'http://10.25.9.99/centreon/api/index.php?action=action&object=centreon_clapi' -H "centreon-auth-token: lZIRfH+f8YhFSyguBSbliBmZ4EjBn+vRflbwSetIniMhrDu8bs43eVEz+yIS90H0" -H "Content-Type: application/json" --data '{ "action": "APPLYCFG", "values" : "1"}'

{"result":["Configuration files generated for poller '1'","Warning: Centreon Poller 1 can restart but configuration is not optimal ...

 

Reply