From 65d81fa325ccb8d03e1d2a6e921b0acd7e9a5e1f Mon Sep 17 00:00:00 2001 From: guruevi Date: Thu, 20 Nov 2008 21:26:59 +0000 Subject: [PATCH] 2008-11-20 Evi Vanoost * operation/snmpconsole/snmp_view.php, godmode/snmpconsole/snmp_view.php: Added legend to satisfy feature request #2204169. Also made filters persistent * operation/events/events.php: Usage of new function * operation/agentes/ver_agente.php, operation/agentes/estado_monitores.php: A bit of style update Fixed bug where $intervalo actually came from index.php * index.php: Put refresh in config (to prevent above bug) * include/styles/pandora_width.css, include/styles/pandora_red.css, include/styles/pandora_black.css, include/styles/pandora.css: Update so you can use datos_ in other things than td * include/functions_db.php: give_agentinterval is now get_agent_interval * include/functions.php: Added get_priority_class to find background color classes git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1253 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 23 ++ .../godmode/snmpconsole/snmp_alert.php | 30 +-- pandora_console/include/functions.php | 29 ++- pandora_console/include/functions_db.php | 31 +-- pandora_console/include/styles/pandora.css | 23 +- .../include/styles/pandora_black.css | 33 +-- .../include/styles/pandora_red.css | 33 +-- .../include/styles/pandora_width.css | 27 +-- pandora_console/index.php | 6 +- .../agentes/estado_generalagente.php | 2 +- .../operation/agentes/estado_monitores.php | 202 +++++++++--------- .../operation/agentes/ver_agente.php | 9 +- pandora_console/operation/events/events.php | 20 +- .../operation/snmpconsole/snmp_view.php | 71 +++--- 14 files changed, 267 insertions(+), 272 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5ed5ac6934..20d1911fff 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,26 @@ +2008-11-20 Evi Vanoost + + * operation/snmpconsole/snmp_view.php, godmode/snmpconsole/snmp_view.php: + Added legend to satisfy feature request #2204169. Also made filters + persistent + + * operation/events/events.php: Usage of new function + + * operation/agentes/ver_agente.php, + operation/agentes/estado_monitores.php: A bit of style update + Fixed bug where $intervalo actually came from index.php + + * index.php: Put refresh in config (to prevent above bug) + + * include/styles/pandora_width.css, include/styles/pandora_red.css, + include/styles/pandora_black.css, include/styles/pandora.css: + Update so you can use datos_ in other things than td + + * include/functions_db.php: give_agentinterval is now get_agent_interval + + * include/functions.php: Added get_priority_class to find background + color classes + 2008-11-20 Jorge Gonzalez * pandoradb_data.sql: Corrected mistake for languages Slovak and diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index d7b8f17a0a..ccb9fbd79d 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -331,25 +331,8 @@ if (isset ($_GET["update_alert"])) { '.__('Update').''; $idx = count ($table->data); //The current index of the table is 1 less than the count of table data so we count before adding to table->data array_push ($table->data, $data); - switch ($row["priority"]) { - case 0: - $table->rowclass[$idx] = "datos_blue"; - break; - case 1: - $table->rowclass[$idx] = "datos_grey"; - break; - case 2: - $table->rowclass[$idx] = "datos_green"; - break; - case 3: - $table->rowclass[$idx] = "datos_yellow"; - break; - case 4: - $table->rowclass[$idx] = "datos_red"; - break; - default: - $table->rowclass[$idx] = "datos_grey"; - } + + $table->rowclass[$idx] = get_priority_class ($row["priority"]); } if (!empty ($table->data)) { @@ -362,7 +345,14 @@ if (isset ($_GET["update_alert"])) { echo '
'; print_submit_button (__('Create'), "add_alert", false, 'class="sub next"'); echo "
"; - + + echo '
'; + echo '

'.__('Legend').'

