mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#8263 Fixed status group
This commit is contained in:
parent
07ef0477af
commit
cfd2fe390e
@ -609,24 +609,15 @@ function groups_get_groups_tree_recursive($groups, $trash=0, $trash2=0)
|
|||||||
*
|
*
|
||||||
* @return integer Status of the agents.
|
* @return integer Status of the agents.
|
||||||
*/
|
*/
|
||||||
function groups_get_status($id_group=0, $strict_user=false)
|
function groups_get_status($id_group=0, $ignore_alerts=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_once $config['homedir'].'/include/functions_reporting.php';
|
include_once $config['homedir'].'/include/functions_reporting.php';
|
||||||
|
|
||||||
if ($strict_user) {
|
|
||||||
$acltags = tags_get_user_groups_and_tags($config['id_user'], 'AR', $strict_user);
|
|
||||||
$group_status = group_get_data($config['id_user'], $strict_user, $acltags, false, 'group');
|
|
||||||
$data['monitor_alerts_fired'] = $groups_status['_monitors_alerts_fired_'];
|
|
||||||
$data['agent_critical'] = $groups_status['_agents_critical_'];
|
|
||||||
$data['agent_warning'] = $groups_status['_agents_warning_'];
|
|
||||||
$data['agent_unknown'] = $groups_status['_agents_unknown_'];
|
|
||||||
} else {
|
|
||||||
$data = reporting_get_group_stats_resume($id_group);
|
$data = reporting_get_group_stats_resume($id_group);
|
||||||
}
|
|
||||||
|
|
||||||
if ($data['monitor_alerts_fired'] > 0) {
|
if ($data['monitor_alerts_fired'] > 0 && $ignore_alerts == false) {
|
||||||
return AGENT_STATUS_ALERT_FIRED;
|
return AGENT_STATUS_ALERT_FIRED;
|
||||||
} else if ($data['agent_critical'] > 0) {
|
} else if ($data['agent_critical'] > 0) {
|
||||||
return AGENT_STATUS_CRITICAL;
|
return AGENT_STATUS_CRITICAL;
|
||||||
|
@ -3426,7 +3426,7 @@ function visual_map_get_status_element($layoutData)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GROUP_ITEM:
|
case GROUP_ITEM:
|
||||||
$group_status = groups_get_status($layoutData['id_group']);
|
$group_status = groups_get_status($layoutData['id_group'], true);
|
||||||
|
|
||||||
switch ($group_status) {
|
switch ($group_status) {
|
||||||
case AGENT_STATUS_ALERT_FIRED:
|
case AGENT_STATUS_ALERT_FIRED:
|
||||||
|
@ -359,7 +359,7 @@ final class Group extends Item
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Get the status img src.
|
// Get the status img src.
|
||||||
$status = \groups_get_status($groupId);
|
$status = \groups_get_status($groupId, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$imagePath = \visual_map_get_image_status_element($data, $status);
|
$imagePath = \visual_map_get_image_status_element($data, $status);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user