From 084aec2453e494930b256a691701ba4224b1117b Mon Sep 17 00:00:00 2001
From: mdtrooper " . __("The colours meaning:") .
"
';
+ $agent = get_db_row('tagente', 'id_agente', $module['id_agente']);
+ echo '' . __('Agent').': ';
+ echo safe_output($agent['nombre']) . '
';
+ echo '' . __('Module') . ': ';
+ echo safe_output($module['nombre']) . '
';
+ $template = get_db_row('talert_templates', 'id' , $alert['id_alert_template']);
+ echo '' . __('Alert template') . ': ';
+ echo safe_output($template['name']) . '
';
+
+ $sql = 'SELECT *
+ FROM talert_template_module_actions AS t1
+ INNER JOIN talert_actions AS t2 ON t1.id_alert_action = t2.id
+ WHERE t1.id_alert_template_module = ' . $template['id'] . ' OR t2.id = ' . $template['id_alert_action'] . ';';
+
+ $actions = get_db_all_rows_sql($sql);
+ if ($actions === false) {
+ $actions = array();
+ }
+
+ echo '' . __('Actions') . ': ' . '
';
+ echo '';
+ foreach ($actions as $action) {
+ echo '
';
+ if ($alert != end($alerts)) {
+ echo '
';
+ }
+ }
+ }
+ }
+ }
+ }
+}
/**
* Translate the array texts using gettext
@@ -61,7 +118,8 @@ function mainModuleGroups() {
//The content of table
$tableData = array();
- //Create rows and celds
+
+ //Create rows and cells
foreach ($agentGroups as $idAgentGroup => $name) {
$row = array();
@@ -72,6 +130,23 @@ function mainModuleGroups() {
$query = sprintf($sql,$idAgentGroup, $idModelGroup);
$rowsDB = get_db_all_rows_sql ($query);
+
+ $agents = get_group_agents($idAgentGroup);
+ if (!empty($agents)) {
+ $alerts = get_agent_alerts_simple($agents);
+
+ foreach ($alerts as $alert) {
+ $module = get_db_row_filter('tagente_modulo', array('id_agente_modulo' => $alert['id_agent_module']));
+
+ if ($idModelGroup == $module['id_module_group']) {
+ $fired = false;
+ if ($alert["times_fired"] > 0) {
+ $fired = true;
+ }
+ }
+ }
+ }
+
$states = array();
if ($rowsDB !== false) {
foreach ($rowsDB as $rowDB) {
@@ -92,11 +167,11 @@ function mainModuleGroups() {
$alinkEnd = '';
}
else {
- // TODO: ADD Alerts fired status
- /*if (array_key_exists(4,$states)) {
+
+ if ($fired) {
$color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
- }*/
- if (array_key_exists(1,$states)) {
+ }
+ else if (array_key_exists(1,$states)) {
$color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
$font_color = '#ffffff';
}
@@ -111,9 +186,9 @@ function mainModuleGroups() {
}
- $alinkStart = '';
+ $alinkStart = '';
$alinkEnd = '';
}
@@ -133,24 +208,42 @@ function mainModuleGroups() {
echo "" .
- '
" .
"