diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index 9e750be932..d9843f9860 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -1,17 +1,32 @@
0, 1, 0)) AS alerts_module_count,
- SUM(IF($condition_warning, 1, 0)) AS warning_module_count,
- SUM(IF($condition_unknown, 1, 0)) AS unknown_module_count,
- SUM(IF($condition_not_init, 1, 0)) AS notInit_module_count,
- SUM(IF($condition_critical, 1, 0)) AS critical_module_count,
- SUM(IF($condition_normal, 1, 0)) AS normal_module_count,
- COUNT(tae.id_agente_modulo) AS total_count,
- tmg.id_mg,
- tmg.name as n,
- tg.id_grupo
- FROM (
- SELECT tam.id_agente_modulo,
- tam.id_module_group,
- ta.id_grupo AS g,
- tae.estado,
- SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
- FROM tagente_modulo tam
- LEFT JOIN talert_template_modules tatm
- ON tatm.id_agent_module = tam.id_agente_modulo
- AND tatm.times_fired = 1
- LEFT JOIN tagente_estado tae
- ON tae.id_agente_modulo = tam.id_agente_modulo
- INNER JOIN tagente ta
- ON ta.id_agente = tam.id_agente
- WHERE ta.disabled = 0
- AND tam.disabled = 0
- AND tam.delete_pending = 0
- AND ta.id_grupo IN ($ids_group)
- GROUP BY tam.id_agente_modulo
- UNION ALL
- SELECT tam.id_agente_modulo,
- tam.id_module_group,
- tasg.id_group AS g,
- tae.estado,
- SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
- FROM tagente_modulo tam
- LEFT JOIN talert_template_modules tatm
- ON tatm.id_agent_module = tam.id_agente_modulo
- AND tatm.times_fired = 1
- LEFT JOIN tagente_estado tae
- ON tae.id_agente_modulo = tam.id_agente_modulo
- INNER JOIN tagente ta
- ON ta.id_agente = tam.id_agente
- INNER JOIN tagent_secondary_group tasg
- ON ta.id_agente = tasg.id_agent
- WHERE ta.disabled = 0
- AND tam.disabled = 0
- AND tam.delete_pending = 0
- AND tasg.id_group IN ($ids_group)
- GROUP BY tam.id_agente_modulo, tasg.id_group
- ) AS tae
- RIGHT JOIN tgrupo tg
- ON tg.id_grupo = tae.g
- INNER JOIN (
- SELECT * FROM tmodule_group
- UNION ALL
- SELECT 0 AS 'id_mg', 'Nothing' AS 'name'
- ) AS tmg
- ON tae.id_module_group = tmg.id_mg
- GROUP BY tae.g, tmg.id_mg";
+ $sql = sprintf(
+ "SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
+ SUM(IF(%s, 1, 0)) AS warning_module_count,
+ SUM(IF(%s, 1, 0)) AS unknown_module_count,
+ SUM(IF(%s, 1, 0)) AS notInit_module_count,
+ SUM(IF(%s, 1, 0)) AS critical_module_count,
+ SUM(IF(%s, 1, 0)) AS normal_module_count,
+ COUNT(tae.id_agente_modulo) AS total_count,
+ tmg.id_mg,
+ tmg.name as n,
+ tg.id_grupo
+ FROM (
+ SELECT tam.id_agente_modulo,
+ tam.id_module_group,
+ ta.id_grupo AS g,
+ tae.estado,
+ SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
+ FROM tagente_modulo tam
+ LEFT JOIN talert_template_modules tatm
+ ON tatm.id_agent_module = tam.id_agente_modulo
+ AND tatm.times_fired = 1
+ LEFT JOIN tagente_estado tae
+ ON tae.id_agente_modulo = tam.id_agente_modulo
+ INNER JOIN tagente ta
+ ON ta.id_agente = tam.id_agente
+ WHERE ta.disabled = 0
+ AND tam.disabled = 0
+ AND tam.delete_pending = 0
+ AND ta.id_grupo IN (%s)
+ GROUP BY tam.id_agente_modulo
+ UNION ALL
+ SELECT tam.id_agente_modulo,
+ tam.id_module_group,
+ tasg.id_group AS g,
+ tae.estado,
+ SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
+ FROM tagente_modulo tam
+ LEFT JOIN talert_template_modules tatm
+ ON tatm.id_agent_module = tam.id_agente_modulo
+ AND tatm.times_fired = 1
+ LEFT JOIN tagente_estado tae
+ ON tae.id_agente_modulo = tam.id_agente_modulo
+ INNER JOIN tagente ta
+ ON ta.id_agente = tam.id_agente
+ INNER JOIN tagent_secondary_group tasg
+ ON ta.id_agente = tasg.id_agent
+ WHERE ta.disabled = 0
+ AND tam.disabled = 0
+ AND tam.delete_pending = 0
+ AND tasg.id_group IN (%s)
+ GROUP BY tam.id_agente_modulo, tasg.id_group
+ ) AS tae
+ RIGHT JOIN tgrupo tg
+ ON tg.id_grupo = tae.g
+ INNER JOIN (
+ SELECT * FROM tmodule_group
+ UNION ALL
+ SELECT 0 AS 'id_mg', 'Nothing' AS 'name'
+ ) AS tmg
+ ON tae.id_module_group = tmg.id_mg
+ GROUP BY tae.g, tmg.id_mg",
+ $condition_warning,
+ $condition_unknown,
+ $condition_not_init,
+ $condition_critical,
+ $condition_normal,
+ $ids_group,
+ $ids_group
+ );
$array_data_prev = db_get_all_rows_sql($sql);
@@ -220,9 +253,21 @@ function mainModuleGroups()
echo '
';
echo '';
+ $cell_style = '
+ min-width: 60px;
+ width: 100%;
+ margin: 0;
+ overflow:hidden;
+ text-align: center;
+ padding: 5px;
+ padding-bottom:10px;
+ font-size: 18px;
+ text-align: center;
+ ';
+
if (true) {
$table = new StdClass();
- $table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; padding-right: 10px; min-width: 230px;';
+ $table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%';
$head[0] = __('Groups');
@@ -248,28 +293,28 @@ function mainModuleGroups()
$color = '#FFA631';
// Orange when the cell for this model group and agent has at least one alert fired.
} else if ($array_data[$key][$k]['critical_module_count'] != 0) {
- $color = '#FC4444';
+ $color = '#e63c52';
// Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
} else if ($array_data[$key][$k]['warning_module_count'] != 0) {
- $color = '#FAD403';
+ $color = '#f3b200';
// Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
} else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
$color = '#B2B2B2 ';
// Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
} else if ($array_data[$key][$k]['normal_module_count'] != 0) {
- $color = '#80BA27';
+ $color = '#82b92e';
// Green when the cell for this model group and agent has OK state all modules.
} else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
$color = '#5BB6E5';
// Blue when the cell for this module group and all modules have not init value.
}
- $data[$i][$j] = "
';
+ foreach ($news as $article) {
+ $image = false;
+ if ($article['text'] == '<p style="text-align: center; font-size: 13px;">Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&gt; Site news.</p> ') {
+ $image = true;
+ }
- foreach ($news as $article) {
- $image = false;
- if ($article['text'] == '<p style="text-align: center; font-size: 13px;">Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&gt; Site news.</p> ') {
- $image = true;
- }
+ $text_bbdd = io_safe_output($article['text']);
+ $text = html_entity_decode($text_bbdd);
+ $output_news .= ''.$article['subject'].'';
+ $output_news .= '
+ '.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade;
if ($new_agent) {
// If agent is new, show custom id as old style format.
$table_adv_options .= $custom_id_div;
}
-$table_adv_options .= $table_adv_gis.'