From 74754f628114e7bcca6d9ab76ad8447f30d3e9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20MOHIER?= Date: Thu, 10 Dec 2015 14:47:36 +0100 Subject: [PATCH] Default command is restart and not reload ... --- front/restartshinken.form.php | 2 +- inc/message.class.php | 1 - inc/shinkenwebservice.class.php | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/front/restartshinken.form.php b/front/restartshinken.form.php index 72950b5d..6bf69d80 100644 --- a/front/restartshinken.form.php +++ b/front/restartshinken.form.php @@ -47,7 +47,7 @@ $pmShinkenwebservice = new PluginMonitoringShinkenwebservice(); if (isset($_GET["tag"])) { Toolbox::logInFile("pm-restart", "call sendRestartArbiter, tag: " . $_GET["tag"] . "\n"); - $pmShinkenwebservice->sendRestartArbiter(1, $_GET["tag"], isset($_GET["action"]) ? $_GET["action"] : 'reload'); + $pmShinkenwebservice->sendRestartArbiter(1, $_GET["tag"], isset($_GET["action"]) ? $_GET["action"] : 'restart'); } else { Toolbox::logInFile("pm-restart", "call sendRestartArbiter, no tag\n"); $pmShinkenwebservice->sendRestartArbiter(1); diff --git a/inc/message.class.php b/inc/message.class.php index 428cd9e3..bf5ac406 100644 --- a/inc/message.class.php +++ b/inc/message.class.php @@ -220,7 +220,6 @@ class='msgboxmonit msgboxmonit-grey' id='updated_elements'>"; // Try to restart Shinken via webservice $pmShinkenwebservice = new PluginMonitoringShinkenwebservice(); $pmShinkenwebservice->sendRestartArbiter(); - Toolbox::logInFile("pm-restart", "sendRestartArbiter, command : $command, tag: $tag, force: $force\n"); $input .= __('Shinken is restarted automatically', 'monitoring'); //$input .= __('Restart Shinken to reload this new configuration', 'monitoring'); } diff --git a/inc/shinkenwebservice.class.php b/inc/shinkenwebservice.class.php index d1098ea0..963baea1 100644 --- a/inc/shinkenwebservice.class.php +++ b/inc/shinkenwebservice.class.php @@ -142,12 +142,14 @@ function sendDowntime($host_id=-1, $service_id=-1, $author= '', $comment='', $fl } - function sendRestartArbiter($force=0, $tag=0, $command='reload') { + function sendRestartArbiter($force=0, $tag=0, $command='restart') { $pmTag = new PluginMonitoringTag(); $pmLog = new PluginMonitoringLog(); Toolbox::logInFile("pm-restart", "sendRestartArbiter, command : $command, tag: $tag, force: $force\n"); + // We should specify delay instead of default 20 minutes ... + // if (!$pmLog->isRestartRecent(1200) if (!$pmLog->isRestartRecent() || $force) { if ($tag > 0) {