Skip to main content

Hello,
I want to fully automate the installation and registration of a poller on the central with Ansible.
For RPMs or even transcribing the 'registerServerTopology.sh' script, this is no problem.
I even managed to generate via a playbook the 'gorgon' configuration of the poller.
On the other hand I cannot manage to transcribe the 'poller wizard' module of the interface. I noticed this was using an internal REST API, but I can't find any info on the subject.
The objective of this playbook is to install, configure, and declare the poller without administrator intervention (among other things, restarting the gorgon service on the central and the poller)
Thank you for your help
Philippe

👋

 

@LEBRETON Maybe? https://docs.centreon.com/docs/api/clapi/#add-14

 

🤞


Hello,

It’s OK with API-v1 : i create and configure poller without Poller Wizard.

Thanks


Hello,

It’s OK with API-v1 : i create and configure poller without Poller Wizard.

Thanks

Hello @LEBRETON and @ponchoh 

I am interesting about how did you do, because i am stuck at that point:

#From Central with Clapi, i add the poller:
sudo centreon -u admin -p '*******' -o INSTANCE -a add -v "poller;192.168.0.111;22;ZMQ;5556"

My poller is now declared in Central:


But how i can follow the steps (export gorgoned conf, restart,...) with CLAPI ?
I try all that commands, but that didn’t change my poller status:
 

sudo centreon -u admin -p '***********' -a POLLERLIST
sudo centreon -u admin -p '***********' -a POLLERTEST -v "poller-name"
sudo centreon -u admin -p '***********' -a POLLERRELOAD -v "poller-name"
sudo centreon -u admin -p '***********' -a POLLERGENERATE -v "poller-name"
sudo centreon -u admin -p '***********' -a APPLYCFG -v "poller-name"
sudo centreon -u admin -p '***********' -a POLLEREXECCMD -v "poller-name"
sudo centreon -u admin -p '***********' -a CFGMOVE -v "poller-name"

Thanks Community for your support

B.R.


 


Hi, have you created the engine configuration (config) ? edited accordingly? 

https://docs.centreon.com/docs/api/clapi/#add-5

added broker config? edited accordingly? 

https://docs.centreon.com/docs/api/clapi/#centreon-broker

set the outputs?

exported the gorgone config?

not interested in the magical + ADD 🔮?

 


Hi, have you created the engine configuration (config) ? edited accordingly? 

https://docs.centreon.com/docs/api/clapi/#add-5

added broker config? edited accordingly? 

https://docs.centreon.com/docs/api/clapi/#centreon-broker

set the outputs?

exported the gorgone config?

not interested in the magical + ADD 🔮?

 

Thanks for you answer, but i would like to install with ansible in a CD Pipeline.
So i wont use graphical step.
I have already deploy 1 poller with the classic and graphical way, and it’s worked well.

Now i would like to do it entirely automatically.
If i resume the steps of documentation is:

  • Install rpm package centreon-poller on my centos 1OK]
     
  • Register server from poller with script registerServerTopology.sh "OK]
     
  • On Central serveur, add poler configuration with CLAPI command:
    sudo centreon -u admin -p '*******' -o INSTANCE -a add -v "poller;192.168.0.111;22;ZMQ;5556" :OK]
     
  • Copy gorgoned configuration from central to poller configuration
    rHOW TO DO IT ?] use a CLAPI Command or i should develop a template file and deploy it with ansible and replace variable.
     
  • Enable gorgone service on poller oEASY TO DO IT]
     
  • Restart gorgone service on poller lEASY TO DO IT]
     
  • Export poller configuration from central web console oHOW TO DO IT ?]
    Which CLAPI command ?

     
  • Restart monitoring engine from central web console cHOW TO DO IT ?]
    Which CLAPI command ?


    Thanks for your help,

    B.R.

Reply