diff --git a/pandora_console/AUTHORS b/pandora_console/AUTHORS index 292d0a4ff7..17ce7bc5a9 100644 --- a/pandora_console/AUTHORS +++ b/pandora_console/AUTHORS @@ -1,3 +1,9 @@ Sancho Lerena +Esteban Sanchez Jorge Gonzalez Raul Mateos +Ramon Novoa + +See full list of contributors on: + +http://www.pandorafms.org diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 89c6daafd4..806003766b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,49 @@ +2008-07-25 Sancho Lerena + + * pandoradb.sql: Added new tables for planned downtimes. + + * godmode/menu.php: Added entry for manage downtimes. + + * group_list.php: Stetic changes in table. + + * modificar_server.php: Fixed timestamp render for start/update + timestamp of each server. + + * functions.php: Minimal estetic changes in help function. + + * functions_db.php: Change header (Flexible <- Free) + + * functions_html.php: Now select admits multiselect option. Default + class for table render is now databox not databox_color. + + * AUTHORS: Update list of authors and make a reference to contributors. + + * function_reporting.php: Header change, updated datetime string format. + + * language_en.php, language_es_es.php: Changed FREE for Flexible. + + * pandora.css: Minimal changes. Update color of Monitor count in tactical. + + * menu.php: Added some new event options: CSV Export, RSS and new marquee + event visualizer. + + * estado_ultimopaquete.php: Header update. + + * tactical.php: Added link to data module alerts. + + * ver_agente.php: Fixed a problem in ajax code that was rending bad + count of down monitors. Using boolean comparation on result of function + get_db_sql(). This kind problem could be in more lines of code. + + * events.php: New quicklinks to RSS, CSV and Marquee in event viewer. + + * export_csv.php, events_rss.php: Fixed duped call to function includes. + + * graph_viewer.php: I hope this fix FINALLY the annoying bug of graph + type selector. + + * visual_console/index.php: Updated header. + 2008-07-22 Evi Vanoost * operation/messages/message.php: Rewrote large parts of the script Simplified functions. Fixed a bug where group messages sent a message diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 00fc2136ed..104dc713e2 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -109,7 +109,7 @@ if ($delete_group) { echo "

".lang_string ("group_management")." > "; echo lang_string ("definedgroups")."

