From 2fe4c570a8b030845fe09c43535694a880abf1d6 Mon Sep 17 00:00:00 2001 From: nook24 Date: Tue, 11 Oct 2016 18:04:43 +0200 Subject: [PATCH] Fix buildProcessPerfdataCache on low loaded systems --- cakephp/app/Config/bootstrap.php | 2 +- .../app/Console/Command/StatusengineLegacyShell.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cakephp/app/Config/bootstrap.php b/cakephp/app/Config/bootstrap.php index 65e9f1e..262c95b 100644 --- a/cakephp/app/Config/bootstrap.php +++ b/cakephp/app/Config/bootstrap.php @@ -118,7 +118,7 @@ CakePlugin::load('BoostCake'); //Define versions -define('STATUSENIGNE_VERSION', '2.0.1'); +define('STATUSENIGNE_VERSION', '2.0.2'); define('PERFDATA_VERSION', '1.2.0'); diff --git a/cakephp/app/Console/Command/StatusengineLegacyShell.php b/cakephp/app/Console/Command/StatusengineLegacyShell.php index 3abe02f..6f46934 100644 --- a/cakephp/app/Console/Command/StatusengineLegacyShell.php +++ b/cakephp/app/Console/Command/StatusengineLegacyShell.php @@ -2763,7 +2763,7 @@ public function waitForInstructions(){ * witch is bad because if GearmanWorker::work() stuck, PHP can not execute the signal handler */ $this->worker->addOptions(GEARMAN_WORKER_NON_BLOCKING); - $this->worker->setTimeout(1000); + $this->worker->setTimeout(250); $this->worker->addServer(Configure::read('server'), Configure::read('port')); foreach($this->queues as $queueName => $functionName){ @@ -2786,16 +2786,17 @@ public function waitForInstructions(){ if(isset($this->queues['statusngin_servicechecks'])){ CakeLog::info('Build up new process perfdata cache'); $this->buildProcessPerfdataCache(); + + $this->cacheHostNamesForGraphiteIfRequried(); + $this->cacheServiceNamesForGraphiteIfRequried(); } } - $this->cacheHostNamesForGraphiteIfRequried(); - $this->cacheServiceNamesForGraphiteIfRequried(); - CakeLog::info('I will continue my work'); $this->childWork(); - } + + pcntl_signal_dispatch(); //Check if the parent process still exists if($this->parentPid != posix_getppid()){