diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index dd925e62d4..762112d933 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,27 @@ +2007-06-21 Sancho Lerena + + * include/languages/language_en.php: More new tokens added. + + * include/functions.php: Added function render time for alert time + limiters format (multiplier of 30). + + * pandoradb.sql: Added support for alert time limiters format. + + * operation/visual_console/render_view.php: Added support for + single lines a few fixes. + + * images/console/background/globalmap.jpg: Nice world background. + + * images/console/icons/computer.png: Added new icon for workstation. + + * godmode/agentes/configurar_agente.ph, + godmode/agentes/alert_manager.php: Added support for alert time + limiters. + + * godmode/reporting/map_builder.php: Tool to build/manage maps + elements. Finished!. + + 2007-06-19 Manuel Arostegui * pandora_console.spec: Ready for 1.3 packaging. @@ -6,7 +30,8 @@ * include/languages/language_en.php: Updated text. - * include/styles/pandora.css: Removed lb style not uses. Added ok style. + * include/styles/pandora.css: Removed lb style not uses. Added ok + style. * operation/agentes/estado_grupo.php: Changed old td.lb style to th. @@ -15,8 +40,8 @@ * operation/events/events.php: Use ok style. Closed table. * operation/agentes/estado_ultimopaquete.php, - godmode/agentes/configurar_agente.php, godmode/agentes/module_manager.php: - Closed html tags. + godmode/agentes/configurar_agente.php, + godmode/agentes/module_manager.php: Closed html tags. 2007-06-17 Sancho Lerena diff --git a/pandora_console/godmode/agentes/alert_manager.php b/pandora_console/godmode/agentes/alert_manager.php index 53ed0efea0..a861c7c939 100644 --- a/pandora_console/godmode/agentes/alert_manager.php +++ b/pandora_console/godmode/agentes/alert_manager.php @@ -87,7 +87,7 @@ $result=mysql_query($sql1); else $mymax = $row3["dis_max"]; $mymax = format_for_graph($mymax ); - + // We have alert text ? if ($row3["alert_text"] != "") $string = $string."".$lang_label["text"]; @@ -95,6 +95,14 @@ $result=mysql_query($sql1); $string = $string."".$mymin; $string = $string."".$mymax; } + $mytimefrom =$row3["time_from"]; + $mytimeto =$row3["time_to"]; + $string = $string.""; + if ($mytimeto == $mytimefrom) + $string .= $lang_label["N/A"]; + else + $string .= render_time($mytimefrom)." - ".render_time($mytimeto); + $string = $string."".salida_limpia($row3["descripcion"]); $string = $string.""; $id_grupo = dame_id_grupo($id_agente); @@ -112,13 +120,14 @@ $result=mysql_query($sql1); } } if (isset($string) & $string!='') { - echo " + echo "
+ "; echo $string; @@ -234,36 +243,68 @@ _timestamp_
_data_
-"; $id_map = $row["id"]; echo "
".$lang_label["name"]." ".$lang_label["type"]." ".$lang_label["alert"]." ".$lang_label["threshold"]." ".$lang_label["min."]." ".$lang_label["max."]."".$lang_label["time"]." ".$lang_label["description"]." ".$lang_label["action"]."
+".$lang_label["time_from"]; +echo ""; + +echo "".$lang_label["time_to"]; +echo ""; + +?> + +
  - + - -   - + echo ' + + + + + + + + + + + + '; -".$lang_label["min_alerts"]; echo ''; + echo $lang_label["other"]; + echo ''; + echo ''; + + // Max / Min alerts + echo "
