From f470e668846271d6d253e5ac5dfd711e4c748883 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 20 Nov 2014 15:23:08 +0100 Subject: [PATCH] monitoring: Fix view monitoring health when Icinga is not running If Icinga is not running, the view Monitoring Health simply shows a message about the backend not being up and running. This is of course not so useful as it lacks performance and last runtime information but is does not error. --- .../application/controllers/ProcessController.php | 3 +++ .../application/views/scripts/process/not-running.phtml | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 modules/monitoring/application/views/scripts/process/not-running.phtml diff --git a/modules/monitoring/application/controllers/ProcessController.php b/modules/monitoring/application/controllers/ProcessController.php index ca879cbaa..62334d7e8 100644 --- a/modules/monitoring/application/controllers/ProcessController.php +++ b/modules/monitoring/application/controllers/ProcessController.php @@ -66,6 +66,9 @@ class Monitoring_ProcessController extends Controller ) ->getQuery() ->fetchRow(); + if ($programStatus === false) { + return $this->render('not-running', true, null); + } $this->view->programStatus = $programStatus; $toggleFeaturesForm = new ToggleInstanceFeaturesCommandForm(); $toggleFeaturesForm diff --git a/modules/monitoring/application/views/scripts/process/not-running.phtml b/modules/monitoring/application/views/scripts/process/not-running.phtml new file mode 100644 index 000000000..58b6c2980 --- /dev/null +++ b/modules/monitoring/application/views/scripts/process/not-running.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ translate('%s is currently not up and running'), $this->backendName) ?> +