"; -$table->width = '400px'; +$table->width = '65%'; $table->head = array (); $table->head[0] = lang_string ("icon"); $table->head[1] = lang_string ("name"); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 312a5b94fa..011dc63507 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -63,6 +63,17 @@ if (comprueba_login() == 0){ echo ""; } + + // Planned downtimes + if ((give_acl($id_user, 0, "AW")==1)){ + if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/agentes/planned_downtime" || $_GET["sec2"] == "godmode/agentes/planned_downtime")){ + echo "
"; + } + else + echo ""; + } + } } diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 3061cc4b53..8a63001274 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -1,16 +1,8 @@ -// Additions to Pandora FMS 1.2 graph code and new XML reporting template management -// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -22,34 +14,40 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + // Load global vars require("include/config.php"); -if (comprueba_login() == 0) { - if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) { +check_login(); - if (isset($_GET["delete"])) { - $id_server=entrada_limpia($_GET["server_del"]); - $sql = "DELETE FROM tserver WHERE id_server='".$id_server."'"; - $result=mysql_query($sql); - if ($result) echo "

".$lang_label["del_server_ok"]."

"; - else echo "

".$lang_label["del_server_no"]."

"; - } - - if (isset($_GET["update"])) { - $name=entrada_limpia($_POST["name"]); - $address=entrada_limpia($_POST["address"]); - $description=entrada_limpia($_POST["description"]); - $id_server=entrada_limpia($_POST["server"]); - $sql = "UPDATE tserver SET name='".$name."', ip_address='".$address."', description='".$description."' WHERE id_server='".$id_server."'"; - $result=mysql_query($sql); - if ($result) echo "

".$lang_label["upd_server_ok"]."

"; - else echo "

".$lang_label["upd_server_no"]."

"; - } - if (isset($_GET["server"])) { - $id_server=entrada_limpia($_GET["server"]); - echo "

".$lang_label["view_servers"]." > "; - echo $lang_label["update_server"]."

"; +if ((give_acl($config["id_user"], 0, "AR")!=1) AND (give_acl($id_user, 0, "AW") != 1)) { + audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access Server Management"); + require ("general/noaccess.php"); +} + +if (isset($_GET["delete"])) { + $id_server=entrada_limpia($_GET["server_del"]); + $sql = "DELETE FROM tserver WHERE id_server='".$id_server."'"; + $result=mysql_query($sql); + if ($result) echo "

".$lang_label["del_server_ok"]."

"; + else echo "

".$lang_label["del_server_no"]."

"; +} + +if (isset($_GET["update"])) { + $name=entrada_limpia($_POST["name"]); + $address=entrada_limpia($_POST["address"]); + $description=entrada_limpia($_POST["description"]); + $id_server=entrada_limpia($_POST["server"]); + $sql = "UPDATE tserver SET name='".$name."', ip_address='".$address."', description='".$description."' WHERE id_server='".$id_server."'"; + $result=mysql_query($sql); + if ($result) echo "

".$lang_label["upd_server_ok"]."

"; + else echo "

".$lang_label["upd_server_no"]."

"; +} + +if (isset($_GET["server"])) { + $id_server=entrada_limpia($_GET["server"]); + echo "

".$lang_label["view_servers"]." > "; + echo $lang_label["update_server"]."

"; $query="SELECT * FROM tserver WHERE id_server=".$id_server; $result=mysql_query($query); @@ -75,20 +73,18 @@ if (comprueba_login() == 0) { } else { echo "
".$lang_label["no_server"]."
"; - } + } echo ''; echo ''; echo '
'; echo '
'; - } - else - { +} +else { + $sql='SELECT * FROM tserver'; - echo "

".$lang_label["view_servers"]." > "; echo $lang_label["manage_servers"]."

"; - // Connect DataBase $result=mysql_query($sql); if (mysql_num_rows($result)){ echo ""; @@ -150,8 +146,9 @@ if (comprueba_login() == 0) { if ($checksum == 1){ echo "  "; } - echo ""; + echo ""; echo ""; + echo ""; echo ""; @@ -180,12 +177,7 @@ if (comprueba_login() == 0) { } else { echo "
".$lang_label["no_server"]."
"; - } } +} -} else { - audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view"); - require ("general/noaccess.php"); -} -} ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 36620ba7eb..caef82cfcd 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1,7 +1,7 @@ [H]"; + $output = " [H]"; if ($return) return $output; echo $output; diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index ac2ac34297..017abb637a 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1,6 +1,6 @@ // Copyright (c) 2005-2008 Artica Soluciones Tecnologicas @@ -1333,7 +1333,7 @@ function get_db_sql ($sql, $field = 0) { * false in case of empty result */ function get_db_all_rows_sql ($sql) { - $return = process_sql($sql); + $return = process_sql ($sql); if (! empty ($return)) return $return; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 36435e35a9..86a1fa68aa 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1,6 +1,6 @@ \n"; if ($nothing != '') { @@ -79,7 +83,7 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing = * $nothing Label when nothing is selected. * $nothing_value Value when nothing is selected */ -function print_select_from_sql ($sql, $name, $selected = '', $script = '', $nothing = 'select', $nothing_value = '0', $return = false) { +function print_select_from_sql ($sql, $name, $selected = '', $script = '', $nothing = 'select', $nothing_value = '0', $return = false, $multiple = false) { $fields = array (); $result = mysql_query ($sql); @@ -92,7 +96,7 @@ function print_select_from_sql ($sql, $name, $selected = '', $script = '', $noth $fields[$row[0]] = $row[1]; } - $output = print_select ($fields, $name, $selected, $script, $nothing, $nothing_value, true); + $output = print_select ($fields, $name, $selected, $script, $nothing, $nothing_value, true, $multiple); if ($return) return $output; @@ -319,7 +323,7 @@ function print_table ($table, $return = false) { } if (empty ($table->class)) { - $table->class = 'databox_color'; + $table->class = 'databox'; } $tableid = empty ($table->id) ? 'table'.$table_count : $table->id; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a3796ad887..9bd62bab5a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1,7 +1,7 @@
Please know that all attempts to access this page are recorded in security logs of Pandora System Database"; -$lang_label["header_title"]="Free Monitoring System"; +$lang_label["header_title"]="the Flexible Monitoring System"; -$lang_label["gpl_notice"]="is a Free Software Project, licensed under GPL terms"; +$lang_label["gpl_notice"]="is a OpenSource Software Project, licensed under GPL terms"; $lang_label["gpl_used"]="Designed using GPL software and tools"; $lang_label["gen_date"]="Page generated at"; diff --git a/pandora_console/include/languages/language_es_es.php b/pandora_console/include/languages/language_es_es.php index 1a86fc9866..8b74aab987 100644 --- a/pandora_console/include/languages/language_es_es.php +++ b/pandora_console/include/languages/language_es_es.php @@ -79,9 +79,9 @@ $lang_label["field2"]="Campo #2 (Línea sencilla)"; $lang_label["field3"]="Campo #3 (Texto completo)"; $lang_label["no_access_title"]="No tiene permiso para acceder a esta página"; $lang_label["no_access_text"]="El acceso a esta página está restringido a usuarios autorizados, contacte con el administrador del sistema si necesita ayuda.

Todos los intentos de acceso a esta página son grabados en los logs de seguridad de Pandora FMS"; -$lang_label["header_title"]="Sistema Libre de Monitorización"; +$lang_label["header_title"]="el Sistema Flexible de Monitorización"; -$lang_label["gpl_notice"]="es un Proyecto de Software Libre bajo licencia GPL"; +$lang_label["gpl_notice"]="es un Proyecto OpenSource bajo licencia GPL"; $lang_label["gpl_used"]="Desarrollado utilizando herramientas y software GPL"; $lang_label["gen_date"]="Página generada el "; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 132162b904..f5a2817d74 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -661,7 +661,7 @@ span#logo_text2 { } td.datos_green, td.datos_greenf9 { - background-color: #C7EAD5; + background-color: #BBFFA4; padding: 5px 5px 5px 5px; } @@ -681,7 +681,7 @@ td.datos_blue, td.datos_bluef9 { } td.datos_grey, td.datos_greyf9 { - background-color: #DCDCDC; + background-color: #E4E4E4; padding: 5px 5px 5px 5px; } @@ -752,4 +752,5 @@ td.big_data { a.big_data { text-decoration: none; font: bold 1em Arial, Sans-serif; + color: #000; } diff --git a/pandora_console/index.php b/pandora_console/index.php index cad3cb139d..7f69c5ca88 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1,8 +1,8 @@ 20) AND ($row3["id_tipo_modulo"] < 100)){ echo human_time_comparation($row3["timestamp"]); } else { diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 4b1b097c19..9face58bc5 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -1,7 +1,7 @@ "; $data = general_stats ($id_user,-1); $monitor_checks = $data[0]; $monitor_ok = $data[1]; + $monitor_bad = $data[2]; $monitor_unknown = $data[3]; $monitor_alert = $data[4]; @@ -106,7 +107,7 @@ echo "

"; echo ""; echo ""; echo ""; -echo ""; @@ -181,11 +182,16 @@ if ($data_not_init > 0) else echo "-"; echo ""; -echo "
".substr($keepalive,0,25)."".substr($laststart,0,25)."".substr($keepalive,0,25)."
".lang_string ("monitor_checks")."
"."Monitor checks".""; +echo ""; echo ""; echo $monitor_checks."
"."Alerts Fired".""; + + +echo ""; +echo ""; if ($data_alert > 0) echo $data_alert; else echo "-"; +echo ""; + echo "
"."Alerts Total"; echo "".$data_alert_total; diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 97db028553..54b85cd058 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -53,7 +53,7 @@ if (defined ('AJAX')) { echo ''.lang_string ('Last remote contact').': '.human_time_comparation($agent['ultimo_contacto_remoto']).'
'; $sql = sprintf ('SELECT tagente_modulo.descripcion, tagente_modulo.nombre - FROM tagente_estado, tagente_modulo + FROM tagente_estado, tagente_modulo WHERE tagente_modulo.id_agente = %d AND tagente_modulo.id_tipo_modulo in (2, 6, 9, 18, 21, 100) AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo @@ -63,12 +63,18 @@ if (defined ('AJAX')) { $sql = sprintf ('SELECT COUNT(*) FROM tagente_modulo WHERE id_agente = %d + AND disabled = 0 AND id_tipo_modulo in (2, 6, 9, 18, 21, 100)', $id_agent); $total_modules = get_db_sql ($sql); + if ($bad_modules === false) + $size_bad_modules = 0; + else + $size_bad_modules = sizeof ($bad_modules); + // Modules down - if (sizeof ($bad_modules)) { - echo ''.lang_string ('Monitors down').': '.sizeof ($bad_modules).' / '.$total_modules; + if ($size_bad_modules > 0) { + echo ''.lang_string ('Monitors down').': '.$size_bad_modules.' / '.$total_modules; echo '
    '; foreach ($bad_modules as $module) { echo '
  • '; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 38dbaeca38..cb3c2915ef 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1,6 +1,6 @@ ".$lang_label["events"]." > ".lang_string ("event_main_view"). "&nb if ($config["pure"] == 1) echo ""; -else +else { + // Fullscreen echo ""; +} echo ""; echo ""; @@ -250,8 +252,15 @@ echo ""; echo "
"; echo ""; echo "   "; + +// CSV echo ""; -echo ""; +echo ""; +// Marquee +echo " "; +// RSS +echo " "; + echo "
"; echo ""; diff --git a/pandora_console/operation/events/events_rss.php b/pandora_console/operation/events/events_rss.php index 66b7a39050..25ae3166cc 100644 --- a/pandora_console/operation/events/events_rss.php +++ b/pandora_console/operation/events/events_rss.php @@ -1,5 +1,5 @@ -// Additions to Pandora FMS 1.2 graph code +// CSS and some PHP additions // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // This program is free software; you can redistribute it and/or @@ -178,6 +176,27 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { echo "
"; } + // Event RSS + if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){ + echo "
"; + echo "
"; + } + + // Event CSV + if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){ + echo "
"; + echo "
"; + } + + // Event Marquee + if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){ + echo "
"; + echo "
"; + } + // Users if(isset($_GET["sec2"]) && ($_GET["sec2"] == "operation/users/user" || $_GET["sec2"] == "operation/users/user_edit" )) { echo '
'; diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index 59386d8e60..92a943be7c 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -83,9 +83,10 @@ if (isset($_GET["view_graph"])){ $period = 3600 * $period; $events = $row["events"]; $description = $row["description"]; - $stacked = (int) get_parameter ('stacked'); - if (! $stacked) + $stacked = (int) get_parameter ('stacked', -1); + if ($stacked == -1) $stacked = $row["stacked"]; + $name = $row["name"]; if (($row["private"]==1) && ($row["id_user"] != $id_user)){ @@ -139,10 +140,11 @@ border=1 alt=''>"; echo ""; $stackeds = array (); + $stackeds[0] = lang_string ('Graph defined'); $stackeds[0] = lang_string ('Area'); $stackeds[1] = lang_string ('Stacked area'); $stackeds[2] = lang_string ('Line'); - print_select ($stackeds, 'stacked', $stacked , '', '', 0); + print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false); echo ""; $zooms = array(); diff --git a/pandora_console/operation/visual_console/index.php b/pandora_console/operation/visual_console/index.php index f9dca6b714..a9b52a6c15 100644 --- a/pandora_console/operation/visual_console/index.php +++ b/pandora_console/operation/visual_console/index.php @@ -1,10 +1,10 @@