".$lang_label["min_alerts"]; + echo ''; echo ''; - echo ''; + echo ''; echo $lang_label["max_alerts"]; - echo ''; + echo ''; echo ''; ?> -
- +
+ ".$lang_label["create_alert_no"].""; @@ -272,6 +278,8 @@ if (isset($_POST["update_alert"])){ // Update an existing alert $min_alerts = entrada_limpia($_POST["min_alerts"]); $other = entrada_limpia($_POST["other"]); $alert_text = entrada_limpia($_POST["alert_text"]); + $time_from = entrada_limpia($_POST["time_from"]); + $time_to= entrada_limpia($_POST["time_to"]); $disable_alert = entrada_limpia($_POST["disable_alert"]); if ($time_threshold == -1) { $time_threshold = $other; @@ -289,6 +297,8 @@ if (isset($_POST["update_alert"])){ // Update an existing alert al_campo1 = '$campo_1' , descripcion = '$descripcion', alert_text = '$alert_text', + time_to = '$time_to', + time_from = '$time_from', disable = '$disable_alert' WHERE id_aam = ".$id_aam; $result=mysql_query($sql_insert); @@ -439,6 +449,8 @@ if (isset($_GET["update_alert"])){ $alerta_time_threshold = $row["time_threshold"]; $alerta_descripcion = $row["descripcion"]; $alerta_disable = $row["disable"]; + $time_from = $row["time_from"]; + $time_to = $row["time_to"]; $alerta_id_agentemodulo = $row["id_agente_modulo"]; // Only to show, cannot be changed } @@ -641,6 +653,8 @@ if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1)) ) && $snmp_community = ""; $id_module_group = ""; $module_interval = ""; + $time_to = ""; + $time_from = ""; } // MODULE DELETION diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 23a0ff83a9..1eca801da3 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -16,7 +16,18 @@ // 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. - +?> + +".$lang_label["modify_ok"].""; + else { + $result = "

".$lang_label["modify_no"]."

"; + echo $sql; + echo "

"; + } + echo $result; + +} +// Add module SQL code +if (isset($_GET["add_module"])){ + if (isset($_POST["id_map"])) + $id_map = $_POST["id_map"]; + else { + audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in map builder"); + include ("general/noaccess.php"); + exit; + } + $my_id_map = give_parameter_post ("id_map",0); + $my_id_agent = give_parameter_post ("id_agent",0); + $my_id_module = give_parameter_post ("id_module",0); + $my_period = give_parameter_post ("period",3600); + $my_type = give_parameter_post ("type",0); + $my_pos_x = give_parameter_post ("pos_x",0); + $my_pos_y = give_parameter_post ("pos_y",0); + $my_height = give_parameter_post ("height"); + $my_width = give_parameter_post ("width"); + $my_label = give_parameter_post ("label"); + $my_image = give_parameter_post ("image"); + $my_map_linked = give_parameter_post ("map_linked"); + $my_parent_item = give_parameter_post ("parent_item"); + $my_label_color = give_parameter_post ("label_color",""); + $my_link_color = give_parameter_post ("link_color",0); + $sql = "INSERT INTO tlayout_data (id_layout, pos_x, pos_y, height, width, label, image, type, period, id_agente_modulo, id_layout_linked, parent_item, label_color, no_link_color) VALUES ('$my_id_map', '$my_pos_x', '$my_pos_y', '$my_height', '$my_width', '$my_label', '$my_image', '$my_type', '$my_period', '$my_id_module', '$my_map_linked', '$my_parent_item', '$my_label_color', '$my_link_color')"; if ($res=mysql_query($sql)) $result = "

".$lang_label["create_ok"]."

"; - else + else { $result = "

".$lang_label["create_no"]."

"; + echo $sql; + echo "

"; + } echo $result; } @@ -110,7 +163,7 @@ if (isset($_POST["createmode"])){ // INSERT REPORT DATA if ($createmode == 1){ $form_id_user = $id_user; - $sql = "INSERT INTO tlayout (name, background, width, height) VALUES ('$map_name', '$map_background', '$map_width', '$map_height')"; + $sql = "INSERT INTO tlayout (name, background, width, height, id_group) VALUES ('$map_name', '$map_background', '$map_width', '$map_height', 1)"; if ($res=mysql_query($sql)) $result = "

".$lang_label["create_ok"]."

"; else @@ -166,7 +219,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { echo "

".$lang_label["reporting"]." > "; echo $lang_label["map_builder"]."

