Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create daemons on a Shinken server

This tool is used to create (via .ini file creation) or define/declare (via creation of .cfg files) additional Shinken daemons.

More informations about the start process of Shinken daemons (with .ini and .cfg files) are presented on this page: Daemons.

This tool does not create the daemons remotely, but only acts locally on the server. You have to be on the correct server before executing these commands.

Most of the time, you will have to execute this command twice: on the Arbiter server to create the .cfg files and on the server hosting the daemon to create the .ini file.

Usage

Créer des démons sur un serveur Shinken

Cet outil est utilisé pour créer (via la création de fichiers de type "ini") ou définir/déclarer (via la création de fichiers de type "cfg") des démons Shinken additionnels.

Plus d'informations sur le démarrage de Shinken en utilisant les fichiers "ini" et "cfg" sont réunis sur cette page de documentation : Démons.

Cet outil ne permet pas la création à distance, mais agit uniquement sur le serveur en local. Il s'agira donc de se placer correctement sur le serveur avant d'utiliser les commandes.

Dans la plupart du temps, pour créer un nouveau démon, il vous faudra lancer les commandes pour 1 créer le fichier ini, et 2, le fichier cfg.

Utilisation

L'option -h de la commande permet d'afficher l'aide de la commande :

The -h option displays the help of the command, detailing the other options available:

Code Block
$ shinken-daemons-create -h
Usage
=====
  shinken-daemons-create

This tool is used to create daemons on servers (local ini file) or declare the daemon in your arbiter configuration (cfg file)

Options
=======
--version               show program's version number and exit
--help, -h              show this help message and exit
--type=DAEMON_TYPE, -t DAEMON_TYPE
                        Daemon type to create or declare. Allowed daemon types are: broker, poller, reactionner, receiver, scheduler
--port=PORT, -p PORT    Daemon port
--ini                   Creates the daemon locally on the server (will create the .ini configuration file)
--cfg                   Declares the daemon in your arbiter configuration (will create the .cfg configuration file). Must be launched only from your arbiter server.
--address=ADDRESS       For cfg, set the address for this daemon (Mandatory). For ini, address the daemon will listen to on that local server (will listen to all interfaces by default)
--name=NAME             Name of this daemon


Options :

NomDescription
--version
Displays version

Montre le numéro de version et sortie.

-h, --help
Displays help message

Montre l'aide et sortie.

--type=DAEMON_TYPE, -t DAEMON_TYPE

Type de démon à créer ou déclarer. Peut êtreof daemon to create. Can be one of: broker, poller, reactionner, receiver, scheduler

--port=PORT, -p PORT

Port du démonDaemon's port

--ini

