From 145ca40616d99ebaf6f5596606c5ec4bfba0eb52 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 19 Apr 2007 18:50:07 +0000 Subject: [PATCH] 2007-04-19 Sancho Lerena * pandora.css: added some classes for graphical input buttons. * languages/language_en.php: More strings to go ! * include/config.php: Deleted from repo, now has no sense. * pandoradb.sql: Added `alert_text` to talerta_agent for new text alerts. Added tables for custom graphs and reporting: tgraph, tgraph_source, treport, and treport_content. * operation/users/user.php: Fixed problem with last Raul's commit. * godmode/usuarios/lista_usuarios.php: Fixed problem with last Raul's commit. * operation/agentes/estado_alertas.php: Code cleanup. Implemented render for text alerts. * operation/agentes/datos_agente.php: Fixed small bug with text output. * operation/agentes/datos_agente_calendar.php: Added contribution from Leandro Doctors. Need to work on it before use several problems detected. * operation/servers/view_server.php: Fixed some bugs. * operation/reporting/graph_viewer.php: Added viewer for custom graphs. * operation/reporting/custom_reporting.php: Initial code, not finished yet. * operation/reporting/graph_builder.php: Work for modules in the same agent, several problems, but works. * operation/menu.php: Updated options for new reporting menu. * reporting/stat_win.php: New menu is great :-) * general/login_page.php: Updated login page. * godmode/agentes/alert_manager.php, configurar_agente.php: New code for text alerts and better user help. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@433 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 45 ++ pandora_console/general/login_page.php | 2 +- .../godmode/agentes/alert_manager.php | 80 ++-- .../godmode/agentes/configurar_agente.php | 34 +- .../godmode/usuarios/lista_usuarios.php | 14 +- pandora_console/include/config.php | 108 ----- .../include/languages/language_en.php | 12 + pandora_console/include/styles/pandora.css | 21 +- .../operation/agentes/datos_agente.php | 2 +- .../agentes/datos_agente_calendar.php | 270 ++++++++++++ .../operation/agentes/estado_alertas.php | 395 ++++++++++-------- pandora_console/operation/menu.php | 19 +- .../operation/reporting/custom_reporting.php | 149 +++++++ .../operation/reporting/graph_builder.php | 265 ++++++++---- .../operation/reporting/graph_viewer.php | 153 +++++++ .../operation/servers/view_server.php | 5 +- pandora_console/operation/users/user.php | 2 +- pandora_console/pandoradb.sql | 45 +- pandora_console/reporting/stat_win.php | 5 +- 19 files changed, 1210 insertions(+), 416 deletions(-) delete mode 100644 pandora_console/include/config.php create mode 100644 pandora_console/operation/agentes/datos_agente_calendar.php create mode 100644 pandora_console/operation/reporting/custom_reporting.php create mode 100644 pandora_console/operation/reporting/graph_viewer.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index dd5b732fd1..2cee6011d2 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,48 @@ +2007-04-19 Sancho Lerena + + * pandora.css: added some classes for graphical input buttons. + + * languages/language_en.php: More strings to go ! + + * include/config.php: Deleted from repo, now has no sense. + + * pandoradb.sql: Added `alert_text` to talerta_agent for new text + alerts. Added tables for custom graphs and reporting: tgraph, + tgraph_source, treport, and treport_content. + + * operation/users/user.php: Fixed problem with last Raul's commit. + + * godmode/usuarios/lista_usuarios.php: Fixed problem with last + Raul's commit. + + * operation/agentes/estado_alertas.php: Code cleanup. Implemented + render for text alerts. + + * operation/agentes/datos_agente.php: Fixed small bug with text output. + + * operation/agentes/datos_agente_calendar.php: Added contribution + from Leandro Doctors. Need to work on it before use several + problems detected. + + * operation/servers/view_server.php: Fixed some bugs. + + * operation/reporting/graph_viewer.php: Added viewer for custom graphs. + + * operation/reporting/custom_reporting.php: Initial code, not + finished yet. + + * operation/reporting/graph_builder.php: Work for modules in the + same agent, several problems, but works. + + * operation/menu.php: Updated options for new reporting menu. + + * reporting/stat_win.php: New menu is great :-) + + * general/login_page.php: Updated login page. + + * godmode/agentes/alert_manager.php, configurar_agente.php: New + code for text alerts and better user help. + 2007-04-18 Raul Mateos * pandoradb_data.sql, pandoradb.sql: Fixed small warnings. diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index da50dc9205..2bd0b71f9a 100644 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -28,7 +28,7 @@
Password
-
+
diff --git a/pandora_console/godmode/agentes/alert_manager.php b/pandora_console/godmode/agentes/alert_manager.php index d605798d9e..02ac7ee4b8 100644 --- a/pandora_console/godmode/agentes/alert_manager.php +++ b/pandora_console/godmode/agentes/alert_manager.php @@ -43,10 +43,10 @@ $result=mysql_query($sql1); $row2=mysql_fetch_array($result2); //module type modulo is $row2["nombre"]; - $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 + $sql3='SELECT * + 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)){ if ($color == 1){ @@ -79,8 +79,11 @@ $result=mysql_query($sql1); else $mymax = $row3["dis_max"]; $mymax = format_for_graph($mymax ); - - $string = $string."".$mymin." / ".$mymax; + // We have alert text ? + if ($row3["alert_text"] != "") + $string = $string."".$lang_label["text"]; + else + $string = $string."".$mymin." / ".$mymax; $string = $string."".salida_limpia($row3["descripcion"]); $string = $string.""; $id_grupo = dame_id_grupo($id_agente); @@ -133,8 +136,8 @@ if ($update_alert != 1) { } ?> - -"; echo ""; - echo ""; echo ""; echo "
+ +'; echo '
    -