'; + foreach (get_priorities () as $num => $name) { + echo ''.$name.''; + echo '
'; + } + echo '
'; } ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 51e7e4ecd5..916e3b41bc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1202,8 +1202,6 @@ function get_priorities () { * @return priority string. */ function get_priority_name ($priority) { - global $config; - switch ($priority) { case 0: return __('Maintenance'); @@ -1215,11 +1213,36 @@ function get_priority_name ($priority) { return __('Warning'); case 4: return __('Critical'); - case -1: + default: return __('All'); } } +/** + * Get priority class (CSS class) from priority value. + * + * @param priority value (integer) as stored eg. in database. + * + * @return priority class. + */ +function get_priority_class ($priority) { + switch ($priority) { + case 0: + return "datos_blue"; + case 1: + return "datos_grey"; + case 2: + return "datos_green"; + case 3: + return "datos_yellow"; + case 4: + return "datos_red"; + default: + return "datos_grey"; + } +} + + /** * Avoid magic_quotes protection * Deprecated by get_parameter functions and safe_input funcitons diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index dfd47ae8eb..d7e96b4f15 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1071,11 +1071,11 @@ function event_insert ($event, $id_group, $id_agent, $status = 0, */ function get_module_interval ($id_agent_module) { $interval = (int) get_db_value ('module_interval', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); - if ($interval) + if ($interval > 0) return $interval; - $id_agent = get_db_value ('id_agente', 'tagente_modulo', 'id_agente_modulo', (int) $id_agent_module); - - return (int) give_agentinterval ($id_agent); + + $id_agent = give_agent_id_from_module_id ($id_agent_module); + return (int) get_agent_interval ($id_agent); } /** @@ -1085,7 +1085,7 @@ function get_module_interval ($id_agent_module) { * * @return The interval value of a given agent */ -function give_agentinterval ($id_agent) { +function get_agent_interval ($id_agent) { return (int) get_db_value ('intervalo', 'tagente', 'id_agente', $id_agent); } @@ -2144,26 +2144,7 @@ function smal_event_table ($filter = "", $limit = 10, $width = 440) { } /* Only incident read access to view data ! */ - switch ($event["criticity"]) { - case 0: - $tdclass = "datos_blue"; - break; - case 1: - $tdclass = "datos_grey"; - break; - case 2: - $tdclass = "datos_green"; - break; - case 3: - $tdclass = "datos_yellow"; - break; - case 4: - $tdclass = "datos_red"; - break; - default: - $tdclass = "datos_grey"; - } - + $tdclass = get_priority_class ($event["criticity"]); $criticity_label = get_priority_name ($event["criticity"]); /* Colored box */ echo ""; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 2e6d6961ad..f7502e2d8a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -639,34 +639,35 @@ span#logo_text2 { width: 180px; } -td.datos_green, td.datos_greenf9 { +/* classes for event priorities. Sits now in functions.php */ +.datos_green, .datos_greenf9 { background-color: #BBFFA4; - padding: 5px 5px 5px 5px; } -td.datos_red, td.datos_redf9 { +.datos_red, .datos_redf9 { background-color: #FFC0B5; - padding: 5px 5px 5px 5px; } -td.datos_yellow, td.datos_yellowf9 { +.datos_yellow, .datos_yellowf9 { background-color: #F4FFBF; - padding: 5px 5px 5px 5px; } -td.datos_blue, td.datos_bluef9 { +.datos_blue, .datos_bluef9 { background-color: #CDE2EA; - padding: 5px 5px 5px 5px; } -td.datos_grey, td.datos_greyf9 { +.datos_grey, .datos_greyf9 { background-color: #E4E4E4; - padding: 5px 5px 5px 5px; +} + +.datos_greyf9, .datos_bluef9, .datos_greenf9, .datos_redf9, .datos_yellowf9 { + font-size: 6.5pt; } td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { - font-size: 6.5pt; + padding: 5px 5px 5px 5px; } +/* end of classes for event priorities */ div#main_pure { background-color: #fefefe; diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index cef6984e96..338ac5e0b4 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -635,34 +635,35 @@ span#logo_text2 { width: 180px; } -td.datos_green, td.datos_greenf9 { - background-color: #004807; - padding: 5px 5px 5px 5px; +/* classes for event priorities. Sits now in functions.php */ +.datos_green, .datos_greenf9 { + background-color: #BBFFA4; } -td.datos_red, td.datos_redf9 { - background-color: #652000; - padding: 5px 5px 5px 5px; +.datos_red, .datos_redf9 { + background-color: #FFC0B5; } -td.datos_yellow, td.datos_yellowf9 { - background-color: #575A00; - padding: 5px 5px 5px 5px; +.datos_yellow, .datos_yellowf9 { + background-color: #F4FFBF; } -td.datos_blue, td.datos_bluef9 { - background-color: #003B5A; - padding: 5px 5px 5px 5px; +.datos_blue, .datos_bluef9 { + background-color: #CDE2EA; } -td.datos_grey, td.datos_greyf9 { - background-color: #303030; - padding: 5px 5px 5px 5px; +.datos_grey, .datos_greyf9 { + background-color: #E4E4E4; +} + +.datos_greyf9, .datos_bluef9, .datos_greenf9, .datos_redf9, .datos_yellowf9 { + font-size: 6.5pt; } td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { - font-size: 6.5pt; + padding: 5px 5px 5px 5px; } +/* end of classes for event priorities */ div#main_pure { background-color: #000; diff --git a/pandora_console/include/styles/pandora_red.css b/pandora_console/include/styles/pandora_red.css index f3d7f5845b..d69d21135f 100644 --- a/pandora_console/include/styles/pandora_red.css +++ b/pandora_console/include/styles/pandora_red.css @@ -659,34 +659,35 @@ span#logo_text2 { width: 180px; } -td.datos_green, td.datos_greenf9 { - background-color: #C7EAD5; - padding: 5px 5px 5px 5px; +/* classes for event priorities. Sits now in functions.php */ +.datos_green, .datos_greenf9 { + background-color: #BBFFA4; } -td.datos_red, td.datos_redf9 { - background-color: #FFC0B5; - padding: 5px 5px 5px 5px; +.datos_red, .datos_redf9 { + background-color: #FFC0B5; } -td.datos_yellow, td.datos_yellowf9 { - background-color: #F4FFBF; - padding: 5px 5px 5px 5px; +.datos_yellow, .datos_yellowf9 { + background-color: #F4FFBF; } -td.datos_blue, td.datos_bluef9 { - background-color: #CDE2EA; - padding: 5px 5px 5px 5px; +.datos_blue, .datos_bluef9 { + background-color: #CDE2EA; } -td.datos_grey, td.datos_greyf9 { - background-color: #DCDCDC; - padding: 5px 5px 5px 5px; +.datos_grey, .datos_greyf9 { + background-color: #E4E4E4; +} + +.datos_greyf9, .datos_bluef9, .datos_greenf9, .datos_redf9, .datos_yellowf9 { + font-size: 6.5pt; } td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { - font-size: 6.5pt; + padding: 5px 5px 5px 5px; } +/* end of classes for event priorities */ div#main_pure { background-color: #fefefe; diff --git a/pandora_console/include/styles/pandora_width.css b/pandora_console/include/styles/pandora_width.css index d6fbbbc8c6..a56ae19b5c 100644 --- a/pandora_console/include/styles/pandora_width.css +++ b/pandora_console/include/styles/pandora_width.css @@ -645,34 +645,35 @@ span#logo_text2 { width: 180px; } -td.datos_green, td.datos_greenf9 { - background-color: #C7EAD5; - padding: 5px 5px 5px 5px; +/* classes for event priorities. Sits now in functions.php */ +.datos_green, .datos_greenf9 { + background-color: #BBFFA4; } -td.datos_red, td.datos_redf9 { +.datos_red, .datos_redf9 { background-color: #FFC0B5; - padding: 5px 5px 5px 5px; } -td.datos_yellow, td.datos_yellowf9 { +.datos_yellow, .datos_yellowf9 { background-color: #F4FFBF; - padding: 5px 5px 5px 5px; } -td.datos_blue, td.datos_bluef9 { +.datos_blue, .datos_bluef9 { background-color: #CDE2EA; - padding: 5px 5px 5px 5px; } -td.datos_grey, td.datos_greyf9 { - background-color: #DCDCDC; - padding: 5px 5px 5px 5px; +.datos_grey, .datos_greyf9 { + background-color: #E4E4E4; +} + +.datos_greyf9, .datos_bluef9, .datos_greenf9, .datos_redf9, .datos_yellowf9 { + font-size: 6.5pt; } td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { - font-size: 6.5pt; + padding: 5px 5px 5px 5px; } +/* end of classes for event priorities */ div#main_pure { background-color: #fefefe; diff --git a/pandora_console/index.php b/pandora_console/index.php index daa69b3fef..f10102ee91 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -77,8 +77,8 @@ echo ' 0) { +$config["refr"] = get_parameter ("refr", 0); +if ($config["refr"] > 0) { // Agent selection filters and refresh $query = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == TRUE ? 's': '') . '://' . $_SERVER['SERVER_NAME']; if ($_SERVER['SERVER_PORT'] != 80 && (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == TRUE && $_SERVER['SERVER_PORT'] != 443)) @@ -102,7 +102,7 @@ if ($intervalo > 0) { $query .= ":" . $_SERVER['SERVER_PORT']; $query .= $_SERVER['REQUEST_URI'] . '&ag_group_refresh=' . $ag_group; } else { - echo ''; + echo ''; } } diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index bdc70d58c5..a724bb6293 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -72,7 +72,7 @@ echo ''.__('Parent').''; -echo ''.dame_nombre_agente ($agent["id_parent"]).''; +echo ''.get_agent_name ($agent["id_parent"]).''; // Agent Interval echo ''.__('Interval').''; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index b503521619..8a1eb4d006 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -16,111 +16,113 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - // Load globar vars -require("include/config.php"); -check_login(); +require_once ("include/config.php"); - // $id_agente can be obtained as global variable or GET param. - if (isset($_GET["id_agente"])){ - $id_agente = $_GET["id_agente"]; - } - // Get all module from agent - $sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre'; - $result_t=mysql_query($sql_t); - if (mysql_num_rows ($result_t)) { - echo "

".__('Full list of Monitors')."

"; - echo ""; - echo ""; - echo " - - - - - "; - $color=0; - while ($row_t=mysql_fetch_array($result_t)){ - # For evey module in the status table - $est_modulo = substr($row_t["nombre"],0,25); - $est_tipo = dame_nombre_tipo_modulo($row_t["id_tipo_modulo"]); - $est_description = $row_t["descripcion"]; - $est_timestamp = $row_t["timestamp"]; - $est_estado = $row_t["estado"]; - $est_datos = $row_t["datos"]; - $est_cambio = $row_t["cambio"]; +if (!isset ($id_agente)) { + //This page is included, $id_agente should be passed to it. + audit_db ($config['id_user'], $config['remote_addr'], "HACK Attempt", + "Trying to get to monitor list without id_agent passed"); + include ("general/noaccess.php"); + exit; +} + +// Get all module from agent +$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre'; +$result_t=mysql_query($sql_t); +if (mysql_num_rows ($result_t)) { + echo "

".__('Full list of Monitors')."

"; + echo "
X".__('Type')."".__('Module name')."".__('Description')."".__('Status')."".__('Interval')."".__('Last contact')."
"; + echo ""; + echo " + + + + + "; + $color=0; + while ($row_t=mysql_fetch_array($result_t)){ + # For evey module in the status table + $est_modulo = substr($row_t["nombre"],0,25); + $est_tipo = dame_nombre_tipo_modulo($row_t["id_tipo_modulo"]); + $est_description = $row_t["descripcion"]; + $est_timestamp = $row_t["timestamp"]; + $est_estado = $row_t["estado"]; + $est_datos = $row_t["datos"]; + $est_cambio = $row_t["cambio"]; + if ($row_t["module_interval"] > 0) { $est_interval = $row_t["module_interval"]; - if (($est_interval != $intervalo) && ($est_interval > 0)) { - $temp_interval = $est_interval; - } else { - $temp_interval = $intervalo; - } - if ($est_estado <>100){ # si no es un modulo de tipo datos - # Determinamos si se ha caido el agente (tiempo de intervalo * 2 superado) - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - $seconds = time() - $row_t["utimestamp"]; - if ($seconds >= ($temp_interval*2)) // If every interval x 2 secs. we get nothing, there's and alert - $agent_down = 1; - else - $agent_down = 0; - - - - - echo ""; - echo ""; - else - echo "--"; - echo ""; - } + } else { + $est_interval = get_module_interval ($row_t["module_interval"]); //This function will return the correct interval } - echo '
X".__('Type')."".__('Module name')."".__('Description')."".__('Status')."".__('Interval')."".__('Last contact')."
"; - - if (($row_t["id_modulo"] != 1) AND ($row_t["id_tipo_modulo"] < 100)) { - if ($row_t["flag"] == 0){ - echo ""; - } else { - echo ""; - } - } - echo ""; - echo ""; - echo "".$est_modulo.""; - echo substr($est_description,0,35); - echo ""; - if ($est_estado == 1){ - if ($est_cambio == 1) - echo ""; - else - echo ""; - } else - echo ""; - - echo ""; - if ($temp_interval != $intervalo) - echo $temp_interval.""; - if ($agent_down == 1) { // If agent down, it's shown red and bold - echo ""; - } - else { - echo ""; - } - if ($row_t["timestamp"]=='0000-00-00 00:00:00') { - echo __('Never'); - } else { - echo human_time_comparation($row_t["timestamp"]); - } - echo "
'; + + if ($est_estado <>100){ # si no es un modulo de tipo datos + # Determinamos si se ha caido el agente (tiempo de intervalo * 2 superado) + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } + else { + $tdcolor = "datos2"; + $color = 1; + } + $seconds = time() - $row_t["utimestamp"]; + if ($seconds >= ($est_interval*2)) // If every interval x 2 secs. we get nothing, there's and alert + $agent_down = 1; + else + $agent_down = 0; + - } else { - echo "
".__('This agent doesn \'t have any monitor with data')."
"; + + + echo ""; + + if (($row_t["id_modulo"] != 1) AND ($row_t["id_tipo_modulo"] < 100)) { + if ($row_t["flag"] == 0){ + echo ""; + } else { + echo ""; + } + } + echo ""; + echo ""; + echo "".$est_modulo.""; + echo ""; + echo substr($est_description,0,35); + echo ""; + if ($est_estado == 1){ + if ($est_cambio == 1) + echo ""; + else + echo ""; + } else + echo ""; + + echo ""; + if ($est_interval > 0) { + echo $est_interval; + } else { + echo "--"; + } + echo ""; + if ($agent_down == 1) { // If agent down, it's shown red and bold + echo ""; + } + else { + echo ""; + } + if ($row_t["timestamp"]=='0000-00-00 00:00:00') { + echo __('Never'); + } else { + echo human_time_comparation($row_t["timestamp"]); + } + echo ""; + } } + echo ''; + +} else { + echo "
".__('This agent doesn \'t have any monitor with data')."
"; +} ?> diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 0a6ab6f37e..83e7d8c01b 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -17,10 +17,10 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Load global vars -require("include/config.php"); -enterprise_include('operation/agentes/ver_agente.php'); +require_once ("include/config.php"); +enterprise_include ('operation/agentes/ver_agente.php'); -check_login(); +check_login (); if (defined ('AJAX')) { $get_agent_json = (bool) get_parameter ('get_agent_json'); @@ -129,6 +129,7 @@ $id_agente = (int) get_parameter ("id_agente"); if (! $id_agente) { return; } + // get group for this id_agente $id_grupo = get_db_value ('id_grupo', 'tagente', 'id_agente', $id_agente); if (! give_acl ($config['id_user'], $id_grupo, "AR")) { @@ -141,7 +142,7 @@ if (! give_acl ($config['id_user'], $id_grupo, "AR")) { // Check for validate alert request $validate_alert = get_parameter ("validate_alert"); if ($validate_alert != ""){ - if (give_acl ($config['id_user'], $id_grupo, "AW")==1){ + if (give_acl ($config['id_user'], $id_grupo, "AW") == 1) { $alert_row = get_db_row ("talerta_agente_modulo", "id_aam", $validate_alert); if ($alert_row["id_agente_modulo"] != 0){ $am_row = get_db_row ("tagente_modulo", "id_agente_modulo", $alert_row["id_agente_modulo"]); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 87797de87d..3b7ad4b5bc 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -266,25 +266,7 @@ foreach ($result as $row) { $data = array (); //First pass along the class of this row - switch ($row["criticity"]) { - case 0: - $table->rowclass[] = "datos_blue"; - break; - case 1: - $table->rowclass[] = "datos_grey"; - break; - case 2: - $table->rowclass[] = "datos_green"; - break; - case 3: - $table->rowclass[] = "datos_yellow"; - break; - case 4: - $table->rowclass[] = "datos_red"; - break; - default: - $table->rowclass[] = "datos_grey"; - } + $table->rowclass[] = get_priority_class ($row["criticity"]); // Colored box if ($row["estado"] == 0) { diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 2c7b32bcf0..2c9fda8c62 100644 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -36,8 +36,9 @@ $filter_oid = (string) get_parameter ("filter_oid", ''); $filter_severity = (int) get_parameter ("filter_severity", -1); $filter_fired = (int) get_parameter ("filter_fired", -1); $search_string = (string) get_parameter ("search_string", ''); -$config["block_size"] = (int) get_parameter ("pagination", $config["block_size"]); +$pagination = (int) get_parameter ("pagination", $config["block_size"]); $offset = (int) get_parameter ('offset',0); +$url = "index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_agent=".$filter_agent."&filter_oid=".$filter_oid."&filter_severity=".$filter_severity."&filter_fired=".$filter_fired."&search_string=".$search_string."&pagination=".$pagination."&offset=".$offset; // OPERATIONS @@ -97,10 +98,10 @@ if (isset ($_POST["updatebt"])) { echo "

Pandora SNMP > " . __('SNMP console'); if ($config["pure"] == 1) { - echo " "; + echo ' '; } else { // Fullscreen - echo " "; + echo ' '; } echo "

"; @@ -114,10 +115,9 @@ if (empty ($traps)) { } // Toggle filters -echo ''; -echo "".__('Toggle filters')." ".''; +echo ''.__('Toggle filters').' '; -echo '
'; +echo ''; $table->width = '90%'; $table->size = array (); $table->size[0] = '120px'; @@ -139,9 +139,9 @@ foreach ($traps as $trap) { } if ($config["pure"] == 1) { - echo "