diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 33a71a5194..fcdb154c3c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2008-03-13 Sancho Lerena + + * include/functions_db.php: Added show_server_type (): Return a string + containing image tag for a given target id. Updated some generic db + access calls to new function names. + + * pandoradb.sql: Removed unused field. + + * operation/agentes/estado_generalagente.php: Some fixes for new schema + + * reporting/stat_win.php: Uses new $config hash. + + * godmode/agentes/module_manager.php: Some fixes. Added visualization + for module type (by server type). + + 2008-03-06 Sancho Lerena Pandora FMS 2.0 development first commit. 1.4 version is now 2.0 diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 0d59fb6838..6b5028a17c 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -71,10 +71,10 @@ if ($row=mysql_num_rows($result)){ echo ''; echo ''; echo ""; - echo ""; + echo ''; + echo ''; echo ""; echo ""; - echo ""; echo ""; echo ""; $color=1;$last_modulegroup = "0"; @@ -87,6 +87,7 @@ if ($row=mysql_num_rows($result)){ $color =1; } $id_tipo = $row["id_tipo_modulo"]; + $id_module = $row["id_modulo"]; $nombre_modulo =$row["nombre"]; $descripcion = $row["descripcion"]; $module_max = $row["max"]; @@ -101,19 +102,30 @@ if ($row=mysql_num_rows($result)){ } echo ""; + + // Module type (by server type ) + echo ""; + + // Module interval if ($module_interval2!=0){ echo ""; } else { echo ""; } echo ""; - echo ""; + + // MAX / MIN values echo ""; + + // Delete module echo "
".$lang_label["module_name"]."".$lang_label["type"]."'.lang_string('S').''.lang_string('type').'".$lang_label["interval"]."".$lang_label["description"]."".$lang_label["module_group"]."".$lang_label["max_min"]."".$lang_label["action"]."
".$nombre_modulo.""; + if ($id_module > 0) { + echo show_server_type ($id_module); + echo ' '; + } + + // Module type (by data type) echo ""; if ($id_tipo > 0) { echo ""; } echo "".$module_interval2." N/A ".substr($descripcion,0,30)."". - substr(dame_nombre_grupomodulo($module_group2),0,15).""; if ($module_max == $module_min) { $module_max = "N/A"; @@ -121,16 +133,18 @@ if ($row=mysql_num_rows($result)){ } echo $module_max." / ".$module_min; echo ""; - if ($id_tipo != -1){ - echo "'; - echo ""; - echo " "; - echo ""; - echo ""; - } - // Value arithmetical media fix - if (($id_tipo != 3) AND ($id_tipo != 10) AND ($id_tipo != 17)){ + echo "'; + echo ""; + echo " "; + echo ""; + echo ""; + + // Make a data normalization + if (($id_tipo == 22 ) OR ($id_tipo == 1 ) OR ($id_tipo == 4 ) OR ($id_tipo == 7 ) OR + ($id_tipo == 8 ) OR ($id_tipo == 11 ) OR ($id_tipo == 16) OR ($id_tipo == 22 )) { echo " "; echo "'; echo ""; diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index da52f94dd6..4b6ba7db8e 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -833,6 +833,30 @@ function show_icon_type($id_tipo){ return $pro; } +/** + * Return a string containing image tag for a given target id (server) + * + * @param int Server type id + * @return string Fully formatted IMG HTML tag with icon + */ + +function show_server_type ($id){ + global $config; + switch ($id) { + case 1: return ''; + break; + case 2: return ''; + break; + case 4: return ''; + break; + case 5: return ''; + break; + case 6: return ''; + break; + default: return "--"; + } +} + // --------------------------------------------------------------- // Return all childs groups of a given id_group inside array $child // --------------------------------------------------------------- @@ -1209,7 +1233,7 @@ function return_coordinate_y_layoutdata ($id_layoutdata){ function return_moduledata_avg_value ($id_agent_module, $period){ $datelimit = time() - $period; // limit date - $id_agent = give_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); + $id_agent = get_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); $query1="SELECT AVG(datos) FROM tagente_datos WHERE id_agente = $id_agent AND id_agente_modulo = $id_agent_module AND utimestamp > $datelimit"; $resq1=mysql_query($query1); if ($resq1 != 0) { @@ -1222,7 +1246,7 @@ function return_moduledata_avg_value ($id_agent_module, $period){ function return_moduledata_max_value ($id_agent_module, $period){ $datelimit = time() - $period; // limit date - $id_agent = give_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); + $id_agent = get_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); $query1="SELECT MAX(datos) FROM tagente_datos WHERE id_agente = $id_agent AND id_agente_modulo = $id_agent_module AND utimestamp > $datelimit"; $resq1=mysql_query($query1); if ($resq1 != 0) { @@ -1235,7 +1259,7 @@ function return_moduledata_max_value ($id_agent_module, $period){ function return_moduledata_min_value ($id_agent_module, $period){ $datelimit = time() - $period; // limit date - $id_agent = give_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); + $id_agent = get_db_value ("id_agente", "tagente_modulo", "id_agente_modulo", $id_agent_module); $query1="SELECT MIN(datos) FROM tagente_datos WHERE id_agente = $id_agent AND id_agente_modulo = $id_agent_module AND utimestamp > $datelimit"; $resq1=mysql_query($query1); if ($resq1 != 0) { diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index f2e18bfa25..43502da2d1 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -1,26 +1,14 @@ -// 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 // as published by the Free Software Foundation; version 2 -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// 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"); @@ -43,8 +31,7 @@ if (comprueba_login() == 0) { $os_version = $row["os_version"]; $agent_version = $row["agent_version"]; $disabled= $row["disabled"]; - $agent_type= $row["agent_type"]; - $server = $row["id_server"]; + $network_server = $row["id_network_server"]; } else { echo "

".$lang_label["agent_error"]."

"; echo "
"; @@ -122,27 +109,23 @@ if (comprueba_login() == 0) { '.$lang_label["group"].'    '.dame_grupo($id_grupo).''; - if ($agent_type == 0) { - echo ''.$lang_label["agentversion"].' - '.salida_limpia($agent_version).''; - } else { - echo ''.$lang_label["agentversion"].' - N/A'; - } - + + // Agent version + echo ''.lang_string ("agentversion"). ''; + echo ''.salida_limpia($agent_version). ''; + // Total packets echo ' - '.$lang_label["total_packets"].' - '; + '. lang_string ("total_packets"). ''; + echo ''; $total_paketes= 0; - $sql_3='SELECT COUNT(*) FROM tagente_datos WHERE id_agente = '.$id_agente; $result_3=mysql_query($sql_3); $row3=mysql_fetch_array($result_3); $total_paketes = $row3[0]; - echo $total_paketes; echo ''; + // Last contact echo ' @@ -161,6 +144,7 @@ if (comprueba_login() == 0) { echo $ultima_act_remota; } +/* // Asigned/active server echo ''.$lang_label["server_asigned"].' '; @@ -169,6 +153,7 @@ if (comprueba_login() == 0) { } else { echo give_server_name($server); } +*/ // Next contact diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 03f42b6185..613167e9cc 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -237,7 +237,6 @@ CREATE TABLE `tnotification_component` ( `id` int(11) unsigned NOT NULL auto_increment, `id_notification` int(11) NOT NULL default '0', `id_agente_modulo` int(11) NOT NULL default '0', - `data_source` tinyint(3) unsigned default '1', `dis_max` double(18,2) default NULL, `dis_min` double(18,2) default NULL, `alert_text` varchar(255) default '', diff --git a/pandora_console/reporting/stat_win.php b/pandora_console/reporting/stat_win.php index 34150829ff..c95d4c03bc 100644 --- a/pandora_console/reporting/stat_win.php +++ b/pandora_console/reporting/stat_win.php @@ -21,12 +21,12 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Global & session management -include ("../include/config.php"); +include ('../include/config.php'); session_start(); -include ("../include/functions.php"); -include("../include/functions_db.php"); -include("../include/languages/language_".$language_code.".php"); +include ('../include/functions.php'); +include ('../include/functions_db.php'); +include ('../include/languages/language_'.$config['language'].'.php'); // Access control if (comprueba_login() != 0) {