diff --git a/public_html/appmonitor/classes/appmonitor-client.class.php b/public_html/appmonitor/classes/appmonitor-client.class.php index 67856acb99be8749ab3299e3563c420224eb4664..93ac0762ebc587e53c08cf62779171e196f2108d 100644 --- a/public_html/appmonitor/classes/appmonitor-client.class.php +++ b/public_html/appmonitor/classes/appmonitor-client.class.php @@ -37,7 +37,7 @@ * 2018-11-05 0.58 axel.hahn@iml.unibe.ch additional flag in http check to show content<br> * 2019-05-31 0.87 axel.hahn@iml.unibe.ch add timeout as param in connective checks (http, tcp, databases)<br> * --------------------------------------------------------------------------------<br> - * @version 0.91 + * @version 0.92 * @author Axel Hahn * @link TODO * @license GPL @@ -51,7 +51,7 @@ class appmonitor { * value is in seconds * @var int */ - protected $_sVersion = 'php-client-v0.91'; + protected $_sVersion = 'php-client-v0.92'; /** * config: default ttl for server before requesting the client check again diff --git a/public_html/appmonitor/plugins/checkApacheProcesses.php b/public_html/appmonitor/plugins/checkApacheProcesses.php index 3d365b999f6bf3e8615dec6702ee807cacce350c..484f10a5ec46ba2e98068b2464981a47869d0044 100644 --- a/public_html/appmonitor/plugins/checkApacheProcesses.php +++ b/public_html/appmonitor/plugins/checkApacheProcesses.php @@ -14,10 +14,7 @@ * * ____________________________________________________________________________ * - * SHOW LOAD AS LINE - * - * A plugin always is loaded in clases/appmonitor-checks.class.php - * Have look there for the used protected classes + * SHOW COUNT OF ACTIVE APACHE PROCESSES * ____________________________________________________________________________ * * PARAMS: @@ -36,8 +33,8 @@ * "function" => "ApacheProcesses", * "params" => array( * "url" => "https://localhost/status", - * "warning" => 30, - * "error" => 50, + * "warning" => 75, + * "error" => 90, * ), * ), * "worstresult" => RESULT_OK @@ -109,12 +106,18 @@ class checkApacheProcesses extends appmonitorcheck{ if($iActive===false){ $iResult=RESULT_UNKNOWN; } else { + $sComment=''; + $iTotal=$aProcesses['total']; $iResult=RESULT_OK; - if($iActive>$this->_iWarn){ + if(($iActive/$iTotal*100)>$this->_iWarn){ $iResult=RESULT_WARNING; + $sComment='more than warning level '.$this->_iWarn.'%'; + } else { + $sComment='less than warning level '.$this->_iWarn.'%'; } - if($iActive>$this->_iError){ + if(($iActive/$iTotal*100)>$this->_iError){ $iResult=RESULT_ERROR; + $sComment='more than error level '.$this->_iError.'%'; } } @@ -132,7 +135,7 @@ class checkApacheProcesses extends appmonitorcheck{ // return array( $iResult, - ($iActive===false ? 'Apache httpd server status is not available' : 'apache processes: '.print_r($aProcesses, 1)), + ($iActive===false ? 'Apache httpd server status is not available' : 'apache processes: '.print_r($aProcesses, 1)).' '.$sComment, ($iActive===false ? array() : array(