- -
- -
- -
- -
- + + +
  +Regular Expression Supported + + + +
+ + +
  +Macros:
+_agent_
+_timestamp_
+_data_
+
+
+
  +Macros:
+_agent_
+_timestamp_
+_data_
+
+
+
  +Macros:
+_agent_
+_timestamp_
+_data_
+
+
+
+
- +
+     -
- - + + '; $sql2='SELECT id_agente_modulo, id_tipo_modulo, nombre FROM tagente_modulo WHERE id_agente = '.$id_agente; $result2=mysql_query($sql2); @@ -222,12 +250,10 @@ while ($row=mysql_fetch_array($result)){ echo '
'; if ($update_alert== "1"){ - echo ''; + echo ''; } else { - echo ''; + echo ''; } echo ''; - - echo "
"; echo '
'; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 5d1824e133..1a3fc4a56a 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -81,6 +81,7 @@ $snmp_community=""; $combo_snmp_oid=""; $agent_created_ok = 0; $create_agent = 0; +$alert_text = ""; // ================================ // Create AGENT @@ -200,6 +201,7 @@ if (isset($_POST["insert_alert"])){ // if created alert $maximo = entrada_limpia($_POST["maximo"]); $minimo = entrada_limpia($_POST["minimo"]); $tipo_alerta = entrada_limpia($_POST["tipo_alerta"]); + $alert_text = entrada_limpia($_POST["alert_text"]); $time_threshold = entrada_limpia($_POST["time_threshold"]); $max_alerts = entrada_limpia($_POST["max_alerts"]); $min_alerts = entrada_limpia($_POST["min_alerts"]); @@ -207,7 +209,21 @@ if (isset($_POST["insert_alert"])){ // if created alert if ($time_threshold == -1) { $time_threshold = $other; } - $sql_insert="INSERT INTO talerta_agente_modulo (id_agente_modulo,id_alerta,al_campo1,al_campo2,al_campo3,descripcion,dis_max,dis_min,time_threshold,max_alerts, min_alerts) VALUES ('".$id_agente_modulo."','".$tipo_alerta."','".$campo_1."','".$campo_2."','".$campo_3."','".$descripcion."','".$maximo."','".$minimo."','".$time_threshold."','".$max_alerts."','".$min_alerts."')"; + $sql_insert="INSERT INTO talerta_agente_modulo + (id_agente_modulo,id_alerta,al_campo1,al_campo2,al_campo3,descripcion,dis_max,dis_min,time_threshold,max_alerts, min_alerts, alert_text) VALUES + ('$id_agente_modulo', + '$tipo_alerta', + '$campo_1', + '$campo_2', + '$campo_3', + '$descripcion', + '$maximo', + '$minimo', + '$time_threshold', + '$max_alerts', + '$min_alerts', + '$alert_text')"; + $result=mysql_query($sql_insert); if (! $result) echo "

".$lang_label["create_alert_no"]."

"; @@ -234,11 +250,24 @@ if (isset($_POST["update_alert"])){ // Update an existing alert $max_alerts = entrada_limpia($_POST["max_alerts"]); $min_alerts = entrada_limpia($_POST["min_alerts"]); $other = entrada_limpia($_POST["other"]); + $alert_text = entrada_limpia($_POST["alert_text"]); if ($time_threshold == -1) { $time_threshold = $other; } - $sql_insert="UPDATE talerta_agente_modulo SET id_alerta = ".$tipo_alerta.", max_alerts = '".$max_alerts."', min_alerts = '".$min_alerts."' ,time_threshold = '".$time_threshold."' ,dis_min = '".$minimo."' ,dis_max = '".$maximo."' ,al_campo3 = '".$campo_3."' ,al_campo2 = '".$campo_2."' ,al_campo1 = '".$campo_1."' , descripcion = '".$descripcion."' WHERE id_aam = ".$id_aam; + $sql_insert="UPDATE talerta_agente_modulo SET + id_alerta = $tipo_alerta, + max_alerts = '$max_alerts', + min_alerts = '$min_alerts' , + time_threshold = '$time_threshold', + dis_min = '$minimo' , + dis_max = '$maximo' , + al_campo3 = '$campo_3' , + al_campo2 = '$campo_2' , + al_campo1 = '$campo_1' , + descripcion = '$descripcion', + alert_text = '$alert_text' + WHERE id_aam = ".$id_aam; $result=mysql_query($sql_insert); if (! $result) { echo "

".$lang_label["update_alert_no"]."