"; - echo "
"; + echo ""; echo ""; if ($createmode == 0){ echo ""; @@ -182,7 +235,18 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { echo "
"; echo $lang_label["background"]; echo ""; - echo ""; + // echo ""; + + echo ''; echo "
"; echo $lang_label["width"]; @@ -209,13 +273,19 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { // Part 2 - Add new items to report // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - echo "

".$lang_label["reporting_item_add"]."

"; + echo "

".$lang_label["map_item_add"]; + ?> + + "; + echo "

"; + echo ""; // Part 3 - List of already assigned report items // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo "

".$lang_label["report_items"]."

"; - echo ""; + echo "
"; echo " - + + + + + "; $sql = "SELECT * FROM tlayout_data WHERE id_layout = $id_map"; $res=mysql_query($sql); @@ -404,10 +490,15 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { case "1": $type_desc = "Module graph"; break; case "2": $type_desc = "Line"; break; } + $id_element = $row["id"]; $period = $row["period"]; $id_am = $row["id_agente_modulo"]; $x = $row["pos_x"]; $y = $row["pos_y"]; + $myimage = $row["image"]; + $width= $row["width"]; + $height = $row["height"]; + $label = $row["label"]; $name = "N/A"; $agent_name = "N/A"; if ($id_am != ""){ @@ -415,13 +506,42 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { $module_name = dame_nombre_modulo_agentemodulo ($id_am); } echo ""; + echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
".$lang_label["type"]."".$lang_label["agent_name"]." ".$lang_label["module_name"]."".$lang_label["label"]."".$lang_label["image"]." ".$lang_label["pos_x"]." ".$lang_label["pos_y"]."".$lang_label["width"]."".$lang_label["height"]." ".$lang_label["delete"]."".$lang_label["update"]."
".$type_desc."".$agent_name."".$module_name."".$x."".$y."".$agent_name." / "; + echo $module_name.""; + echo ""; + echo ''; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; + echo ""; + echo ""; } echo "
"; } @@ -458,12 +578,12 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { echo "
".$row["width"]."x".$row["height"].""; - echo ""; + echo ""; } } echo "
"; echo ""; - echo ""; + echo ""; echo "
"; echo ""; echo ""; diff --git a/pandora_console/images/console/background/globalmap.jpg b/pandora_console/images/console/background/globalmap.jpg new file mode 100644 index 0000000000..f399959782 Binary files /dev/null and b/pandora_console/images/console/background/globalmap.jpg differ diff --git a/pandora_console/images/console/background/internal_network_sample.gif b/pandora_console/images/console/background/internal_network_sample.gif deleted file mode 100644 index 1ddcd0b09b..0000000000 Binary files a/pandora_console/images/console/background/internal_network_sample.gif and /dev/null differ diff --git a/pandora_console/images/console/background/metromoscu.gif b/pandora_console/images/console/background/metromoscu.gif deleted file mode 100644 index dce196914b..0000000000 Binary files a/pandora_console/images/console/background/metromoscu.gif and /dev/null differ diff --git a/pandora_console/images/console/background/small_office.gif b/pandora_console/images/console/background/small_office.gif deleted file mode 100644 index d1eabd5822..0000000000 Binary files a/pandora_console/images/console/background/small_office.gif and /dev/null differ diff --git a/pandora_console/images/console/background/spain.jpg b/pandora_console/images/console/background/spain.jpg deleted file mode 100644 index f9ad957fcc..0000000000 Binary files a/pandora_console/images/console/background/spain.jpg and /dev/null differ diff --git a/pandora_console/images/console/background/worldmap.jpg b/pandora_console/images/console/background/worldmap.jpg deleted file mode 100644 index 9a69da7f29..0000000000 Binary files a/pandora_console/images/console/background/worldmap.jpg and /dev/null differ diff --git a/pandora_console/images/console/background/worldmap_sample1.jpg b/pandora_console/images/console/background/worldmap_sample1.jpg deleted file mode 100644 index 70f1cda95d..0000000000 Binary files a/pandora_console/images/console/background/worldmap_sample1.jpg and /dev/null differ diff --git a/pandora_console/images/console/icons/computer.png b/pandora_console/images/console/icons/computer.png new file mode 100644 index 0000000000..e1708e5ea9 Binary files /dev/null and b/pandora_console/images/console/icons/computer.png differ diff --git a/pandora_console/images/console/icons/computer2.png b/pandora_console/images/console/icons/computer2.png deleted file mode 100644 index 6aa43d4f06..0000000000 Binary files a/pandora_console/images/console/icons/computer2.png and /dev/null differ diff --git a/pandora_console/images/console/icons/computer_bad.png b/pandora_console/images/console/icons/computer_bad.png new file mode 100644 index 0000000000..66952b3c41 Binary files /dev/null and b/pandora_console/images/console/icons/computer_bad.png differ diff --git a/pandora_console/images/console/icons/computer_ok.png b/pandora_console/images/console/icons/computer_ok.png new file mode 100644 index 0000000000..82c4e432a2 Binary files /dev/null and b/pandora_console/images/console/icons/computer_ok.png differ diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 125a3fdd79..f48b0d3482 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -491,5 +491,19 @@ function human_date_relative ( $seconds ) { return $ayer; } +function render_time ($lapse) { + $myhour = intval(($lapse*30)/60); + if ($myhour == 0) + $output = "00"; + else + $output = $myhour; + $output .=":"; + $mymin = fmod(($lapse*30),60); + if ($mymin == 0) + $output .= "00"; + else + $output .= $mymin; + return $output; +} ?> \ No newline at end of file diff --git a/pandora_console/include/languages/language_en.php b/pandora_console/include/languages/language_en.php index 13a12ac08e..d925c135ea 100644 --- a/pandora_console/include/languages/language_en.php +++ b/pandora_console/include/languages/language_en.php @@ -868,7 +868,11 @@ $lang_label["link_color"]="Link color"; $lang_label["label_color"]="Label color"; $lang_label["white"]="White"; $lang_label["black"]="Black"; - +$lang_label["time_from"]="Time from"; +$lang_label["time_to"]="Time to"; +$lang_label["time"]="Time"; +$lang_label["module_graph"] = "Module graph"; +$lang_label["map_item_add"] = "Add map item"; global $lang_label; global $help_label; ?> diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index efe645af20..a8cb223e83 100644 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -57,7 +57,6 @@ if (isset($_GET["id"])){ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo "

