diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 02d0f434bb..cdafd810b1 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -251,6 +251,22 @@ function groups_check_used($idGroup) $return['tables'][] = __('Network maps'); } + switch ($config['dbtype']) { + case 'mysql': + case 'postgresql': + $numRows = db_get_num_rows('SELECT * FROM talert_snmp WHERE id_group = '.$idGroup.';'); + break; + + case 'oracle': + $numRows = db_get_num_rows('SELECT * FROM talert_snmp WHERE id_group = '.$idGroup); + break; + } + + if ($numRows > 0) { + $return['return'] = true; + $return['tables'][] = __('SNMP alerts'); + } + $hookEnterprise = enterprise_include_once('include/functions_groups.php'); if ($hookEnterprise !== ENTERPRISE_NOT_HOOK) { $returnEnterprise = enterprise_hook('groups_check_used_group_enterprise', [$idGroup]);