"; @@ -379,6 +408,7 @@ if (isset($_GET["update_alert"])){ $alerta_dis_max = $row["dis_max"]; $alerta_dis_min = $row["dis_min"]; $tipo_alerta = $row["id_alerta"]; + $alert_text = $row["alert_text"]; $alerta_max_alerts = $row["max_alerts"]; $alerta_min_alerts = $row["min_alerts"]; $alerta_time_threshold = $row["time_threshold"]; diff --git a/pandora_console/godmode/usuarios/lista_usuarios.php b/pandora_console/godmode/usuarios/lista_usuarios.php index 633f43a492..6534470fa2 100644 --- a/pandora_console/godmode/usuarios/lista_usuarios.php +++ b/pandora_console/godmode/usuarios/lista_usuarios.php @@ -48,11 +48,11 @@ $fecha_registro = ""; $color=1; while ($rowdup=mysql_fetch_array($resq1)){ - $name=$rowdup["id_usuario"]; - $nivel=$rowdup["nivel"]; - $real_name=$rowdup["nombre_real"]; - $comments=$rowdup["comentarios"]; - $fecha_registro =$rowdup["fecha_registro"]; + $name = $rowdup["id_usuario"]; + $nivel = $rowdup["nivel"]; + $real_name = $rowdup["nombre_real"]; + $comments = $rowdup["comentarios"]; + $fecha_registro = $rowdup["fecha_registro"]; if ($color == 1){ $tdcolor = "datos"; $color = 0; @@ -62,7 +62,7 @@ while ($rowdup=mysql_fetch_array($resq1)){ $color = 1; } echo "
"; - echo "".$name.""; + echo "".$name.""; echo "".$fecha_registro; echo ""; if ($nivel == 1) @@ -84,7 +84,7 @@ while ($rowdup=mysql_fetch_array($resq1)){ echo "".substr($real_name,0,16)."".$comments.""; + echo ""; } echo "
"; diff --git a/pandora_console/include/config.php b/pandora_console/include/config.php deleted file mode 100644 index d4f634377e..0000000000 --- a/pandora_console/include/config.php +++ /dev/null @@ -1,108 +0,0 @@ -Pandora Error - -
-
-
- -
-
-

Pandora Console Error DB-001

- Cannot connect with Database, please check your database setup in the - ./include/config.php file and read documentation.

- Probably any of your user/database/hostname values are incorrect or - database is not running.


- MySQL ERROR: '. mysql_error().' -
  -
-
'); -} -mysql_select_db($dbname); -$result2=mysql_query("SELECT * FROM tconfig"); -while ($row2=mysql_fetch_array($result2)){ - switch ($row2["token"]) { - case "language_code": $language_code=$row2["value"]; - break; - case "block_size": $block_size=$row2["value"]; - break; - case "days_purge": $days_purge=$row2["value"]; - break; - case "days_compact": $days_compact=$row2["value"]; - break; - case "graph_res": $config_graph_res=$row2["value"]; - break; - case "step_compact": $config_step_compact=$row2["value"]; - break; - case "truetype": $config_truetype=$row2["value"]; - break; - case "graph_order": $config_graph_order=$row2["value"]; - break; - case "bgimage": $config_bgimage=$row2["value"]; - break; - } -} -if ($language_code == 'ast_es') { - $help_code='ast'; - } -else $help_code = substr($language_code,0,2); -?> diff --git a/pandora_console/include/languages/language_en.php b/pandora_console/include/languages/language_en.php index 59d31a5ad2..18e834c2df 100644 --- a/pandora_console/include/languages/language_en.php +++ b/pandora_console/include/languages/language_en.php @@ -753,6 +753,18 @@ $lang_label["says"]="says"; $lang_label["delete_sel"]="Delete selected"; $lang_label["available_templates"]="Available templates"; $lang_label["assign"]="Assign"; + +$lang_label["graph_store"]="Custom graph store"; +$lang_label["private"]="Private"; +$lang_label["store"]="Store"; +$lang_label["store_graph_suc"]="Graph store successful"; +$lang_label["store_graph_error"]="Graph store error"; +$lang_label["custom_graph_viewer"]="Custom graph viewer"; +$lang_label["graph_name"]="Graph name"; +$lang_label["custom_graphs"]="Custom graphs"; +$lang_label["custom_reporting"]="Custom reporting"; +$lang_label["alert_text"]="Alert text"; +$lang_label["text"]="Text"; global $lang_label; global $help_label; ?> \ No newline at end of file diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 98d63e041a..9cf1fa13c6 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -211,13 +211,26 @@ input.sub { font-size: 11px; } input.next { - padding-right: 15px; - background: #e5e5e5 url(../../images/go.png) no-repeat right 2px; + padding-right: 21px; + background: #e5e5e5 url(../../images/go.png) no-repeat right 4px; } + input.upd { - padding-right: 15px; - background: #e5e5e5 url(../../images/upd.png) no-repeat right 2px; + padding-right: 21px; + background: #e5e5e5 url(../../images/upd.png) no-repeat right 5px; } + +input.wand { + padding-right: 21px; + background: #e5e5e5 url(../../images/wand.png) no-repeat right 4px; +} + +input.delete { + padding-right: 21px; + background: #e5e5e5 url(../../images/cross.png) no-repeat right 4px; +} + + table, img { border: 0px; } diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index f28066adea..6e110412d2 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -87,7 +87,7 @@ function datos_raw($id_agente_modulo, $periodo){ $myvalue = $row["datos"]; echo format_for_graph($myvalue ); } else - echo substr($row["datos"],0,12); + echo salida_limpia($row["datos"]); } echo "
"; diff --git a/pandora_console/operation/agentes/datos_agente_calendar.php b/pandora_console/operation/agentes/datos_agente_calendar.php new file mode 100644 index 0000000000..97ac07b75f --- /dev/null +++ b/pandora_console/operation/agentes/datos_agente_calendar.php @@ -0,0 +1,270 @@ +=".$fecha_inicio." + AND 'timestamp' <=".$fecha_fin; + $resq1=mysql_query($query1); + return($resq1); + } + +function generar_tabla_de_promedios_de_datos_no_string ($id_de_mi_agente, $id_de_mi_mod,$fecha_inicio,$fecha_fin) +// Genera una tabla con los promedios de los datos de un módulo no-string +{ + $dias_de_la_semana=array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"); + $nombre_modulo=dame_nombre_modulo_agentemodulo($id_de_mi_mod); + echo "
Módulo: ".$nombre_modulo."
"; + + // Encabezado de la tabla + echo " + + + + + + "; + for ($dia=0;$dia<7;++$dia) + echo " + "; + echo + ""; + + for ($hora=0;$hora<24;++$hora) + { + echo" + + "; + for ($dia=1;$dia<8;++$dia) + echo ""; + echo + ""; + } + echo "
HoraDía
".$dias_de_la_semana[$dia]."
".$hora." h.".dame_promedio_de_un_modulo_no_string_de_un_agente_para_una_hora_det_de_un_dia_de_la_semana_en_un_rango_de_fechas_det($id_de_mi_agente, $id_de_mi_mod, $hora, $dia, $fecha_inicio, $fecha_fin)."
"; +} + + +/************** Main program *******************************/ + + +// Load global vars +require("include/config.php"); + +if (comprueba_login() != 0) { + echo "NO PERM"; + exit; +} + +$id_user = $_SESSION["id_usuario"]; +if ( (give_acl($id_user, 0, "AR")==0) AND (give_acl($id_user, 0, "AW")==0) ){ + echo "NO PERM"; + exit; +} + +if ((isset($_GET["operacion"])) AND (! isset($_POST["update_agent"]))){ + if (isset ($_POST["copiar"])){ + // Option A: Print exported data + // Export main button + echo "

