2010-08-12 Sergio Martin <sergio.martin@artica.es>
* extensions/agents_modules.php: Change the status of the agents (the first column colors) to the status of the agent, not the worst module git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3137 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4c1e839261
commit
5259a3a67a
|
@ -1,3 +1,8 @@
|
|||
2010-08-12 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* extensions/agents_modules.php: Change the status of the agents (the first
|
||||
column colors) to the status of the agent, not the worst module
|
||||
|
||||
2010-08-12 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* extensions/agents_modules.php: Improved the agents/modules matrix in
|
||||
|
|
|
@ -111,27 +111,31 @@ function mainAgentsModules() {
|
|||
|
||||
foreach ($agents as $agent) {
|
||||
// Get stats for this group
|
||||
$data = get_agent_module_info($agent['id_agente']);
|
||||
$agent_status = get_agent_status($agent['id_agente']);
|
||||
|
||||
// Calculate entire row color
|
||||
if ($data["monitor_alertsfired"] > 0){
|
||||
$rowcolor = '#ffa300';
|
||||
$textcolor = '#000';
|
||||
} elseif ($data["monitor_critical"] > 0) {
|
||||
$rowcolor = '#bc0000';
|
||||
$textcolor = '#FFF';
|
||||
} elseif ($data["monitor_warning"] > 0) {
|
||||
$rowcolor = '#f2ef00';
|
||||
$textcolor = '#000';
|
||||
} elseif ($data["monitor_unknown"] > 0) {
|
||||
$rowcolor = '#babdb6';
|
||||
$textcolor = '#000';
|
||||
} elseif ($data["monitor_normal"] > 0) {
|
||||
$rowcolor = '#8ae234';
|
||||
$textcolor = '#000';
|
||||
} else {
|
||||
$rowcolor = '#babdb6';
|
||||
$textcolor = '#000';
|
||||
switch($agent_status) {
|
||||
case 4: // Alert fired status
|
||||
$rowcolor = '#ffa300';
|
||||
$textcolor = '#000';
|
||||
break;
|
||||
case 1: // Critical status
|
||||
$rowcolor = '#bc0000';
|
||||
$textcolor = '#FFF';
|
||||
break;
|
||||
case 2: // Warning status
|
||||
$rowcolor = '#f2ef00';
|
||||
$textcolor = '#000';
|
||||
break;
|
||||
case 0: // Normal status
|
||||
$rowcolor = '#8ae234';
|
||||
$textcolor = '#000';
|
||||
break;
|
||||
case 3:
|
||||
case -1:
|
||||
default: // Unknown status
|
||||
$rowcolor = '#babdb6';
|
||||
$textcolor = '#000';
|
||||
break;
|
||||
}
|
||||
|
||||
echo "<tr style='height: 35px;'>";
|
||||
|
|
Loading…
Reference in New Issue