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

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:

$ 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


-h, --help
Displays help message


--type=DAEMON_TYPE, -t DAEMON_TYPE

Type of daemon to create. Can be one of: broker, poller, reactionner, receiver, scheduler

--port=PORT, -p PORT

Daemon's port

--ini

Creates the server locally (create .ini file on the server)

--cfg

Declares 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 default).

--name=NAME

Daemon's name


Examples :

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

Create a new Poller daemon locally on the server:

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

Once the new Poller created, it has been assigned an ID (1) et the /etc/shinken/daemons/pollerd-1.ini has been created.

Once created, start the Poller with the following command:

service shinken-poller --id 1 start


CFG

Once the .ini file created and the daemon started, the daemon must be declared in the Arbiter configuration.

$ 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

The configuration file /etc/shinken/pollers/poller-2.cfg has been created.

The Arbiter daemon must then be restarted to take the daemon declaration into account into the configuration.

service shinken-arbiter restart


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

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

$ 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

Displays version number

-h, --help

Displays help message

--ini

(Required) Deletes .ini file locally from the server

--type=DAEMON_TYPE, -t DAEMON_TYPE

Type of daemon to delete. Can be one of: broker, poller, reactionner, receiver, scheduler

--id=DAEMON_ID

ID of the daemon to delete. The IDs can be found with the shinken-daemons-list command.


Examples :

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

Remove the Poller daemon locally with the ID 2.

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