".$lang_label["ag_title"]."

"; + + // echo "

".$lang_label["export_title"]." ".$lang_label["help"]."

"; + + if (isset ($_POST["origen_modulo"])){ + $origen = $_POST["origen"]; + + /* Comentado sólo para propósitos de prueba (Si no, no anda) + if (give_acl($id_user,dame_id_grupo($origen),"AR")!=1) + { + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent Export Data"); + require ("general/noaccess.php"); + } + */ + + $origen_modulo = $_POST["origen_modulo"]; + $from_date =$_POST["from_date"]; + $to_date=$_POST["to_date"]; + + // Imprime encabezado + echo $lang_label["db_agent_bra"]."".dame_nombre_agente($origen)."".$lang_label["from2"]."".$from_date."".$lang_label["to2"]."".$to_date."
"; + + // Esto podría reutilizarse + echo "
"; + + + // For each module + for ($a=0;$a ". generar_tabla_de_promedios_de_datos_no_string ($origen,$id_modulo,$from_date,$to_date); + } + } + } // End Option A +} else { +// Option B: Print Form +// Form view + ?> +

+

 

+
+
".$lang_label["module"]."".$lang_label["data"]."Timestamp
+ + +


+ +   

"; + + echo "".$lang_label["modules"]."

"; + echo "


+ + +
".$lang_label["from"]."  

"; + + //print calendar and links for next and previous months + echo " + + + +
«".generate_calendar($year, $month, $days_f, 3, NULL, $locale)."»
+ +

".$lang_label["to"]."    

"; + + //print calendar and links for next and previous months + echo " + + + +
«".generate_calendar($year, $month, $days_t, 3, NULL, $locale)."»
+ +
+ +
"; +} + + +?> + + diff --git a/pandora_console/operation/agentes/estado_alertas.php b/pandora_console/operation/agentes/estado_alertas.php index 0241b5393a..95a9036842 100644 --- a/pandora_console/operation/agentes/estado_alertas.php +++ b/pandora_console/operation/agentes/estado_alertas.php @@ -18,196 +18,221 @@ // 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)) { - if (isset($_GET["id_agente"])){ - echo "

".$lang_label["alert_listing"]."".$lang_label["help"]."

"; - $id_agente = $_GET["id_agente"]; - $query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo ORDER BY tagente_modulo.nombre'; - $result_gen=mysql_query($query_gen); - if (mysql_num_rows ($result_gen)) { - echo ""; - echo ""; - $color=1; - while ($data=mysql_fetch_array($result_gen)){ - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - echo ""; - echo "
".$lang_label["type"]."".$lang_label["name"]."".$lang_label["description"]."".$lang_label["min_max"]."".$lang_label["time_threshold"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
".dame_nombre_alerta($data["id_alerta"]); - echo "".$data["nombre"]; - echo "".$data["descripcion"]; - - $mytempdata = fmod($data["dis_min"], 1); - if ($mytempdata == 0) - $mymin = intval($data["dis_min"]); - else - $mymin = $data["dis_min"]; - $mymin = format_for_graph($mymin ); - $mytempdata = fmod($data["dis_max"], 1); - if ($mytempdata == 0) - $mymax = intval($data["dis_max"]); - else - $mymax = $data["dis_max"]; - $mymax = format_for_graph($mymax ); - - echo "".$mymin." / ".$mymax; - echo "".$data["time_threshold"]; - if ($data["last_fired"] == "0000-00-00 00:00:00") { - echo "".$lang_label["never"]; - } - else { - echo "".$data["last_fired"]; - } - echo "".$data["times_fired"]; - if ($data["times_fired"] <> 0) - echo ""; - else - echo ""; - } - echo '
'; - } - else echo "
".$lang_label["no_alerts"]."
"; - } - else - { - echo "

".$lang_label["ag_title"]."

"; - echo "

".$lang_label["alert_listing"]." ".$lang_label["help"]."

