Git Product home page Git Product logo

centctl's Introduction

CENTREON CTL

Presentation

Centctl is a CLI which allows to manage Centreon servers. Centctl use a file named config.yaml for manage the connection at differents servers.
Developped in Go, it allows to operate a Centreon platform remotely from a PC under Windows, Linux or Macos without any particular installation.

Config File

Create a file called config.yaml in the root of the project
For declare a server use the configuration below by replacing capitalized words

  • NAMESERVER it's the name of the server that you will use in the flag --server. WARNING : The name of the server must be unique
  • URL it's the url at use for access to your centreon server. Its format is https://monserveurcentreon.fr/centreon and you replace monserveurcentreon.fr by the server. WARNING : remember to put http if your url is not a secure url
  • LOGIN it's the login that you use for the connection at the server
  • PASSWORD it's the password that you use for the connection at the server
servers:
   - server: "NAMESERVER"
     url: "URL" 
     login: "LOGIN"
     password: "PASSWORD"
   - server: "NAMESERVER2"
     url: "URL" 
     login: "LOGIN"
     password: "PASSWORD"

CSV File

Create a file with the extension .csv in the root of the project
You can create contact, host and service. The first column is to specified the object. The syntax is :

contact,full name,login,email,password,admin
host,name,alias,IPaddress,templateHost,pollerName,hostGroup
service,hostName,description,templateService

The following table shows you an example for each case:

Example Syntaxe in the CSV
A service service,HostTest,ServiceDescription,TemplateService
A host with hostGroup host,HostTest,HostTest,127.0.0.1,TemplateHost,Central,group_test
A host without hostGroup host,HostTest2,HostTest2,127.0.0.1,TemplateHost,Central,
A contact with option admin contact,Pierre Allain,pierre,[email protected],pierrepassword,admin
A contact without option admin contact,Paul Allain,paul,[email protected],paulpassword,

WARNING : when a host has not host group and when a contact is not admin, think to put the comma in the end of line. You can write comments in your csv file using a # at the beginning of the line. Example: #It's a comment and this line is not analysed by the program
For export the CSV file use the command next : centctl export -f nameFile.csv --server nameServer
When exporting all objects is complete, the nameFile.csv is deleted and a file named donenameFile.csv is created and contains all object created. Otherwise, an error which specifie the problem appear in the terminal.

Enabling shell autocompletion

Install bash-completion

You can install it with apt-get install bash-completion

The above commands create /usr/share/bash-completion/bash_completion, which is the main script of bash-completion. Depending on your package manager, you have to manually source this file in your ~/.bashrc file.

To find out, reload your shell with command source ~/.bashrc and run type _init_completion. If the command succeeds, you’re already set, otherwise add the following to your ~/.bashrc file:

source /usr/share/bash-completion/bash_completion

Reload your shell and verify that bash-completion is correctly installed by typing type _init_completion

Enable centctl autocompletion

Add the completion script to the /etc/bash_completion.d directory:

centctl completion >/etc/bash_completion.d/centctl

After reloading your shell, centctl autocompletion should be working.

Note : Centreon, the Centreon Logo, are trademarks, servicemarks, registered trademarks or registered servicemarks owned by Centreon Software. All other trademarks, servicemarks, registered trademarks, and registered servicemarks are the property of their respective owner(s). CentCtl is not endorsed nore supported by Centreon Software and use only external API based on Centreon Plateform.

centctl's People

Contributors

ypilpre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.