
Avec la nouvelle version de Centreon-Web 2.8.14, il est possible de gérer les downtimes ou temps d'arrêt avec l'API Clapi.
1 Gestion des downtimes récurrents avec Clapi
Vous avez la possibilité d'ajouter un downtime récurent grâce à l'API Clapi. Cette fonctionnalité doit se faire en plusieurs étapes. Commençons par la création de l'objet.
centreon -u admin -p password -o DOWNTIME -a ADD -v "Downtime Server;Arrêt programmé Mercredi 15h30"

Affichage du downtime récurrent
Maintenant, nous allons définir la plage du temps d'arrêt : 2 h 00 tous les mercredis à partir de 15 h 30. Cet exemple est un cas d'école, bien sûr 😉.
centreon -u admin -p password -o DOWNTIME -a ADDWEEKLYPERIOD -v "Downtime Server;15:30;17:30;1;0;wednesday"

Affichage de la plage du temps d'arrêt
Il est possible d'utiliser d'autres options pour gérer cette plage horaire comme Addmonthlyperiod et Addspecificperiod. Maintenant, il nous reste à associer un objet de supervision au temps d'arrêt défini. Dans notre exemple, nous associerons le serveur nommé server.
centreon -u admin -p password -o DOWNTIME -a ADDHOST -v "Downtime Server;Server"

Affichage des relations
D'autres fonctions sont disponibles. On peut lister les temps d'arrêts récurrents :
centreon -u admin -p password -o DOWNTIME -a SHOW
id;name;description;activate
2;Downtime Server;Arrêt programmé Mercredi 15h30;1
On peut aussi lister la plage d'un temps récurrent :
centreon -u admin -p password -o DOWNTIME -a LISTPERIODS -v "Downtime Server"
position;start time;end time;fixed;duration;day of week;day of month;month cycle
1;15:30:00;17:30:00;1;;3;;all
Pour finir, pour supprimer un temps d'arrêt récurrent, on utilise cette commande.
centreon -u admin -p password -o DOWNTIME -a SHOW
id;name;description;activate
2;Downtime Server;Arrêt programmé Mercredi 15h30;1
2 Gestion des downtimes non-récurrent
Pour ajouter un temps d'arrêt à un hôte, utilisez cette commande clapi. Par exemple pour le serveur Central, nous initialisons un temps d'arrêt de 10 minutes.
centreon -u admin -p password -o RTDOWNTIME -a add -v "HOST;Central;2017/10/04 16:00;2017/10/04 16:10;1;3600;1;my comments"
Vous pouvez visualiser les temps d'arrêts dans l'IHM.

Pour visualiser les temps d'arrêts actifs dans la vue temps réel, nous utiliserons les commandes suivantes respectivement pour les hôtes et les services.
centreon -u admin -p password -o RTDOWNTIME -a SHOW -v "HOST"
host_name;author;actual_start_time;actual_end_time;start_time;end_time;comment_data;duration;fixed;url
Central;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
centreon -u admin -p password -o RTDOWNTIME -a SHOW -v "SVC"
host_name;service_name;author;actual_start_time;actual_end_time;start_time;end_time;comment_data;duration;fixed;url
Central;Broker-Retention;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Connection-Time;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Connections-Number;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Cpu;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Database-Size;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Load;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Memory;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Myisam-Keycache;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Open-Files;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Partitioning;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Ping;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-broker-rrd;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-broker-sql;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-centcore;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-centengine;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-crond;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-httpd;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-ntpd;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;proc-sshd;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Queries;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Slowqueries;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
Central;Swap;admin;2017/10/04 16:00;N/A;2017/10/04 16:00;2017/10/04 16:10;'my comments';600;1;
On peut aussi appliquer un temps d'arrêt à toute une instance d'un poller comme ceci :
centreon -u admin -p password -o RTDOWNTIME -a add -v "INSTANCE;Central;2017/09/24 17:00;2017/09/24 19:00;1;3600;1;temps d'arrêt sur le Central"