Créé le démon localement sur le serveur (créera le fichier de configuration .iniCreates the server locally (create .ini file on the server)

--cfg

Déclare le démon dans la configuration de votre Arbiter (créera le fichier de configuration .cfg). Doit être lancé seulement depuis un serveur arbiterDeclares the daemons in the Arbiter configuration (creates .cfg file). Must be launched only on the Arbiter server.

--address=ADDRESS

(Required) When using --cfg, choose the address of the daemon.

(Optional) When using --ini, defines on which interface the daemon will listen (listens on all interfaces by defaultPour les cfg, définir l'adresse de ce démon (Obligatoire). Pour les ini, adresse sur lequel le démon va écouter sur ce serveur local (écoutera sur toutes les interfaces par défaut).

--name=NAME

Nom du démon

Daemon's name


Examples Exemples :

Code Block
Examples:
# Step1 [on the scheduler server]: Create the scheduler ini file so the server can start it:
  shinken-daemons-create --ini --type=scheduler --port=8768 --name=scheduler-customer-A

# Step2 [on the arbiter server]: Create the scheduler in the arbiter configuration:
  shinken-daemons-create --cfg --type=scheduler --port=8768 --name=scheduler-customer-A --address=192.168.0.100


INI

Par exemple, créons un nouveau démon Poller sur un serveur, en local Create a new Poller daemon locally on the server:

Code Block
$ shinken-daemons-create --ini --type=poller --port=8771 --name=poller-2
 poller [id:1]   : CREATED  in the file /etc/shinken/daemons/pollerd-1.ini

Ici le nouveau Poller s'est vu assigné l'ID numéro 1 et le fichier Once the new Poller created, it has been assigned an ID (1) et the /etc/shinken/daemons/pollerd-1.ini a été crééhas been created.

Une fois créé, démarrez votre démon Poller via la commande Once created, start the Poller with the following command:

Code Block
service shinken-poller --id 1 start


CFG

Une fois le fichier ini créé et le démon démarré sur le serveur (dont l'ip est 192.168.0.15 dans cet exemple), il faut maintenant déclarer ce démon depuis votre serveur Arbiter :Once the .ini file created and the daemon started, the daemon must be declared in the Arbiter configuration.

Code Block
$ shinken-daemons-create --cfg --type=poller --port=9771 --name=poller-2 --address=192.168.0.15
 poller [name:poller-2] [address:192.168.0.15] [port:9771]: CREATED  in the file /etc/shinken/pollers/poller-2.cfg

Le fichier The configuration file /etc/shinken/pollers/poller-2.cfg a été créé. has been created.

The Arbiter daemon must then be restarted to take the daemon declaration into account into the configuration.Il vous faudra à présent redémarrer votre serveur Arbiter afin que ce dernier prenne en compte cette nouvelle déclaration de démon:

Code Block
service shinken-arbiter restart

Supprimer des démons sur un serveur Shinken

Cet outil est utilisé pour Supprimer (via la suppression de fichiers de type "ini") des démons Shinken.

Cet outil ne permet pas la suppression à distance, mais agit uniquement sur le serveur en local. Il s'agira donc de se placer correctement sur le serveur sur lequel on souhaite supprimer le démon avant d'utiliser les commandes.


Delete daemons on a Shinken server

This tool is used to delete (deletion of .ini files) Shinken daemons.

This tool does not delete the daemons remotely, but only acts locally on the server. You have to be on the correct server before executing these commands.

Usage

Utilisation

L'option -h de la commande permet d'afficher l'aide de la commande :

Code Block
$ shinken-daemons-remove -h
Usage
=====
  shinken-daemons-remove

This tool is used to remove daemons on the local server

Options
=======
--version               show program's version number and exit
--help, -h              show this help message and exit
--ini                   [Mandatory] Remove daemon locally on the server.
--type=DAEMON_TYPE, -t DAEMON_TYPE
                        Daemon type to remove. Must be in: broker, poller, reactionner, receiver, scheduler
--id=DAEMON_ID          ID of the daemon to remove. They can be listed with the command: shinken-daemons-list.


Options :

NomDescription
--version

Montre le numéro de version et sortie.Displays version number

-h, --help

Montre l'aide et sortie.Displays help message

--ini

(Obligatoire) Supprime le démon localement sur le serveurRequired) Deletes .ini file locally from the server

--type=DAEMON_TYPE, -t DAEMON_TYPE

Type de démon à supprimer. Peut êtreof daemon to delete. Can be one of: broker, poller, reactionner, receiver, scheduler

--id=DAEMON_ID

ID du démon à supprimer. Ils peuvent être affichés avec la commande: of the daemon to delete. The IDs can be found with the shinken-daemons-list command.


Exemples Examples :

Code Block
Examples:
# Step1 [on the scheduler server]: first list all daemons on the server:
  shinken-daemons-list
# Step2 [on the scheduler server]: then remove the scheduler with the id 2:
  shinken-daemons-remove --ini --type=scheduler --id=2


INI

Par exemple, supprimons le démon Poller ayant pour id le numéro 2 sur le serveur en local :Remove the Poller daemon locally with the ID 2.

Code Block
$ shinken-daemons-remove --ini --type=poller --id=2
 poller [id:2] is  REMOVED from local server