".$layout_name."

"; - echo "
"; $sql="SELECT * FROM tlayout_data WHERE id_layout = $id_layout"; $res=mysql_query($sql); @@ -126,7 +125,15 @@ while ($row = mysql_fetch_array($res)){ echo ""; echo "
"; } - + if ($type == 2){ + $lines_data[$lines][0]=$pos_x; + $lines_data[$lines][1]=$pos_y; + $lines_data[$lines][2]=$width; + $lines_data[$lines][3]=$height; + $lines_data[$lines][4]="#".$label_color; + $lines++; + } + // Get parent relationship - Create line data // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (($parent_item != "") AND ($parent_item != 0)){ @@ -148,7 +155,10 @@ echo 'function myDrawFunction(){'; for ($a=0; $a < $lines; $a++){ echo " jg_doc_$a.setStroke(2);"; - if ($lines_data[$a][4] >= 1) + + if (substr($lines_data[$a][4],0,1) == "#") + echo " jg_doc_$a.setColor('".$lines_data[$a][4]."');"; // CUSTOM COLOR + elseif ($lines_data[$a][4] >= 1) echo " jg_doc_$a.setColor('00dd00');"; // GREEN elseif ($lines_data[$a][4] == 0) echo " jg_doc_$a.setColor('#dd0000');"; // RED diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 8d3d5722cc..60f4063010 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -180,6 +180,8 @@ CREATE TABLE `talerta_agente_modulo` ( `internal_counter` int(4) default '0', `alert_text` varchar(255) default '', `disable` int(4) default '0', + `time_from` int(8) default '0', + `time_to` int(8) default '0', PRIMARY KEY (`id_aam`) ) ENGINE=InnoDB;