From 925b108457046fd9825df95e7d9e3e22f5ff0900 Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 18 Mar 2015 15:22:53 +0100 Subject: [PATCH] health page displays piler version --- webui/config.php | 1 + webui/controller/health/worker.php | 3 +++ webui/view/theme/default/templates/health/worker.tpl | 5 +++++ webui/view/theme/mobile/templates/health/worker.tpl | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/webui/config.php b/webui/config.php index aef4ebda..9dbcbae4 100644 --- a/webui/config.php +++ b/webui/config.php @@ -202,6 +202,7 @@ $config['SPHINX_NOTE_INDEX'] = 'note1'; $config['RELOAD_COMMAND'] = 'sudo -n /etc/init.d/rc.piler reload'; $config['PILERIMPORT_IMAP_COMMAND'] = '/usr/local/bin/pilerimport -d /var/piler/imap -q -r'; $config['CPU_USAGE_COMMAND'] = "LC_ALL=C mpstat | tail -1 | rev | awk '{ print $1 }' | rev"; +$config['PILER_BINARY'] = "/usr/local/sbin/piler"; $config['LDAP_IMPORT_CONFIG_FILE'] = '/usr/local/etc/ldap-import.cfg'; diff --git a/webui/controller/health/worker.php b/webui/controller/health/worker.php index 52e5802c..d32a5bf9 100644 --- a/webui/controller/health/worker.php +++ b/webui/controller/health/worker.php @@ -50,6 +50,9 @@ class ControllerHealthWorker extends Controller { list ($this->data['uptime'], $this->data['cpuload']) = $this->model_health_health->uptime(); + exec(PILER_BINARY . " -v", $a); + $this->data['piler_version'] = $a[0]; + $x = exec(CPU_USAGE_COMMAND); $this->data['cpuinfo'] = 100 - (int)$x; diff --git a/webui/view/theme/default/templates/health/worker.tpl b/webui/view/theme/default/templates/health/worker.tpl index a3b16d55..4ee0f848 100644 --- a/webui/view/theme/default/templates/health/worker.tpl +++ b/webui/view/theme/default/templates/health/worker.tpl @@ -7,6 +7,11 @@

Up For:

+ + + + + diff --git a/webui/view/theme/mobile/templates/health/worker.tpl b/webui/view/theme/mobile/templates/health/worker.tpl index 6a9a0b5a..3f4ba0cd 100644 --- a/webui/view/theme/mobile/templates/health/worker.tpl +++ b/webui/view/theme/mobile/templates/health/worker.tpl @@ -12,6 +12,11 @@
+
+
Piler
+
+
+
Piler:
: