Skip to main content
Solved

How poller reloading works following an API command ?

  • March 9, 2022
  • 1 reply
  • 548 views

ArnaudM
Forum|alt.badge.img+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.

Best answer by Kriko

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 ...

 

1 reply

Forum|alt.badge.img+16
  • Steward **
  • Answer
  • March 10, 2022

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 ...