From af5b7e062c89d5081d531142fa69ce39c7a3a852 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 18 Feb 2015 18:33:37 +0100 Subject: [PATCH] Fixed period was undefined sometimes in ajax call to get list of module data dialog. --- .../operation/agentes/status_monitor.php | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index b02f57f4d9..685f451c97 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -34,6 +34,7 @@ enterprise_include_once ('include/functions_metaconsole.php'); $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php'); + if (! defined ('METACONSOLE')) { //Header ui_print_page_header (__("Monitor detail"), "images/brick.png", false); @@ -108,6 +109,7 @@ else { $id_ag_group = db_get_value('id_grupo', 'tgrupo', 'nombre', $ag_group); } + // Agent group selector if (!defined('METACONSOLE')) { if ($ag_group > 0 && check_acl ($config["id_user"], $ag_group, "AR")) { @@ -119,6 +121,7 @@ if (!defined('METACONSOLE')) { } } else { + if ($ag_group != "0" && check_acl ($config["id_user"], $id_ag_group, "AR")) { $sql_conditions_group = sprintf (" AND tagente.id_grupo IN ( SELECT id_grupo FROM tgrupo where nombre = '%s') ", $ag_group); } @@ -230,6 +233,7 @@ if (is_numeric($sql_conditions_tags)) { $sql_conditions_all = $sql_conditions_base . $sql_conditions . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields; $sql_conditions_acl = $sql_conditions_base . $sql_conditions_group . $sql_conditions_tags . $sql_conditions_custom_fields; + // Get count to paginate if (!defined('METACONSOLE')) $count = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) " . $sql_from . $sql_conditions_all); @@ -406,6 +410,7 @@ else { false, 'width:150px;') . ' '; } + echo '' . __('Monitor status') . ""; @@ -732,6 +737,7 @@ switch ($config["dbtype"]) { $sql_from . $sql_conditions_all . " ORDER BY " . $order['field'] . " " . $order['order'] . " LIMIT ".$offset.",".$limit_sql; + break; case "postgresql": if (strstr($config['dbversion'], "8.4") !== false) { @@ -1186,7 +1192,9 @@ foreach ($result as $row) { $win_handle=dechex(crc32($row["id_agente_modulo"].$row["module_name"])); if (defined('METACONSOLE')) - $link ="winopeng('" . $row['server_url'] . "operation/agentes/stat_win.php?type=$graph_type&period=86400&loginhash=auto&loginhash_data=" . $row["hashdata"] . "&loginhash_user=" . str_rot13($row["user"]) . "&id=".$row["id_agente_modulo"]."&label=".rawurlencode(urlencode(base64_encode($row["module_name"])))."&refresh=600','day_".$win_handle."')"; + $link ="winopeng('" . + $row['server_url'] . "operation/agentes/stat_win.php?" . + "type=$graph_type&period=86400&loginhash=auto&loginhash_data=" . $row["hashdata"] . "&loginhash_user=" . str_rot13($row["user"]) . "&id=".$row["id_agente_modulo"]."&label=".rawurlencode(urlencode(base64_encode($row["module_name"])))."&refresh=600','day_".$win_handle."')"; else $link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$row["id_agente_modulo"]."&label=".rawurlencode(urlencode(base64_encode($row["module_name"])))."&refresh=600','day_".$win_handle."')"; @@ -1202,7 +1210,9 @@ foreach ($result as $row) { } - $data[8] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']); + $data[8] = ui_print_module_warn_value($row['max_warning'], + $row['min_warning'], $row['str_warning'], $row['max_critical'], + $row['min_critical'], $row['str_critical']); if (is_numeric($row["datos"])) { $salida = format_numeric($row["datos"]); @@ -1314,12 +1324,15 @@ else { echo "
"; + + enterprise_hook('close_meta_frame'); ui_require_javascript_file('pandora_modules'); ?>