"; - $iduser_temp=$_SESSION['id_usuario']; - if (isset($_POST["ag_group"])) - $ag_group = $_POST["ag_group"]; - elseif (isset($_GET["group_id"])) - $ag_group = $_GET["group_id"]; - else - $ag_group = -1; - if (isset($_GET["ag_group_refresh"])){ - $ag_group = $_GET["ag_group_refresh"]; - } - - if (isset($_POST["ag_group"])){ - $ag_group = $_POST["ag_group"]; - echo ""; - } else { - echo ""; - } - echo ""; - echo ""; - echo ""; - echo ""; - // Show only selected groups - - if ($ag_group > 1) - $sql='SELECT id_agente, nombre, disabled FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre'; - else - $sql='SELECT id_agente, nombre, disabled FROM tagente ORDER BY id_grupo, nombre'; - $result=mysql_query($sql); - if (mysql_num_rows($result)){ - $color=1; - while ($row=mysql_fetch_array($result)){ //while there are agents - if ($row["disabled"] == 0) { - $id_agente = $row['id_agente']; - $nombre_agente = $row["nombre"]; - $query_gen='SELECT talerta_agente_modulo.id_alerta, - talerta_agente_modulo.descripcion, - talerta_agente_modulo.last_fired, - talerta_agente_modulo.times_fired, - talerta_agente_modulo.id_agente_modulo, - tagente_modulo.id_agente_modulo - FROM tagente_modulo, talerta_agente_modulo - WHERE tagente_modulo.id_agente = '.$id_agente.' - AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo'; - $result_gen=mysql_query($query_gen); - if (mysql_num_rows ($result_gen)) { - while ($data=mysql_fetch_array($result_gen)){ - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - if (!isset($string)) { - $string=''; - } - $string=$string.""; - $string=$string.""; - if ($data["last_fired"] == "0000-00-00 00:00:00") { - $string=$string.""; - } - else { - $string=$string.""; - } - $string=$string.""; - if ($data["times_fired"] <> 0) - $string=$string.""; - else - $string=$string.""; - } - } - else if($ag_group>1) { - unset($string); - } //end result - } //end disabled=0 - - } //end while - if (isset($string)) { - echo ""; - echo "
".$lang_label["group"].""; - echo "
- - ".$nombre_agente.""; - $string=$string."" - .dame_nombre_alerta($data["id_alerta"])."". - $data["descripcion"]."". - $lang_label["never"]."". - $data["last_fired"]."". - $data["times_fired"]." - - "; - echo " - ".$lang_label["fired"]; - echo "  "; - echo " - ".$lang_label["not_fired"]; - echo "
"; - echo "
"; - echo ""; - echo " - - - - - - "; - echo $string; //built table of alerts - echo " -
".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["description"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
"; +// Login check +$id_usuario=$_SESSION["id_usuario"]; +global $REMOTE_ADDR; + +if (comprueba_login() != 0) { + audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access alert view"); + include ("general/noaccess.php"); + exit; +} + + if ((give_acl($id_user, 0, "AR")!=1) AND (!give_acl($id_user,0,"AW")) AND (dame_admin($id_user)!=1)) { + audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access alert view"); + include ("general/noaccess.php"); + exit; + } + + +// ------------------------------- +// Show alerts for specific agent +// ------------------------------- +if (isset($_GET["id_agente"])){ + echo "

".$lang_label["alert_listing"]."".$lang_label["help"]."

"; + $id_agente = $_GET["id_agente"]; + $query_gen='SELECT talerta_agente_modulo.alert_text, talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo ORDER BY tagente_modulo.nombre'; + $result_gen=mysql_query($query_gen); + if (mysql_num_rows ($result_gen)) { + echo ""; + echo ""; + $color=1; + while ($data=mysql_fetch_array($result_gen)){ + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; } else { - echo "
".$lang_label["type"]."".$lang_label["name"]."".$lang_label["description"]."".$lang_label["min_max"]."".$lang_label["time_threshold"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."

". - $lang_label["no_alert"]."
"; + $tdcolor = "datos2"; + $color = 1; } - } else echo "
". - $lang_label["no_agent"].$lang_label["no_agent_alert"]."
"; + echo ""; + echo "".dame_nombre_alerta($data["id_alerta"]); + echo "".$data["nombre"]; + echo "".$data["descripcion"]; + + $mytempdata = fmod($data["dis_min"], 1); + if ($mytempdata == 0) + $mymin = intval($data["dis_min"]); + else + $mymin = $data["dis_min"]; + $mymin = format_for_graph($mymin ); + + $mytempdata = fmod($data["dis_max"], 1); + if ($mytempdata == 0) + $mymax = intval($data["dis_max"]); + else + $mymax = $data["dis_max"]; + $mymax = format_for_graph($mymax ); + // Text alert ? + if ($data["alert_text"] != "") + echo "".$lang_label["text"]; + else + echo "".$mymin." / ".$mymax; + echo "".$data["time_threshold"]; + if ($data["last_fired"] == "0000-00-00 00:00:00") { + echo "".$lang_label["never"]; + } + else { + echo "".$data["last_fired"]; + } + echo "".$data["times_fired"]; + if ($data["times_fired"] <> 0) + echo ""; + else + echo ""; + } + echo '
'; } -} //end acl -} //end login + else echo "
".$lang_label["no_alerts"]."
"; + +} else { + // ------------------------------- + // SHOW ALL ALERTS (GENERAL PAGE) + // ------------------------------- + + echo "

".$lang_label["ag_title"]."

"; + echo "

".$lang_label["alert_listing"]." ".$lang_label["help"]."

"; + $iduser_temp=$_SESSION['id_usuario']; + if (isset($_POST["ag_group"])) + $ag_group = $_POST["ag_group"]; + elseif (isset($_GET["group_id"])) + $ag_group = $_GET["group_id"]; + else + $ag_group = -1; + if (isset($_GET["ag_group_refresh"])){ + $ag_group = $_GET["ag_group_refresh"]; + } + + if (isset($_POST["ag_group"])){ + $ag_group = $_POST["ag_group"]; + echo "
"; + } else { + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + // Show only selected groups + + if ($ag_group > 1) + $sql='SELECT id_agente, nombre, disabled FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre'; + else + $sql='SELECT id_agente, nombre, disabled FROM tagente ORDER BY id_grupo, nombre'; + + $result=mysql_query($sql); + if (mysql_num_rows($result)){ + $color=1; + while ($row=mysql_fetch_array($result)){ //while there are agents + if ($row["disabled"] == 0) { + $id_agente = $row['id_agente']; + $nombre_agente = $row["nombre"]; + $query_gen='SELECT talerta_agente_modulo.id_alerta, + talerta_agente_modulo.descripcion, + talerta_agente_modulo.last_fired, + talerta_agente_modulo.times_fired, + talerta_agente_modulo.id_agente_modulo, + tagente_modulo.id_agente_modulo + FROM tagente_modulo, talerta_agente_modulo + WHERE tagente_modulo.id_agente = '.$id_agente.' + AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo'; + $result_gen=mysql_query($query_gen); + if (mysql_num_rows ($result_gen)) { + while ($data=mysql_fetch_array($result_gen)){ + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } + else { + $tdcolor = "datos2"; + $color = 1; + } + if (!isset($string)) { + $string=''; + } + $string = $string.""; + $string=$string.""; + if ($data["last_fired"] == "0000-00-00 00:00:00") { + $string=$string.""; + } + else { + $string=$string.""; + } + $string=$string.""; + if ($data["times_fired"] <> 0) + $string=$string.""; + else + $string=$string.""; + } + } + else if($ag_group>1) { + unset($string); + } //end result + } //end disabled=0 + + } //end while + if (isset($string)) { + echo ""; + echo "
".$lang_label["group"].""; + echo "
+ + ".$nombre_agente.""; + + $string = $string."" + .dame_nombre_alerta($data["id_alerta"])."". + $data["descripcion"]."". + $lang_label["never"]."". + $data["last_fired"]."". + $data["times_fired"]." + + "; + echo " - ".$lang_label["fired"]; + echo "  "; + echo " - ".$lang_label["not_fired"]; + echo "
"; + echo "
"; + echo ""; + echo " + + + + + + "; + echo $string; //built table of alerts + echo " +
".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["description"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
"; + } + else { + echo "
". + $lang_label["no_alert"]."
"; + } + } else echo "
". + $lang_label["no_agent"].$lang_label["no_agent_alert"]."
"; +} ?> \ No newline at end of file diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index c1ecfabc5f..fa29985610 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -210,17 +210,28 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ''; + echo '
'; - // Agent general reporting + // Custom reporting if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){ - if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/reporting/agent_overview"){ + if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/reporting/custom_reporting"){ echo ""; } + + // Custom graph viewer + if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){ + if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/reporting/graph_viewer"){ + echo "
"; + } else { + echo ""; + } + // Custom graph builder if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/reporting/graph_builder"){ diff --git a/pandora_console/operation/reporting/custom_reporting.php b/pandora_console/operation/reporting/custom_reporting.php new file mode 100644 index 0000000000..d2563d7bc7 --- /dev/null +++ b/pandora_console/operation/reporting/custom_reporting.php @@ -0,0 +1,149 @@ +".$lang_label["combined_image"].""; + echo ""; + echo "
"; + echo ""; + echo "
"; + + + switch ($period) { + case 3600: $period_label = "Hour"; + break; + case 21600: $period_label = "6 Hours"; + break; + case 43200: $period_label = "12 Hours"; + break; + case 86400: $period_label = "Day"; + break; + case 172800: $period_label = "Two days"; + break; + case 604800: $period_label = "Last Week"; + break; + case 1296000: $period_label = "15 Days"; + break; + case 2592000: $period_label = "Last Month"; + break; + case 5184000: $period_label = "Two Month"; + break; + case 15552000: $period_label = "Six Months"; + break; + default: $period_label = "Day"; + } + echo "
"; + echo ""; + echo "
"; + echo "Period"; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
"; + echo "
"; + } +} + +echo "

".$lang_label["custom_report_builder"]."

"; +echo ""; +echo ""; + echo "
".$lang_label["report_name"]."".$lang_label["description"]."".$lang_label["view"]; +$color=1; +$sql="SELECT * FROM treport"; +$res=mysql_query($sql); +while ($row = mysql_fetch_array($res)){ + if (($row["private"]==0) || ($row["id_user"] == $id_user)){ + // Calculate table line color + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } + else { + $tdcolor = "datos2"; + $color = 1; + } + echo "
".$row["name"]; + echo "".$row["description"]; + $id_graph = $row["id_graph"]; + echo ""; + } +} +echo "
"; + + + + + +?> diff --git a/pandora_console/operation/reporting/graph_builder.php b/pandora_console/operation/reporting/graph_builder.php index 7c30ac32c7..9f4a2d242e 100644 --- a/pandora_console/operation/reporting/graph_builder.php +++ b/pandora_console/operation/reporting/graph_builder.php @@ -1,4 +1,5 @@ -"; + $res = mysql_query($sql); + if ($res){ + $id_graph = mysql_insert_id(); + if ($id_graph){ + for ($a=0; $a < $module_number; $a++){ + $id_agentemodulo = entrada_limpia($_POST["module_".$a]); + $id_agentemodulo_w = entrada_limpia($_POST["module_weight_".$a]); + $sql = "INSERT INTO tgraph_source (id_graph, id_agent_module, weight) VALUES + ($id_graph, $id_agentemodulo, $id_agentemodulo_w)"; + //echo "DEBUG $sql
"; + mysql_query($sql); + } + echo "

".$lang_label["store_graph_suc"]."

"; + } else + echo "

".$lang_label["store_graph_error"]."

"; + } else + echo "

".$lang_label["store_graph_error"]."

"; +} if (isset($_GET["get_agent"])) { $id_agent = $_POST["id_agent"]; - $chunkdata = $_POST["chunk"]; + if (isset($_POST["chunk"])) + $chunkdata = isset($_POST["chunk"]); } if (isset($_GET["delete_module"] )) { @@ -87,10 +140,10 @@ if ( (isset($_GET["add_module"]))){ else $factor = 1; $period = $_POST["period"]; - $graphname = $_POST["graphname"]; $render = $_POST["render"]; - $alerts = $_POST["alerts"]; - $chunkdata = $_POST["chunk"]; +// $alerts = $_POST["alerts"]; + if (isset($_POST["chunk"])) + $chunkdata = $_POST["chunk"]; $events = $_POST["events"]; $factor = $_POST["factor"]; if ($_POST["width"]!= "") @@ -98,7 +151,7 @@ if ( (isset($_GET["add_module"]))){ if ($_POST["height"]!= "") $height = $_POST["height"]; if ($id_module > 0){ - if ($chunkdata == "") + if (!isset($chunkdata) OR ($chunkdata == "")) $chunkdata = "$id_agent,$id_module,$factor"; else $chunkdata = $chunkdata."|$id_agent,$id_module,$factor"; @@ -143,8 +196,9 @@ if (isset($chunk1)) { echo ""; if (isset($id_agent)) echo ""; - echo ""; + echo "
"; echo "
AgentModuleWeightDelete"; + $color=0; for ($a=0; $a < count($module_array); $a++){ // Calculate table line color if ($color == 1){ @@ -165,7 +219,7 @@ if (isset($chunk1)) { echo ""; echo ""; } - echo "
"; + echo "
"; echo "
"; echo ""; } @@ -174,14 +228,14 @@ if (isset($chunk1)) { // SOURCE AGENT TABLE/FORM // ----------------------- echo "

".$lang_label["graph_builder"]."

"; -echo ""; +echo "
"; echo ""; echo ""; echo "
".$lang_label["source_agent"]; echo ""; // Show combo with agents -echo "'; if (isset($chunkdata)) echo ""; -echo ""; +echo ""; echo ""; // ----------------------- @@ -232,52 +286,9 @@ echo ""; echo ""; -echo "
"; -echo "Graph Name"; -echo ""; -echo ""; -echo ""; -echo "Height"; -echo ""; -echo ""; - - -echo "
"; -echo "Period"; -echo ""; -echo ""; - -echo ""; -echo "Show alert limit"; -echo ""; -echo ""; - echo "
"; echo "Render now"; -echo ""; +echo ""; echo ""; +echo ""; +echo "Height"; +echo ""; +echo ""; + + +switch ($period) { + case 3600: $period_label = "Hour"; + break; + case 21600: $period_label = "6 Hours"; + break; + case 43200: $period_label = "12 Hours"; + break; + case 86400: $period_label = "Day"; + break; + case 172800: $period_label = "Two days"; + break; + case 604800: $period_label = "Last Week"; + break; + case 1296000: $period_label = "15 Days"; + break; + case 2592000: $period_label = "Last Month"; + break; + case 5184000: $period_label = "Two Month"; + break; + case 15552000: $period_label = "Six Months"; + break; + default: $period_label = "Day"; +} + + +echo "
"; +echo "Period"; +echo ""; + +echo ""; + echo ""; echo "Show events"; echo ""; @@ -300,27 +363,85 @@ if ($events == 1){ } echo ""; -echo "
"; +/* +echo ""; +echo "Show alert limit"; +echo ""; +echo ""; +*/ + +echo "
"; echo ""; echo "
"; -// Parse chunkdata and render graph -if ($render == 1){ - // parse chunk - echo "

".$lang_label["combined_image"]."

"; - echo ""; +// ----------------------- +// STORE GRAPH FORM +// ----------------------- -} -/* -if (isset($chunkdata)){ - echo "
"; - echo ""; - echo ""; - echo "
".$lang_name["custom_graph_name"]; - echo ""; - echo ""; +// If we have something to save.. +if (isset($module_array)){ + echo "

".$lang_label["graph_store"]."

"; + echo ""; + echo ""; + + // hidden fields with data begin + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for ($a=0; $a < count($module_array); $a++){ + $id_agentemodulo = $module_array[$a]; + $id_agentemodulo_w = $weight_array[$a]; + echo ""; + echo ""; + } + // hidden fields end + + echo ""; + echo ""; + echo "
".$lang_label["name"]; + echo ""; + echo ""; + + echo "".$lang_label["private"]; + echo ""; + echo ""; + + echo "
".$lang_label["description"]; + echo ""; + echo ""; + + echo "
"; + + + echo ""; echo "
"; } -*/ +// -------------------------------------- +// Parse chunkdata and render graph +// -------------------------------------- +if (($render == 1) && (isset($modules))) { + // parse chunk + echo "

".$lang_label["combined_image"]."

"; + echo ""; + echo "
"; + echo ""; + echo "
"; + +} ?> diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php new file mode 100644 index 0000000000..bb64c593d7 --- /dev/null +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -0,0 +1,153 @@ +".$lang_label["combined_image"].""; + echo ""; + echo "
"; + echo ""; + echo "
"; + + switch ($period) { + case 3600: $period_label = "Hour"; + break; + case 21600: $period_label = "6 Hours"; + break; + case 43200: $period_label = "12 Hours"; + break; + case 86400: $period_label = "Day"; + break; + case 172800: $period_label = "Two days"; + break; + case 604800: $period_label = "Last Week"; + break; + case 1296000: $period_label = "15 Days"; + break; + case 2592000: $period_label = "Last Month"; + break; + case 5184000: $period_label = "Two Month"; + break; + case 15552000: $period_label = "Six Months"; + break; + default: $period_label = "Day"; + } + echo "
"; + echo ""; + echo "
"; + echo "Period"; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
"; + echo "
"; + } +} + +echo "

".$lang_label["custom_graph_viewer"]."

"; +echo ""; +echo ""; + echo "
".$lang_label["graph_name"]."".$lang_label["description"]."".$lang_label["view"]; +$color=1; +$sql="SELECT * FROM tgraph"; +$res=mysql_query($sql); +while ($row = mysql_fetch_array($res)){ + if (($row["private"]==0) || ($row["id_user"] == $id_user)){ + // Calculate table line color + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } + else { + $tdcolor = "datos2"; + $color = 1; + } + echo "
".$row["name"]; + echo "".$row["description"]; + $id_graph = $row["id_graph"]; + echo ""; + } +} +echo "
"; + + + + + +?> diff --git a/pandora_console/operation/servers/view_server.php b/pandora_console/operation/servers/view_server.php index ee8982c8c0..a41d10857b 100644 --- a/pandora_console/operation/servers/view_server.php +++ b/pandora_console/operation/servers/view_server.php @@ -193,12 +193,13 @@ if (comprueba_login() == 0) { $sql1 = "SELECT * FROM trecon_task WHERE id_network_server = $id_server"; $result1=mysql_query($sql1); $nowtime = time(); - $maxlag=0; + $maxlag=0;$maxlag2=0; while ($row1=mysql_fetch_array($result1)){ - if (($row1["utimestamp"] + $row1["interval_sweep"]) < $nowtime) + if (($row1["utimestamp"] + $row1["interval_sweep"]) < $nowtime){ $maxlag2 = $nowtime - ($row1["utimestamp"] + $row1["interval_sweep"]); if ($maxlag2 > $maxlag) $maxlag = $maxlag2; + } } if ($maxlag < 60) echo $maxlag." sec"; diff --git a/pandora_console/operation/users/user.php b/pandora_console/operation/users/user.php index 2f148bc9f9..58cdf7d18e 100644 --- a/pandora_console/operation/users/user.php +++ b/pandora_console/operation/users/user.php @@ -54,7 +54,7 @@ while ($rowdup=mysql_fetch_array($resq1)){ $color = 1; $tip = "tip2"; } - echo "
".$name.""; + echo "
".$name.""; echo "".$fecha_registro.""; echo ""; if ($nivel == 1) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 5b7342e5f4..6af5cb7815 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -237,6 +237,7 @@ CREATE TABLE `talerta_agente_modulo` ( `module_type` int(11) NOT NULL default '0', `min_alerts` int(4) NOT NULL default '0', `internal_counter` int(4) default '0', + `alert_text` varchar(255) default '', PRIMARY KEY (`id_aam`) ) ENGINE=InnoDB; @@ -533,4 +534,46 @@ CREATE TABLE `tnews` ( `text` TEXT NOT NULL, `utimestamp` DATETIME NOT NULL DEFAULT 0, PRIMARY KEY(`id_news`) -) ENGINE = InnoDB; \ No newline at end of file +) ENGINE = InnoDB; + +CREATE TABLE `tgraph` ( + `id_graph` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_user` varchar(100) NOT NULL default '', + `name` varchar(150) NOT NULL default '', + `description` TEXT NOT NULL, + `period` int(11) NOT NULL default '0', + `width` smallint(5) UNSIGNED NOT NULL DEFAULT 0, + `height` smallint(5) UNSIGNED NOT NULL DEFAULT 0, + `private` tinyint(1) UNSIGNED NOT NULL default 0, + `events` tinyint(1) UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id_graph`) +) ENGINE = InnoDB; + +CREATE TABLE `tgraph_source` ( + `id_gs` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_graph` int(11) NOT NULL default 0, + `id_agent_module` int(11) NOT NULL default 0, + `weight` smallint(5) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY(`id_gs`) +) ENGINE = InnoDB; + + +CREATE TABLE `treport` ( + `id_report` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_user` varchar(100) NOT NULL default '', + `name` varchar(150) NOT NULL default '', + `description` TEXT NOT NULL, + `private` tinyint(1) UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id_report`) +) ENGINE = InnoDB; + +CREATE TABLE `treport_content` ( + `id_rc` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_report` INTEGER UNSIGNED NOT NULL default 0, + `id_gs` INTEGER UNSIGNED NOT NULL default 0, + `id_agent_module` int(11) NOT NULL default 0, + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` int(11) NOT NULL default 0, + PRIMARY KEY(`id_rc`) +) ENGINE = InnoDB; + diff --git a/pandora_console/reporting/stat_win.php b/pandora_console/reporting/stat_win.php index 6abe936934..7408cef64f 100644 --- a/pandora_console/reporting/stat_win.php +++ b/pandora_console/reporting/stat_win.php @@ -69,10 +69,12 @@ switch ($period) { break; case 21600: $period_label = "6 Hours"; break; - case 43200: $period_label = "12 Hous"; + case 43200: $period_label = "12 Hours"; break; case 86400: $period_label = "Day"; break; + case 172800: $period_label = "Two days"; + break; case 604800: $period_label = "Last Week"; break; case 1296000: $period_label = "15 Days"; @@ -231,6 +233,7 @@ echo "