Versions Compared

Key

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

Principe

Les commandes sont des éléments de configuration permettant de décrire l'utilisation d'un plugin.

Elle précise ou trouver le plugin, comment l'utiliser avec les bons arguments et comment remplacer ces arguments par des données.

Afin d'avoir des commandes génériques, il convient d'utiliser Utilisation des Données en tant que Variable d'accès aux données.

Onglet générique

  • Command Name
    • Cette propriété est utilisée pour définir un nom court permettant d'identifier une commande.
  • Command
    • Cette propriété est utilisée pour définir la commande à lancer.
  • Command Running Timeout
    • Cette propriété est utilisée pour définir le temps maximum d'exécution d'une commande. Si paramétrée à -1, le temps maximum d'exécution d'une commande sera récupéré, dans l'ordre, par l'élément Check, par l'élément Hôte, ou par la valeur par défaut (shinken.cfg:check_running_timeout).
  • Enabled
    • Cette propriété est utilisée pour définir si la commande est activée ou non dans la configuration.
  • Pack
    • Cette propriété est utilisée pour définir dans quel Pack la commande appartient.

Onglet avancé

  • Poller Tag
    • Cette propriété est utilisée pour définir dans quels Pollers la commande devrait être exécutée.
  • Module type
    • Cette propriété est utilisée pour définir si cette commande devrait être exécutée par un module spécifique de vos pollers ou reactionners.
  • Run in a shell
    • Cette propriété est utilisée pour définir si la commande doit être exécutée dans un shell.
      • Vrai:
        La commande sera exécutée dans un shell (/bin/sh) et vous pourrez donc utiliser les fonctionnalités spéciales du shell comme | ; ou &&.

        Warning

        Si vos utilisateurs peuvent changer les paramètres de commandes, cela peut être un risque de sécurité qui résultera en une exécution shell d'une commande utilisateur.

      • Faux:
        La commande ne sera pas exécutée dans un shell et donc vous ne pourrez pas utiliser les fonctionnalités spéciales du shell comme | ; ou && mais votre sécurité sera augmentée car vous serez certain que les utilisateurs ne pourront pas exploiter vos commandes pour lancer une autre commande shell

...

Overview

...

Commands are configuration elements used to describe plugins usage.

It tells Shinken Enterprise where to find plugins, how to use it, what arguments are necessary, and how to substitute arguments by Data.

For example, check_ping is a plugin used to ping a host, and get informations about network connectivity with host :

...

Code Block
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%

Plugin help tells that to use the command, we need to pass, as argument the following :

  • -H : host address
  • -w : wrta,wpl (Warning Round Trip Average, Warning Packet Loss)
  • -c : crta, cpl (Critical Round Trip Average, Critical Packet Loss)

The corresponding commands should be :

 

Code Block
check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$

In this way, Shinken Enterprise will able to replace arguments by the corresponding value, depending of HOSTADDRESS and arguments given to command.

...

 Accessing Commands configuration

Commands Configuration can be accessed by the Main Menu "Commands".

...

When accessing the Commands Configuration Page, a Command Table is displayed, listing all Commands objects.

On the top of the table, A tool bar let Administrators the ability to :

  • Enable, Disable, Delete or Duplicate selected Commands
  • Filter list by Name

...

This table contains the following informations :

...

This page also provides, on the left, an action Menu, used to :

  • Add a new Command
  • Show Commands detected by Automatic Modules
  • Accept differences on selected elements

...

Create a new Command

To create a new Command, use the button "Add new [Command]" located in the Action Menu

...

Command creation form will be displayed.

This form is composed of tabs, corresponding to categories of properties :

  • Generic

  • Advanced

...

The left menu give to Administrators the ability to :

  • Validate the new Command
  • Cancel the action
  • Delete the Command

...

Generic

...

Generic properties contains the minimum properties requiered to create a Command :

  • Name
    • the name of the Command

    • this field is requiered

  • Command
    • the plugin configuration
    • the value is a text field, defining the plugin syntax (see example in Overview)

...

Advanced

...

Advanced properties are used to define Advanced features like :

  • Monitored from
    • the poller tag that the command should run on
  • Module Type
    • the poller module the command should run in the poller daemon

...

Modify a command

...

To modify properties of a command, first go on the Commands page, from the Main menu,

then click on the command name you want to modify.

...

Image Removed

 

...

The form displayed is the same as the form used to create a new Command.

All fields are filled with Command properties.

 

...

Once changes have been made, configuration of the Command must be saved by clicking the Validate button available on the left menu. Cancel button revert all changes to previous configuration.

...

Delete a command

...

From the Form page

First go to the Commands page, from the Main menu, then click on the command name you want to delete.

Once in the page displaying the form, click on the Delete button available on the left menu.

A confirmation popup will be displayed.

...

From the Main page

First go to the Commands page, from the Main menu, then click on the check box placed on the first column of the table.

Use the Action menu on the top to select Delete, and click to the Launch Button.

A confirmation popup will be displayed.

Using the Main page gives Administrators ability to Delete many Commands at once.

...

Duplicate a command

...

To duplicate a command, first go on the Main page listing all commands,

then select a comand by clicking on the check box placed on the first column.

...

Once selected, the command can be duplicated by selecting Duplicate in the select Action of the tool bar.

Duplication is executed by clicking the Launch button.

...

Using the Main page gives Administrators ability to Duplicate many Commands at once.

All properties are kept when duplicating operation, as well as data.

 

...

Duplicated commands are totally detached and independent of the cloned command.

...

      • .