diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7d849a5acb..a49d8dc453 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2009-01-19 Esteban Sanchez + + * godmode/agentes/alert_manager.php: Removed effect on AJAX tip. + + * include/functions.php: Removed deprecated function. + + * operation/agentes/estado_grupo.php, pandoradb_data.sql, + operation/agentes/ver_agente.php, reporting/fgraph.php, + operation/agentes/networkmap.php: Replaced references to old alert + system with new one. + + * operation/agentes/networkmap.php: Replaced references to old alert + system with new one. Removed effect on AJAX tip. + + * godmode/snmpconsole/snmp_alert.php: Style correction. + 2009-01-19 Esteban Sanchez * godmode/agentes/configurar_agente.php: Removed references to old diff --git a/pandora_console/godmode/agentes/alert_manager.php b/pandora_console/godmode/agentes/alert_manager.php index 78f5031333..e019126068 100644 --- a/pandora_console/godmode/agentes/alert_manager.php +++ b/pandora_console/godmode/agentes/alert_manager.php @@ -307,8 +307,7 @@ $(document).ready (function () { $("a.template_details").cluetip ({ arrows: true, attribute: 'href', - cluetipClass: 'default', - fx: { open: 'fadeIn', openSpeed: 'slow' }, + cluetipClass: 'default' }).click (function () { return false; });; diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index a7ea1e69d7..c8c82b0b00 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -65,7 +65,8 @@ if (isset ($_GET["submit"])) { if ($id_as < 1) { $sql = sprintf ("INSERT INTO talert_snmp - (id_alert, al_field1, al_field2, al_field3, description, alert_type, agent, custom_oid, oid, time_threshold, max_alerts, min_alerts, priority) + (id_alert, al_field1, al_field2, al_field3, description, alert_type, + agent, custom_oid, oid, time_threshold, max_alerts, min_alerts, priority) VALUES (%d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d) ", $alert_type, $al_field1, $al_field2, $al_field3, $description, $alert_trigger, $source_ip, $custom_value, $oid, $time_threshold, $max_alerts, $min_alerts, $priority); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 9eb0eca697..42a72ed140 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -697,109 +697,6 @@ function get_alert_times ($row2) { return substr ($time_from_table, 0, 5)." - ".substr ($time_to_table, 0, 5); } -/** - * @deprecated This should be replaced with print_table and format_alert_row - */ -function show_alert_row_edit ($row2, $tdcolor = "datos", $id_tipo_modulo = 1, $combined = 0){ - global $config; - global $lang_label; - - $string = ""; - if ($row2["disable"] == 1){ - $string .= "".__('Disabled').""; - } elseif ($id_tipo_modulo != 0) { - $string .= ""; - } else { - $string .= "--"; - } - - if (isset($row2["operation"])){ - $string = $string."".$row2["operation"]; - } else { - $string = $string."".get_db_sql("SELECT nombre FROM talerta WHERE id_alerta = ".$row2["id_alerta"]); - } - - $string = $string."".human_time_description($row2["time_threshold"]); - if ($row2["dis_min"]) { - $mytempdata = fmod($row2["dis_min"], 1); - if ($mytempdata == 0) - $mymin = intval($row2["dis_min"]); - else - $mymin = $row2["dis_min"]; - $mymin = format_for_graph($mymin ); - } else { - $mymin = 0; - } - - - if ($row2["dis_max"]!=0){ - $mytempdata = fmod($row2["dis_max"], 1); - if ($mytempdata == 0) - $mymax = intval($row2["dis_max"]); - else - $mymax = $row2["dis_max"]; - $mymax = format_for_graph($mymax ); - } else { - $mymax = 0; - } - - - // We have alert text ? - if ($row2["alert_text"]!= "") { - $string = $string."".__('Text').""; - } else { - $string = $string."".$mymin.""; - $string = $string."".$mymax.""; - } - - // Alert times - $string = $string.""; - $string .= get_alert_times ($row2); - - // Description - $string = $string."".salida_limpia ($row2["descripcion"]); - - // Has recovery notify activated ? - if ($row2["recovery_notify"] > 0) - $recovery_notify = __('Yes'); - else - $recovery_notify = __('No'); - - // calculate priority - $priority = get_alert_priority ($row2["priority"]); - - // calculare firing conditions - if ($row2["alert_text"] != "") { - $firing_cond = __('Text')." (".substr($row2["alert_text"],0,12).")"; - } else { - $firing_cond = $row2["min_alerts"]." / ".$row2["max_alerts"]; - } - // calculate days - $firing_days = get_alert_days ( $row2 ); - - // More details EYE tooltip - $string = $string.""; - $string.= ""; - - // Add float info table - $string.= " - - - - - - - - - - -
".__('Recovery')."
$recovery_notify
".__('Priority')."
$priority
".__('Alert Ctrl.')."
".$firing_cond."
".__('Firing days')."
".$firing_days."
"; - - return $string; -} - /** * Get report types in an array. * diff --git a/pandora_console/operation/agentes/estado_grupo.php b/pandora_console/operation/agentes/estado_grupo.php index 5948973466..76dbcd8848 100644 --- a/pandora_console/operation/agentes/estado_grupo.php +++ b/pandora_console/operation/agentes/estado_grupo.php @@ -104,14 +104,14 @@ foreach ($groups as $id_group => $group_name) { if ($config["show_lastalerts"] == 1) { // How many alerts has been fired recently for this group: // SQL Join to get alert status for agents belong this group - $sql = sprintf ("SELECT SUM(talerta_agente_modulo.times_fired) - FROM tagente_modulo, talerta_agente_modulo, tagente + $sql = sprintf ("SELECT SUM(talert_template_modules.times_fired) + FROM tagente_modulo, talert_template_modules, tagente WHERE tagente.disabled = 0 AND tagente.id_grupo = %d AND tagente.id_agente = tagente_modulo.id_agente - AND talerta_agente_modulo.id_agente_modulo = tagente_modulo.id_agente_modulo", + AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo", $id_group); - $group_info["alerts"] = 0 + get_db_sql ($sql); + $group_info["alerts"] = (int) get_db_sql ($sql); } array_push ($groups_info, $group_info); } @@ -249,4 +249,4 @@ for ($table = 0; $table < $ancho; $table++) { } echo ""; -?> \ No newline at end of file +?> diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 48ce79d196..898be2f949 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -110,14 +110,14 @@ function create_node ($agent, $simple = 0, $font_size = 10) { } // Check for alert - $sql = sprintf ('SELECT COUNT(talerta_agente_modulo.id_aam) - FROM talerta_agente_modulo, tagente_modulo, tagente + $sql = sprintf ('SELECT COUNT(talert_template_modules.id) + FROM talert_template_modules, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 - AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo - AND talerta_agente_modulo.times_fired > 0 ', + AND tagente_modulo.id_agente_modulo = talert_template_modules.id_agent_module + AND talert_template_modules.times_fired > 0 ', $agent['id_agente']); $alert_modules = get_db_sql ($sql); if ($alert_modules) @@ -394,8 +394,7 @@ $(document).ready (function () { $("area[title!='']").cluetip ({ arrows: true, attribute: 'title', - cluetipClass: 'default', - fx: { open: 'fadeIn', openSpeed: 'slow' }, + cluetipClass: 'default' }); }); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 24f423712a..bbe72e488f 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -92,18 +92,26 @@ if (defined ('AJAX')) { } // Alerts (if present) - $sql = sprintf ('SELECT COUNT(talerta_agente_modulo.id_aam) - FROM talerta_agente_modulo, tagente_modulo, tagente + $sql = sprintf ('SELECT COUNT(talert_template_modules.id) + FROM talert_template_modules, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 - AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo - AND talerta_agente_modulo.times_fired > 0 ', + AND tagente_modulo.id_agente_modulo = talert_template_modules.id_agent_module + AND talert_template_modules.times_fired > 0 ', $id_agent); $alert_modules = get_db_sql ($sql); if ($alert_modules > 0){ - $sql = sprintf ('SELECT tagente_modulo.nombre, talerta_agente_modulo.last_fired FROM talerta_agente_modulo, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.times_fired > 0 ', $id_agent); + $sql = sprintf ('SELECT tagente_modulo.nombre, talert_template_modules.last_fired + FROM talert_template_modules, tagente_modulo, tagente + WHERE tagente.id_agente = %d + AND tagente.disabled = 0 + AND tagente.id_agente = tagente_modulo.id_agente + AND tagente_modulo.disabled = 0 + AND tagente_modulo.id_agente_modulo = talert_template_modules.id_agent_module + AND talert_template_modules.times_fired > 0 ', + $id_agent); $alerts = get_db_all_rows_sql ($sql); echo ''.__('Alerts fired').':'; echo "