diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 465b972ecd..a573a3692a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,12 +1,16 @@ 2007-01-09 Raul Mateos + * godmode/agentes/configurar_agente.php; Style correction. Solve small + bug not showing any table if no alert defined. + + * include/config.php: Add some comments and change order of error reporting + function. + * include/languages/*.php: New file for german language. Some updates for the rest of files. * pandoradb_data.sql: Add entry for german language. -2007-01-09 Raul Mateos - * operation/menu.php: Style correction (not enough). * include/op.css: Solve small bug with hover in reporting icon. diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 6fa39c9e05..098ec76050 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -480,12 +480,26 @@ if (give_acl($id_user, 0, "AW")==1) { $snmp_oid = $combo_snmp_oid; } } - $sql_update = "UPDATE tagente_modulo SET max ='".$modulo_max."', min = '".$modulo_min."', nombre='".$nombre."', descripcion='".$descripcion."', tcp_send = '$tcp_send', tcp_rcv = '$tcp_rcv', tcp_port = '$tcp_port', ip_target = '$ip_target', snmp_oid = '$snmp_oid', snmp_community = '$snmp_community', id_module_group = '$id_module_group', module_interval = '$module_interval' WHERE id_agente_modulo = ".$id_agente_modulo; + $sql_update = "UPDATE tagente_modulo + SET max ='".$modulo_max."', + min = '".$modulo_min."', + nombre='".$nombre."', + descripcion='".$descripcion."', + tcp_send = '$tcp_send', + tcp_rcv = '$tcp_rcv', + tcp_port = '$tcp_port', + ip_target = '$ip_target', + snmp_oid = '$snmp_oid', + snmp_community = '$snmp_community', + id_module_group = '$id_module_group', + module_interval = '$module_interval' + WHERE id_agente_modulo = ".$id_agente_modulo; $result=mysql_query($sql_update); - if (! $result) + if (! $result) { echo "

".$lang_label["update_module_no"]."

"; - else + } else { echo "

".$lang_label["update_module_ok"]."

"; + } // Init vars to null to avoid trash in forms $id_tipo_modulo = "";$nombre = "";$descripcion = "";$modulo_max = ""; $modulo_min = "";// Pandora 1.2 new module data: @@ -500,12 +514,11 @@ if (give_acl($id_user, 0, "AW")==1) { // ========================================================= if (isset($_POST["oid"])){ snmp_set_quick_print(1); -//echo "DEBUG snmpreadwalk call() $ip_target $snmp_community
"; - if (! ($snmpwalk = snmprealwalk($ip_target, $snmp_community, ""))) + if (! ($snmpwalk = snmprealwalk($ip_target, $snmp_community, ""))) { echo "

".$lang_label["cannot_read_snmp"]."

"; - else + } else { echo "

".$lang_label["ok_read_snmp"]."

"; -//echo "DEBUG $snmpwalk
"; + } } @@ -553,8 +566,7 @@ if (give_acl($id_user, 0, "AW")==1) { VALUES ( $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."' )"; - } - else { + } else { $sql_insert = "INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,cambio,estado,id_agente) VALUES ( @@ -562,10 +574,11 @@ if (give_acl($id_user, 0, "AW")==1) { )"; } $result2=mysql_query($sql_insert); - if ((! $result) || (! $result2)) + if ((! $result) || (! $result2)) { echo "

".$lang_label["add_module_no"]."

"; - else + } else { echo "

".$lang_label["add_module_ok"]."

"; + } } // MODULE DELETION // ================= @@ -592,10 +605,11 @@ if (give_acl($id_user, 0, "AW")==1) { $sql_delete= "DELETE FROM tagente_modulo WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); - if (! $result) + if (! $result) { echo "

".$lang_label["delete_module_no"]."

"; - else + } else { echo "

".$lang_label["delete_module_ok"]."

"; + } // Then delete all staus $sql_delete = "DELETE FROM tagente_estado WHERE id_agente_modulo = ".$id_borrar_modulo; @@ -629,9 +643,9 @@ if (isset($_GET["creacion"])){ } echo '
'; -if ($creacion_agente == 1) +if ($creacion_agente == 1) { echo ""; -else { +} else { echo ""; echo ""; } @@ -643,10 +657,11 @@ echo ''.$lang_label["agent_name"].' if (isset($_GET["creacion"])){ echo " "; } else { - echo "  -   "; } @@ -807,7 +822,7 @@ if ( $creacion_agente != 1) { echo " N/A"; } - echo "".substr($descripcion,0,30).""; + echo "".substr($descripcion,0,30).""; echo "". substr(dame_nombre_grupomodulo($module_group2),0,15).""; echo ""; @@ -858,7 +873,9 @@ $result=mysql_query($sql1); $row2=mysql_fetch_array($result2); //module type modulo is $row2["nombre"]; - $sql3='SELECT * FROM talerta_agente_modulo + $sql3='SELECT id_aam, id_alerta, time_threshold, dis_min, dis_max, + descripcion + FROM talerta_agente_modulo WHERE id_agente_modulo = '.$row["id_agente_modulo"]; // From all the alerts give me which are from my agent $result3=mysql_query($sql3); while ($row3=mysql_fetch_array($result3)){ @@ -869,7 +886,7 @@ $result=mysql_query($sql1); $tdcolor="datos2"; $color =1; } - $sql4='SELECT * FROM talerta WHERE id_alerta = '.$row3["id_alerta"]; + $sql4='SELECT nombre FROM talerta WHERE id_alerta = '.$row3["id_alerta"]; $result4=mysql_query($sql4); $row4=mysql_fetch_array($result4); // Alert name defined by $row4["nombre"]; @@ -892,9 +909,10 @@ $result=mysql_query($sql1); id_agente=".$id_agente."&update_alert=".$row3["id_aam"]."#alerts'> ".$lang_label["update"].""; } + $string = $string.""; } } - if (isset($string)) { + if (isset($string) & $string!='') { echo " @@ -904,10 +922,12 @@ $result=mysql_query($sql1); "; echo $string; echo "
".$lang_label["name_type"]." ".$lang_label["alert"]."".$lang_label["action"]."
"; + } else { + echo "
".$lang_label["no_alerts"]."
"; } - else echo "
".$lang_label["no_alerts"]."
"; + } else { + echo "
".$lang_label["no_modules"]."
"; } - else echo "
".$lang_label["no_modules"]."
"; ?>
@@ -945,10 +965,9 @@ else { if ($update_module == "1") { echo ""; echo "".$lang_label["no_change_field"].""; - } -else { +} else { echo ''; -else { +} else { echo ''; echo ' @@ -1132,17 +1151,17 @@ while ($row=mysql_fetch_array($result)){ '; - $sql2='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente; + $sql2='SELECT id_agente_modulo, id_tipo_modulo, nombre FROM tagente_modulo WHERE id_agente = '.$id_agente; $result2=mysql_query($sql2); while ($row2=mysql_fetch_array($result2)){ if ($row2["id_tipo_modulo"] != -1) { - $sql1='SELECT * FROM ttipo_modulo WHERE id_tipo = '.$row2["id_tipo_modulo"]; + $sql1='SELECT nombre FROM ttipo_modulo WHERE id_tipo = '.$row2["id_tipo_modulo"]; $result=mysql_query($sql1); while ($row=mysql_fetch_array($result)){ echo ""; } echo ""; } else { diff --git a/pandora_console/include/config.php b/pandora_console/include/config.php index c185a61c77..619cf4215c 100644 --- a/pandora_console/include/config.php +++ b/pandora_console/include/config.php @@ -33,11 +33,11 @@ $attachment_store="/var/www/pandora_console"; //This is directory where placed " $config_fontpath = "../reporting/FreeSans.ttf"; // Change this to your font folder, if needed. // Do not display any ERROR -// error_reporting(0); - -// Display all errores, warnings and notices -// error_reporting(E_ALL); error_reporting(0); + +// Uncomment next to Display all errors, warnings and notices +// error_reporting(E_ALL); + // Read rest of config from DB if (! mysql_connect($dbhost,$dbuser,$dbpassword)){ //Non-persistent connection. If you want persistent conn change it to mysql_pconnect()