// 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. ?> ".$lang_label["ag_title"]." > "; echo $lang_label["last_data_chunk"].""; $result3=mysql_query($sql3); if (mysql_num_rows ($result3)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $texto=''; $last_modulegroup = 0; $color = 1; while ($row3=mysql_fetch_array($result3)){ // Calculate table line color if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } if ($row3["id_module_group"] != $last_modulegroup ){ // Render module group names (fixed code) $nombre_grupomodulo = dame_nombre_grupomodulo ($row3["id_module_group"]); $last_modulegroup = $row3["id_module_group"]; echo ""; } // Begin to render data ... echo ""; $nombre_grupomodulo = dame_nombre_grupomodulo ($row3["id_module_group"]); if ($nombre_grupomodulo != ""){ if (($label_group == 0) || ($last_label != $nombre_grupomodulo)){ // Show label module group $label_group = -1; $last_label = $nombre_grupomodulo; $texto = $texto. " "; } } $nombre_tipo_modulo = dame_nombre_tipo_modulo($row3["id_tipo_modulo"]); echo ""; // For types not string type (3 data_string, 9 tcp_string, 14 snmp_string) if (($row3["id_tipo_modulo"] != 3) AND ($row3["id_tipo_modulo"] != 10) AND ($row3["id_tipo_modulo"] != 17)){ echo ""; //} } echo '
".$lang_label["module_name"]."".$lang_label["type"]."".$lang_label["int"]."".$lang_label["description"]."".$lang_label["data"]."".$lang_label["graph"]."".$lang_label["raw_data"]."".$lang_label["timestamp"]."
".$nombre_grupomodulo."
"; // Render network exec module button, only when // Agent Write for this module and group, is given // Is a network module // Has flag = 0 $id_grupo = $row_t["id_grupo"]; $id_usuario=$_SESSION["id_usuario"]; if (give_acl($id_usuario, $id_grupo, "AW")==1){ if ($row3["id_tipo_modulo"] > 4){ if ($row3["flag"] == 0){ echo " "; } else { echo " "; } } } echo " ".$nombre_grupomodulo.""; echo salida_limpia(substr($row3["nombre"],0,15)); echo ""; echo ""; echo ""; if ($row3["module_interval"] != 0){ echo $row3["module_interval"]; $real_interval = $row3["module_interval"]; } else { echo $intervalo_agente; $real_interval = $intervalo_agente; } //echo $nombre_tipo_modulo; echo ""; echo salida_limpia(substr($row3["descripcion"],0,32)); if (strlen($row3["descripcion"]) > 32){ echo "..."; } echo ""; if (is_numeric($row3["datos"])) { $mytempdata = fmod($row3["datos"], 1); if ($mytempdata == 0) $myvalue = intval($row3["datos"]); else $myvalue = $row3["datos"]; echo format_for_graph($myvalue ); } else echo substr(salida_limpia($row3["datos"]),0,12); if (($row3["id_tipo_modulo"] == 2) OR ($row3["id_tipo_modulo"] == 6) OR ($row3["id_tipo_modulo"] == 18) OR ($row3["id_tipo_modulo"] == 9)) $graph_type = "boolean"; else $graph_type = "sparse"; $handle = "stat".$nombre_tipo_modulo."_".$row3["id_agente_modulo"]; $url = 'reporting/procesos.php?agente='.$row3["id_agente_modulo"]; $win_handle=dechex(crc32($row3["id_agente_modulo"].$row3["nombre"])); echo ""; $graph_label = output_clean_strict ($row3["nombre"]); echo " "; $link ="winopeng('reporting/stat_win.php?type=$graph_type&period=604800&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=6000','week_".$win_handle."')"; echo ' '; $link ="winopeng('reporting/stat_win.php?type=$graph_type&period=86400&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=600','day_".$win_handle."')"; echo ' '; $link ="winopeng('reporting/stat_win.php?type=$graph_type&period=3600&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=60','hour_".$win_handle."')"; echo ''; } // STRING DATA else { # Writing string data in different way :) echo ""; echo salida_limpia(substr($row3["datos"],0,42)); } echo ""; echo "  "; echo "  "; echo ""; echo ""; if ($row3["timestamp"] == "0000-00-00 00:00:00"){ echo $lang_label["never"]; } else { $ahora = time(); if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) { echo ""; echo human_time_comparation($row3["timestamp"]); echo ""; } else echo human_time_comparation($row3["timestamp"]); } echo "
'; } else { echo "
".$lang_label["no_modules"]."
"; } } ?>