Skip to content
Snippets Groups Projects
Commit 2920fd38 authored by hahn's avatar hahn
Browse files

update apacheProcesses plugin

parent 403baff5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment