2007-03-12 Sancho Lerena <slerena@artica.es>

* pandoradb.sql: Upgraded scheme, many changes and many tables
	added. I Need to commit the new "preloaded" data for this scheme,
	give me some days, this stuff are on development.

	* includes/styles/*: Many additions to reflect new menu options,
	and the tab menu title.

	* reporting/fgraph.php: Minor changes to format progressbar.

	* godmode/modules/*: Many many changes and additions (manage_*)
	for the new management system using tabs :-)

	* include/languages/language_es_es.php: Many additions.

	* operation/servers/view_server.php: Implemented detailed load for
	each servertype and latency time to each server to detect problems
	with high load.
	
	Many changes in godmode subsystem. Not detailed at this time.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@394 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-03-12 17:58:52 +00:00
parent 63cc47342c
commit 02acab8e95
34 changed files with 2618 additions and 922 deletions

View File

@ -1,3 +1,25 @@
2007-03-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Upgraded scheme, many changes and many tables
added. I Need to commit the new "preloaded" data for this scheme,
give me some days, this stuff are on development.
* includes/styles/*: Many additions to reflect new menu options,
and the tab menu title.
* reporting/fgraph.php: Minor changes to format progressbar.
* godmode/modules/*: Many many changes and additions (manage_*)
for the new management system using tabs :-)
* include/languages/language_es_es.php: Many additions.
* operation/servers/view_server.php: Implemented detailed load for
each servertype and latency time to each server to detect problems
with high load.
Many changes in godmode subsystem. Not detailed at this time.
2007-03-07 Raul Mateos <raulofpandora@gmail.com>
* godmode/agentes/alert_manager.php, modificar_agente.php,
@ -17,6 +39,7 @@
* include/styles/menu.css: Small colour change in menu border.
>>>>>>> .r393
2007-03-06 Sancho Lerena <slerena@artica.es>
* include/functions*.php: Some reorganization, moved some funtions

View File

@ -1,5 +1,29 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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.
// ========================
// AGENT GENERAL DATA FORM
// ========================
@ -13,21 +37,22 @@ if (give_acl($id_user, 0, "AW")!=1) {
};
echo "<h2>".$lang_label["agent_conf"];
if (isset($_GET["creacion"])){
echo " &gt; ".$lang_label["create_agent"]."
<a href='help/".$help_code."/chap3.php#32' target='_help' class='help'>
&nbsp;<span>".$lang_label["help"]."</span></a>";
if (isset($_GET["create_agent"])){
$create_agent = 1;
echo " &gt; ".$lang_label["create_agent"]."
<a href='help/".$help_code."/chap3.php#32' target='_help' class='help'>
&nbsp;<span>".$lang_label["help"]."</span></a>";
} else {
echo " &gt; ".$lang_label["update_agent"]."
<a href='help/".$help_code."/chap3.php#32' target='_help' class='help'>
&nbsp;<span>".$lang_label["help"]."</span></a>";
}
echo "</h2>";
echo "<div style='height: 25px'> </div>";
echo "<div style='height: 5px'> </div>";
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente">';
if ($creacion_agente == 1) {
if ($create_agent == 1) {
echo "<input type='hidden' name='create_agent' value='1'>";
} else {
echo "<input type='hidden' name='update_agent' value='1'>";
@ -137,7 +162,7 @@ while ($row=mysql_fetch_array($result)){
<tr><td colspan='3'><div class='raya'></div></td></tr>
<tr><td colspan="3" align="right">
<?php
if (isset($_GET["creacion"])){
if ($create_agent == 1){
echo "
<input name='crtbutton' type='submit' class='sub' value='".
$lang_label["create"]."'>";

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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

View File

@ -1,24 +1,27 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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.?>
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<?php
// Load global vars
require("include/config.php");
if (give_acl($id_user, 0, "AW")!=1) {
@ -70,17 +73,67 @@ $tcp_rcv = "";
$snmp_oid= "";
$ip_target ="";
$snmp_community="";
$creacion_agente = 0;
$combo_snmp_oid="";
$agent_created_ok = 0;
$create_agent = 0;
// ================================
// Create AGENT
// ================================
// We need to create agent BEFORE show tabs, because we need to get agent_id
// This is not very clean, but...
if (isset($_POST["create_agent"])) { // Create a new and shining agent
$nombre_agente = entrada_limpia($_POST["agente"]);
$direccion_agente = entrada_limpia($_POST["direccion"]);
$grupo = entrada_limpia($_POST["grupo"]);
$intervalo = entrada_limpia($_POST["intervalo"]);
$comentarios = entrada_limpia($_POST["comentarios"]);
$modo = entrada_limpia($_POST["modo"]);
$id_server = entrada_limpia($_POST["id_server"]);
$id_os = entrada_limpia($_POST["id_os"]);
$disabled = entrada_limpia($_POST["disabled"]);
// Check if agent exists (BUG WC-50518-2 )
$sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"';
$result=mysql_query($sql1);
if ($row=mysql_fetch_array($result))
echo "<h3 class='error'>".$lang_label["agent_exists"]."</h3>";
else {
if ($id_server != ""){
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_server) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."',$id_server)";
} else {
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."')";
}
$result=mysql_query($sql_insert);
if ($result) {
$agent_created_ok = 1;
$id_agente = mysql_insert_id();
// Create special MODULE agent_keepalive
$sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",-1,'Agent Keepalive monitor')";
$result=mysql_query($sql_insert);
}
}
}
// Show tabs
// ¯-----------------
echo "<div id='menu_tab_left'>
<ul class='mn'>
<li class='nomn'>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='../images/bricks.png' class='top' border=0>&nbsp; ".dame_nombre_agente($id_agente)." - ".$lang_label["setup_mode"]."</A>";
echo "</li>";
echo "</ul></div>";
echo "<div id='menu_tab'>
<ul class='mn'>
<li class='nomn'>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/zoom.png' width='16' class='top' border=0>&nbsp; View agent</a>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/zoom.png' width='16' class='top' border=0>&nbsp; View</A>";
echo "</li>";
echo "<li class='nomn'>";
@ -95,13 +148,27 @@ echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=$id_agente'><img src='images/bell.png' width='16' class='top' border=0>&nbsp; Alerts</a>";
echo "</li>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=templatet&id_agente=$id_agente'><img src='images/network.gif' width='16' class='top' border=0>&nbsp; NC Templates</a>";
echo "</li>";
echo "</ul>";
echo "</div>";
// Make some space between tabs and title
echo "<div style='height: 25px'> </div>";
// Unset variable to allow operations to work
$id_agente = "";
// Show agent creation results
if (isset($_POST["create_agent"])){
if ($agent_created_ok == 0)
echo "<h3 class='error'>".$lang_label["create_agent_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["create_agent_ok"]."</h3>";
}
// Delete Alert
// =============
if (isset($_GET["delete_alert"])){ // if modified some parameter
@ -176,46 +243,7 @@ if (isset($_POST["update_alert"])){ // Update an existing alert
$id_agente = mysql_insert_id();
}
// ================================
// Create AGENT
// ================================
if (isset($_POST["create_agent"])) { // Create a new and shining agent
$nombre_agente = entrada_limpia($_POST["agente"]);
$direccion_agente = entrada_limpia($_POST["direccion"]);
$grupo = entrada_limpia($_POST["grupo"]);
$intervalo = entrada_limpia($_POST["intervalo"]);
$comentarios = entrada_limpia($_POST["comentarios"]);
$modo = entrada_limpia($_POST["modo"]);
$id_server = entrada_limpia($_POST["id_server"]);
$id_os = entrada_limpia($_POST["id_os"]);
$disabled = entrada_limpia($_POST["disabled"]);
// Check if agent exists (BUG WC-50518-2 )
$sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"';
$result=mysql_query($sql1);
if ($row=mysql_fetch_array($result)){
echo "<h3 class='error'>".$lang_label["agent_exists"]."</h3>";
$creacion_agente = 1;
} else {
if ($id_server != ""){
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_server) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."',$id_server)";
} else {
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."')";
}
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_agent_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["create_agent_ok"]."</h3>";
$id_agente = mysql_insert_id();
// Create special MODULE agent_keepalive
$sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",-1,'Agent Keepalive monitor')";
$result=mysql_query($sql_insert);
if (! $result) {
echo "<h3 class='error'>".$lang_label["create_keep_no"]."</h3>";
}
}
}
// ================
// Update AGENT
// ================
@ -280,8 +308,6 @@ if (isset($_GET["id_agente"])){
exit;
}
}
if (isset($_GET["creacion"]))
$creacion_agente = 1;
// Read data module if editing module
// ==================================
@ -358,6 +384,7 @@ if ((isset($_POST["update_module"])) || (isset($_POST["insert_module"]))) {
require ("general/footer.php");
exit;
}
if (isset($_POST["tipo"]))
$id_tipo_modulo = entrada_limpia($_POST["tipo"]);
if (isset($_POST["nombre"])){
@ -443,11 +470,41 @@ if (isset($_POST["oid"])){
}
}
// =========================================================
// Network Component UPDATE button to fill module data with NC data
// This code is only applied when creating a new module (not active in update mode)
// =========================================================
if ( (isset($_POST["nc"]) && ($_POST["nc"]!=-1))){
echo "<h3 class='suc'>".$lang_label["using_network_component"]."</h3>";
$id_nc = entrada_limpia($_POST["nc"]);
$sql1="SELECT * FROM tnetwork_component WHERE id_nc = '$id_nc'";
$result=mysql_query($sql1);
$row=mysql_fetch_array($result);
$modulo_id_agente = $row["id_agente"];
$modulo_id_tipo_modulo = $row["type"];
$id_module_group = $row["id_module_group"];
$modulo_nombre = $row["name"];
$modulo_descripcion = $row["description"];
$tcp_send = $row["tcp_send"];
$tcp_rcv = $row["tcp_rcv"];
$tcp_port = $row["tcp_port"];
$ip_target = $row["ip_target"];
$snmp_community = $row["snmp_community"];
$snmp_oid = $row["snmp_oid"];
$id_module_group = $row["id_module_group"];
$module_interval = $row["module_interval"];
$modulo_max = $row["max"];
$modulo_min = $row["min"];
}
// =========================================================
// MODULE INSERT
// =========================================================
if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){
if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1)) ) &&
(!isset($_POST["oid"])) &&
(isset($_POST["insert_module"]))){
if (isset($_POST["combo_snmp_oid"])) {
$combo_snmp_oid = entrada_limpia($_POST["combo_snmp_oid"]);
}
@ -462,19 +519,11 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){
}
if (!isset($modulo_min) || $modulo_min=="") {
$modulo_min= "0";
}
}
$sql_insert = "INSERT INTO tagente_modulo (id_agente,id_tipo_modulo,nombre,descripcion,max,min,snmp_oid,snmp_community,id_module_group,module_interval,ip_target,tcp_port,tcp_rcv,tcp_send) VALUES (".$id_agente.",".$id_tipo_modulo.",'".$nombre."','".$descripcion."','".$modulo_max."','".$modulo_min."', '$snmp_oid', '$snmp_community', '$id_module_group', '$module_interval', '$ip_target', '$tcp_port', '$tcp_rcv', '$tcp_send')";
// Init vars to null to avoid trash in forms
$id_tipo_modulo = "";$nombre = "";$descripcion = "";$modulo_max = "";
$modulo_min = "";// Pandora 1.2 new module data:
$tcp_send = "";$tcp_rcv = "";$tcp_port = "";$ip_target = "";
$snmp_oid = "";$snmp_community = "";$id_module_group = "";
$module_interval = "";
//echo "DEBUG: ".$sql_insert;
$result=mysql_query($sql_insert);
$id_agente_modulo = mysql_insert_id();
// Create with different estado if proc type or data type
if (
($id_tipo_modulo == 2) ||
@ -484,15 +533,15 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){
($id_tipo_modulo == 18)
){
$sql_insert = "INSERT INTO tagente_estado
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente)
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
VALUES (
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."'
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0
)";
} else {
$sql_insert = "INSERT INTO tagente_estado
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente)
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
VALUES (
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."'
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0
)";
}
$result2=mysql_query($sql_insert);
@ -501,28 +550,24 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){
} else {
echo "<h3 class='suc'>".$lang_label["add_module_ok"]."</h3>";
}
// Init vars to null to avoid trash in forms
$id_tipo_modulo = "";$nombre = "";$descripcion = "";$modulo_max = "";
$modulo_min = "";// Pandora 1.2 new module data:
$tcp_send = "";$tcp_rcv = "";$tcp_port = "";$ip_target = "";
$snmp_oid = "";$snmp_community = "";$id_module_group = "";
$module_interval = "";
}
// MODULE DELETION
// =================
if (isset($_GET["delete_module"])){ // DELETE agent module !
$id_borrar_modulo = $_GET["delete_module"];
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "AW")==0){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to delete a module without admin rights");
require ("general/noaccess.php");
echo "</table>";
require ("general/footer.php");
exit;
}
// Get information of the module to be deleted
$sql1='SELECT id_agente, nombre, id_tipo_modulo FROM tagente_modulo
WHERE id_agente_modulo = '.$id_borrar_modulo;
$result=mysql_query($sql1);
$row=mysql_fetch_array($result);
$id_agente = $row["id_agente"];
$nombre_modulo = $row["nombre"];
$id_tipo_modulo = $row["id_tipo_modulo"];
$id_grupo = dame_id_grupo($id_agente); if (give_acl($id_user, $id_grupo, "AW")==0){
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to delete a module without admin rights");
require ("general/noaccess.php");
exit;
}
// First detele from tagente_modulo
$sql_delete= "DELETE FROM tagente_modulo
WHERE id_agente_modulo = ".$id_borrar_modulo;
@ -536,20 +581,24 @@ if (isset($_GET["delete_module"])){ // DELETE agent module !
$sql_delete = "DELETE FROM tagente_estado
WHERE id_agente_modulo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
$sql_delete = "DELETE FROM tagente_datos
WHERE id_agente_modulo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
$sql_delete = "DELETE FROM tagente_datos_string
WHERE id_agente_modulo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
$sql_delete = "DELETE FROM tagente_datos_inc
WHERE id_agente_modulo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
}
// -----------------------------------
// Load page depending on tab selected
// -----------------------------------
if (isset($_GET["tab"]))
$tab = $_GET["tab"];
else

View File

@ -1,14 +1,19 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -17,149 +22,184 @@
// 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");
// Load global vars
require("include/config.php");
if (give_acl($id_user, 0, "AW") != 1) {
if (give_acl($id_user, 0, "AW") != 1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["offset"]))
$offset = entrada_limpia($_GET["offset"]);
else
$offset = 0;
if (isset($_GET["borrar_agente"])){ // if delete agent
$id_agente = entrada_limpia($_GET["borrar_agente"]);
$agent_name = dame_nombre_agente($id_agente);
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "AW")==1){
// Firts delete from agents table
$sql_delete= "DELETE FROM tagente
WHERE id_agente = ".$id_agente;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_agent_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_agent_ok"]."</h3>";
// Delete agent access table
$sql_delete = "DELETE FROM tagent_access
WHERE id_agent = ".$id_agente;
// Delete tagente_datos data
$result=mysql_query($sql_delete);
$sql_delete4="DELETE FROM tagente_datos
WHERE id_agente=".$id_agente;
$result=mysql_query($sql_delete4);
// Delete tagente_datos_string data
$result=mysql_query($sql_delete);
$sql_delete4="DELETE FROM tagente_datos_string
WHERE id_agente=".$id_agente;
$result=mysql_query($sql_delete4);
// Delete from tagente_datos
$sql1='SELECT * FROM tagente_modulo
WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete4="DELETE FROM tagente_datos_inc
WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result=mysql_query($sql_delete4);
}
$sql_delete2 ="DELETE FROM tagente_modulo
WHERE id_agente = ".$id_agente;
$sql_delete3 ="DELETE FROM tagente_estado
WHERE id_agente = ".$id_agente;
$result=mysql_query($sql_delete2);
$result=mysql_query($sql_delete3);
audit_db($id_user,$REMOTE_ADDR, "Agent '$agent_name' deleted",
"Agent Management");
} else { // NO permissions.
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
"Trying to delete agent '$agent_name'");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["offset"]))
$offset = entrada_limpia($_GET["offset"]);
else
$offset = 0;
if (isset($_GET["borrar_agente"])){ // if delete agent
$id_agente = entrada_limpia($_GET["borrar_agente"]);
$agent_name = dame_nombre_agente($id_agente);
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "AW")==1){
// Firts delete from agents table
$sql_delete= "DELETE FROM tagente
WHERE id_agente = ".$id_agente;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_agent_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_agent_ok"]."</h3>";
// Delete agent access table
$sql_delete = "DELETE FROM tagent_access
WHERE id_agent = ".$id_agente;
// Delete tagente_datos data
$result=mysql_query($sql_delete);
$sql_delete4="DELETE FROM tagente_datos
WHERE id_agente=".$id_agente;
$result=mysql_query($sql_delete4);
// Delete tagente_datos_string data
$result=mysql_query($sql_delete);
$sql_delete4="DELETE FROM tagente_datos_string
WHERE id_agente=".$id_agente;
$result=mysql_query($sql_delete4);
// Delete from tagente_datos
$sql1='SELECT * FROM tagente_modulo
WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete4="DELETE FROM tagente_datos_inc
WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result=mysql_query($sql_delete4);
}
$sql_delete2 ="DELETE FROM tagente_modulo
WHERE id_agente = ".$id_agente;
$sql_delete3 ="DELETE FROM tagente_estado
WHERE id_agente = ".$id_agente;
$result=mysql_query($sql_delete2);
$result=mysql_query($sql_delete3);
audit_db($id_user,$REMOTE_ADDR, "Agent '$agent_name' deleted",
"Agent Management");
} else { // NO permissions.
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to delete agent '$agent_name'");
require ("general/noaccess.php");
exit;
}
}
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["agent_defined2"]."
<a href='help/".$help_code."/chap3.php#3' target='_help' class='help'>
<span>".$lang_label["help"]."</span></a></h2>";
$sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os
}
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["agent_defined2"]."
<a href='help/".$help_code."/chap3.php#3' target='_help' class='help'>
<span>".$lang_label["help"]."</span></a></h2>";
// Show group selector
if (isset($_POST["ag_group"])){
$ag_group = $_POST["ag_group"];
echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group_refresh=".$ag_group."'>";
} else {
echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
}
echo "<table cellpadding='3' cellspacing='3'><tr>";
echo "<td>".$lang_label["group"]."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();'
class='w130'>";
if ( $ag_group > 1 ){
echo "<option value='".$ag_group."'>".dame_nombre_grupo($ag_group).
"</option>";
}
echo "<option value=1>".dame_nombre_grupo(1)."</option>"; // Group all is always active
$mis_grupos = list_group ($id_user); //Print combo for groups and set an array with all groups
echo "</select>";
echo "<td valign='middle'>
<noscript>
<input name='uptbutton' type='submit' class='sub'
value='".$lang_label["show"]."'>
</noscript>
</td>
</form>
</table>";
if ($ag_group > 1){
$sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os
FROM tagente WHERE id_grupo = $ag_group ORDER BY nombre LIMIT $offset, $block_size";
$sql2="SELECT COUNT(id_agente) FROM tagente WHERE id_grupo = $ag_group";
} else {
$sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os
FROM tagente ORDER BY nombre LIMIT $offset, $block_size";
$result=mysql_query($sql1);
$sql2="SELECT COUNT(id_agente) FROM tagente";
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$total_events = $row2[0];
}
$result=mysql_query($sql1);
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$total_events = $row2[0];
// Prepare pagination
echo "<div style='height: 20px'> </div>";
pagination ($total_events, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente", $offset);
echo "<div style='height: 20px'> </div>";
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' width='700'>";
echo "<th>".$lang_label["agent_name"];
echo "<th>".$lang_label["os"];
echo "<th>".$lang_label["group"];
echo "<th>".$lang_label["description"];
echo "<th>".$lang_label["delete"];
$color=1;
while ($row=mysql_fetch_array($result)){
$id_grupo = $row["id_grupo"];
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if (give_acl($id_user, $id_grupo, "AW")==1){
// Agent name
echo "<tr><td class='$tdcolor'>
<b><a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&
id_agente=".$row["id_agente"]."'>".$row["nombre"]."</a></b></td>";
// Operating System icon
echo "<td class='$tdcolor' align='center'>
<img src='images/".dame_so_icon($row["id_os"])."'></td>";
// Group icon and name
echo "<td class='$tdcolor'>
<img src='images/groups_small/".show_icon_group($id_grupo).".png' class='bot' border='0'>
&nbsp; ".dame_grupo($id_grupo)."</td>";
// Description
echo "<td class='$tdcolor'>".$row["comentarios"]."</td>";
// Action
echo "<td class='$tdcolor' align='center'>
<a href='index.php?sec=gagente&
sec2=godmode/agentes/modificar_agente&
borrar_agente=".$row["id_agente"]."'
onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\'))
return false;'>
<img border='0' src='images/cancel.gif'></a></td>";
// Prepare pagination
pagination ($total_events, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente", $offset);
echo "<div style='height: 20px'> </div>";
if (mysql_num_rows($result)){
echo "<table cellpadding='4' cellspacing='4' width='700'>";
echo "<th>".$lang_label["agent_name"];
echo "<th>".$lang_label["os"];
echo "<th>".$lang_label["group"];
echo "<th>".$lang_label["description"];
echo "<th>".$lang_label["delete"];
$color=1;
while ($row=mysql_fetch_array($result)){
$id_grupo = $row["id_grupo"];
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if (give_acl($id_user, $id_grupo, "AW")==1){
// Agent name
echo "<tr><td class='$tdcolor'>
<b><a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=main&
id_agente=".$row["id_agente"]."'>".$row["nombre"]."</a></b></td>";
// Operating System icon
echo "<td class='$tdcolor' align='center'>
<img src='images/".dame_so_icon($row["id_os"])."'></td>";
// Group icon and name
echo "<td class='$tdcolor'>
<img src='images/groups_small/".show_icon_group($id_grupo).".png' class='bot' border='0'>
&nbsp; ".dame_grupo($id_grupo)."</td>";
// Description
echo "<td class='$tdcolor'>".$row["comentarios"]."</td>";
// Action
echo "<td class='$tdcolor' align='center'>
<a href='index.php?sec=gagente&
sec2=godmode/agentes/modificar_agente&
borrar_agente=".$row["id_agente"]."'
onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\'))
return false;'>
<img border='0' src='images/cancel.gif'></a></td>";
}
echo "<tr><td colspan='5'><div class='raya'></div></td></tr>";
echo "<tr><td align='right' colspan='5'>";
echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&creacion=1'>";
echo "<input type='submit' class='sub' name='crt'
value='".$lang_label["create_agent"]."'>";
echo "</form></td></tr>";
echo "</table>";
} else {
// If no data... let's show a beautiful button to create agent
// This is a piece of crap because we're duplicanting code above
// of this, don't do again, Raul, please.
echo "<div class='nf'>".$lang_label["no_agent_def"]."</div>";
echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&creacion=1'>";
echo "<input type='submit' class='sub' name='crt'
value='".$lang_label["create_agent"]."'>";
echo "</form>";
}
echo "<tr><td colspan='5'><div class='raya'></div></td></tr>";
echo "<tr><td align='right' colspan='5'>";
echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&create_agent=1'>";
echo "<input type='submit' class='sub' name='crt'
value='".$lang_label["create_agent"]."'>";
echo "</form></td></tr>";
echo "</table>";
} else {
// If no data... let's show a beautiful button to create agent
// This is a piece of crap because we're duplicanting code above
// of this, don't do again, Raul, please.
echo "<div class='nf'>".$lang_label["no_agent_def"]."</div>";
echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&creacion=1'>";
echo "<input type='submit' class='sub' name='crt'
value='".$lang_label["create_agent"]."'>";
echo "</form>";
}
?>

View File

@ -1,3 +1,27 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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.
?>
<script language="JavaScript" type="text/javascript">
<!--
function type_change()
@ -134,86 +158,98 @@ if (give_acl($id_user, 0, "AW")!=1) {
exit;
};
// ==========================
// MODULE VISUALIZATION TABLE
// ==========================
if ( $creacion_agente != 1) {
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"
ORDER BY nombre';
$result=mysql_query($sql1);
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["assigned_modules"]."
<a href='help/".$help_code."/chap3.php#321' target='_help' class='help'>
<span>".$lang_label["help"]."</span></a></h2>";
if ($row=mysql_num_rows($result)){
echo '<table width="700" cellpadding="3" cellspacing="3" class="fon">';
echo '<tr>';
echo "<th>".$lang_label["module_name"];
echo "<th>".$lang_label["type"];
echo "<th>".$lang_label["interval"];
echo "<th>".$lang_label["description"];
echo "<th>".$lang_label["module_group"];
echo "<th>".$lang_label["max_min"];
echo "<th width=50>".$lang_label["action"];
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$id_tipo = $row["id_tipo_modulo"];
$nombre_modulo =$row["nombre"];
$descripcion = $row["descripcion"];
$module_max = $row["max"];
$module_min = $row["min"];
$module_interval2 = $row["module_interval"];
$module_group2 = $row["id_module_group"];
echo "<tr><td class='".$tdcolor."_id'>".$nombre_modulo;
echo "<td class='".$tdcolor."f9'>";
if ($id_tipo > 0) {
echo "<img src='images/".show_icon_type($id_tipo)."' border=0>";
}
if ($module_interval2!=0){
echo "<td class='$tdcolor'>".$module_interval2;
} else {
echo "<td class='$tdcolor'> N/A";
}
echo "<td class='$tdcolor' title='$descripcion'>".substr($descripcion,0,30)."</td>";
echo "<td class='$tdcolor'>".
substr(dame_nombre_grupomodulo($module_group2),0,15)."</td>";
echo "<td class='$tdcolor'>";
if ($module_max == $module_min) {
$module_max = "N/A";
$module_min = "N/A";
}
echo $module_max." / ".$module_min;
echo "<td class='$tdcolor'>";
if ($id_tipo != -1)
echo "<a href='index.php?sec=gagente&
tab=module&
sec2=godmode/agentes/configurar_agente&
id_agente=".$id_agente."&
delete_module=".$row["id_agente_modulo"]."'>
<img src='images/cancel.gif' border=0 alt='".$lang_label["delete"]."'>
</b></a> &nbsp; ";
echo "<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&
id_agente=".$id_agente."&
tab=module&
update_module=".$row["id_agente_modulo"]."#modules'>
<img src='images/config.gif' border=0 alt='".$lang_label["update"]."' onLoad='type_change()'></b></a>";
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"
ORDER BY nombre';
$result=mysql_query($sql1);
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["assigned_modules"]."
<a href='help/".$help_code."/chap3.php#321' target='_help' class='help'>
<span>".$lang_label["help"]."</span></a>";
echo "&nbsp;&nbsp;<a class='info' href='#module_assignment'> <span>".$lang_label["module_asociation_form"]."</span><img src='../images/wand.png'></a>";
echo "</h2>";
if ($row=mysql_num_rows($result)){
echo '<table width="700" cellpadding="3" cellspacing="3" class="fon">';
echo '<tr>';
echo "<th>".$lang_label["module_name"];
echo "<th>".$lang_label["type"];
echo "<th>".$lang_label["interval"];
echo "<th>".$lang_label["description"];
echo "<th>".$lang_label["module_group"];
echo "<th>".$lang_label["max_min"];
echo "<th width=50>".$lang_label["action"];
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
echo "<tr><td colspan='7'><div class='raya'></div></td></tr>";
echo "</table>";
} else
echo "<div class='nf'>No modules</div>";
}
$id_tipo = $row["id_tipo_modulo"];
$nombre_modulo =$row["nombre"];
$descripcion = $row["descripcion"];
$module_max = $row["max"];
$module_min = $row["min"];
$module_interval2 = $row["module_interval"];
$module_group2 = $row["id_module_group"];
echo "<tr><td class='".$tdcolor."_id'>".$nombre_modulo;
echo "<td class='".$tdcolor."f9'>";
if ($id_tipo > 0) {
echo "<img src='images/".show_icon_type($id_tipo)."' border=0>";
}
if ($module_interval2!=0){
echo "<td class='$tdcolor'>".$module_interval2;
} else {
echo "<td class='$tdcolor'> N/A";
}
echo "<td class='$tdcolor' title='$descripcion'>".substr($descripcion,0,30)."</td>";
echo "<td class='$tdcolor'>".
substr(dame_nombre_grupomodulo($module_group2),0,15)."</td>";
echo "<td class='$tdcolor'>";
if ($module_max == $module_min) {
$module_max = "N/A";
$module_min = "N/A";
}
echo $module_max." / ".$module_min;
echo "<td class='$tdcolor'>";
if ($id_tipo != -1)
echo "<a href='index.php?sec=gagente&
tab=module&
sec2=godmode/agentes/configurar_agente&
id_agente=".$id_agente."&
delete_module=".$row["id_agente_modulo"]."'>
<img src='images/cancel.gif' border=0 alt='".$lang_label["delete"]."'>
</b></a> &nbsp; ";
echo "<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&
id_agente=".$id_agente."&
tab=module&
update_module=".$row["id_agente_modulo"]."#modules'>
<img src='images/config.gif' border=0 alt='".$lang_label["update"]."' onLoad='type_change()'></b></a>";
}
echo "<tr><td colspan='7'><div class='raya'></div></td></tr>";
echo "</table>";
} else
echo "<div class='nf'>No modules</div>";
// ==========================
// Module assignment form
// ==========================
echo "<a name='module_assignment'>";
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["module_asociation_form"]."</a><a href='help/".$help_code."/chap3.php#321' target='_help' class='help'>
&nbsp;<span>".$lang_label["help"]."</span></a></h2>";
if ($update_module == "1")
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'#module_assignment">';
else // equal than previous, but without #module_assigment
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">';
echo '<form name="modulo" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">';
if ($update_module == "1"){
echo '<input type="hidden" name="update_module" value=1>';
echo '<input type="hidden" name="id_agente_modulo" value="'.$id_agente_modulo.'">';
@ -224,27 +260,59 @@ else { // Create
if ($ip_target == ""){
$ip_target = $direccion_agente;
$snmp_community = "public";
$module_interval = $intervalo;
if ($module_interval == 0)
$module_interval = $intervalo;
}
}
echo "<h2>".$lang_label["agent_conf"]." &gt; ".$lang_label["module_asociation_form"]."<a href='help/".$help_code."/chap3.php#321' target='_help' class='help'>
&nbsp;<span>".$lang_label["help"]."</span></a></h2>";
echo '<a name="modules"> <!-- Dont Delete !! -->';
echo '<table width="650" cellpadding="3" cellspacing="3" class="fon">';
echo "<tr><td class='lb' rowspan='8' width='1'>";
echo '<table width="700" cellpadding="3" cellspacing="3" class="fon">';
echo "<tr><td class='lb' rowspan='11' width='1'>";
echo '<tr><td class="datos3">';
echo $lang_label["network_component"];
if ($update_module != "1"){
echo "<td class='datos3' colspan=2>";
echo '<select name="nc">';
$sql1='SELECT * FROM tnetwork_component ORDER BY name';
$result=mysql_query($sql1);
echo "<option value=-1>---".$lang_label["manual_config"]."---</option>";
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_nc"]."'>".substr($row["name"],0,20)." / ".substr($row["description"],0,20);
}
echo "</select>";
echo '<td class="datos3" <input align="right" name="updbutton" type="submit" class="sub" value="'.$lang_label["update"].'">';
} else {
echo "<td class='datos3' colspan=3 align='left'>";
echo "<span class='redi'>";
echo $lang_label["not_available_in_edit_mode"];
echo "</span>";
}
echo '<tr>';
echo '<td class="datos2">'.$lang_label["module_name"];
echo '<td class="datos2"><input type="text" name="nombre" size="25" value="'.$modulo_nombre.'">';
echo '<td class="datos2">'.$lang_label["ip_target"];
echo '<td class="datos2"><input type="text" name="ip_target" size="25" value="'.$ip_target.'">';
echo "<tr>";
echo "<td colspan='4'>";
//-- Module type combobox
echo "<tr>";
echo "<td class='datos'>".$lang_label["module_type"];
echo "<td class='datos'>";
if ($update_module == "1") {
echo "<input type='hidden' name='tipo' value='".$modulo_id_tipo_modulo."'>";
echo "<span class='redi'>".$lang_label["no_change_field"]."</span>";
echo "<span class='redi'>".$lang_label["not_available_in_edit_mode"]."</span>";
} else {
echo '<select name="tipo" onChange="type_change()">';
$sql1='SELECT id_tipo, nombre FROM ttipo_modulo ORDER BY nombre';
$result=mysql_query($sql1);
if (($update_module == "1") OR ($modulo_id_tipo_modulo != 0)) {
echo "<option value='".$modulo_id_tipo_modulo ."'>".dame_nombre_tipo_modulo ($modulo_id_tipo_modulo);
}
echo "<option>--</option>";
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_tipo"]."'>".$row["nombre"];
@ -259,7 +327,7 @@ if ($update_module == "1") {
<td class="datos">
<?php
echo '<select name="id_module_group">';
if ($update_module == "1"){
if (($id_module_group != 0) OR ($update_module == "1")){
echo "<option value='".$id_module_group."'>".dame_nombre_grupomodulo($id_module_group);
}
$sql1='SELECT * FROM tmodule_group';
@ -271,30 +339,26 @@ if ($update_module == "1") {
?>
</select>
<tr><td class="datos2"><?php echo $lang_label["module_name"] ?>
<td class="datos2"><input type="text" name="nombre" size="20" value="<?php echo $modulo_nombre ?>">
<tr>
<td class="datos2"><?php echo $lang_label["module_interval"] ?><td class="datos2">
<input type="text" name="module_interval" size="5" value="<?php echo $module_interval ?>">
<tr><td class="datos"><?php echo $lang_label["ip_target"] ?>
<td class="datos"><input type="text" name="ip_target" size="20" value="<?php echo $ip_target ?>">
<td class="datos"><?php echo $lang_label["tcp_port"] ?>
<td class="datos"><input type="text" name="tcp_port" size="5" value="<?php echo $tcp_port ?>">
<tr><td class="datos2"><?php echo $lang_label["snmp_oid"] ?>
<td class="datos2"><input type="text" name="snmp_oid" size="15" value="<?php echo $snmp_oid ?>">
<input type="submit" name="oid" value="Get Value">
<td class="datos2"><?php echo $lang_label["snmp_community"] ?>
<td class="datos2"><input type="text" name="snmp_community" size="20" value="<?php echo $snmp_community ?>">
<td class="datos2"><?php echo $lang_label["tcp_port"] ?>
<td class="datos2"><input type="text" name="tcp_port" size="5" value="<?php echo $tcp_port ?>">
<tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?>
<td colspan=3 class="datos"><select name="combo_snmp_oid">
<td class="datos"><input type="text" name="snmp_oid" size="25" value="<?php echo $snmp_oid ?>">
<td class="datos"><?php echo $lang_label["snmp_community"] ?>
<td class="datos"><input type="text" name="snmp_community" size="25" value="<?php echo $snmp_community ?>">
<tr><td class="datos2"><?php echo $lang_label["snmp_oid"] ?>
<td colspan=2 class="datos2"><select name="combo_snmp_oid">
<?php
// FILL OID Combobox
if (isset($_POST["oid"])){
for (reset($snmpwalk); $i = key($snmpwalk); next($snmpwalk)) {
// OJO, al indice tengo que restarle uno, el SNMP funciona con indices a partir de 0
@ -306,21 +370,22 @@ if (isset($_POST["oid"])){
}
?>
</select>
<td class="datos2"><input type="submit" name="oid" value="SNMP Walk">
<tr><td class="datos2t"><?php echo $lang_label["tcp_send"] ?>
<td class="datos2"><textarea name="tcp_send" cols="17" rows="3"><?php echo $tcp_send ?></textarea>
<tr><td class="datost"><?php echo $lang_label["tcp_send"] ?>
<td class="datos"><textarea name="tcp_send" cols="22" rows="2"><?php echo $tcp_send ?></textarea>
<td class="datos2t"><?php echo $lang_label["tcp_rcv"] ?>
<td class="datos2"><textarea name="tcp_rcv" cols="17" rows="3"><?php echo $tcp_rcv ?></textarea>
<td class="datost"><?php echo $lang_label["tcp_rcv"] ?>
<td class="datos"><textarea name="tcp_rcv" cols="22" rows="2"><?php echo $tcp_rcv ?></textarea>
<tr><td class="datos"><?php echo $lang_label["mindata"] ?>
<td class="datos"><input type="text" name="modulo_min" size="5" value="<?php echo $modulo_min ?>">
<td class="datos"><?php echo $lang_label["maxdata"] ?>
<td class="datos"><input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>">
<tr><td class="datos2"><?php echo $lang_label["mindata"] ?>
<td class="datos2"><input type="text" name="modulo_min" size="5" value="<?php echo $modulo_min ?>">
<td class="datos2"><?php echo $lang_label["maxdata"] ?>
<td class="datos2"><input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>">
<tr><td class="datos2t"><?php echo $lang_label["comments"] ?>
<td class="datos2" colspan=3>
<textarea name="descripcion" cols=52 rows=2>
<tr><td class="datost"><?php echo $lang_label["comments"] ?>
<td class="datos" colspan=3>
<textarea name="descripcion" cols=71 rows=2>
<?php echo $modulo_descripcion ?>
</textarea>
<tr><td colspan='5'><div class='raya'></div></td></tr>

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -16,7 +22,6 @@
// 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 ( (give_acl($id_user, 0, "LM")==1)){

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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");

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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");
@ -71,11 +74,12 @@ if (comprueba_login() == 0)
<span>".$lang_label["help"]."</span></a>
</h3>";
echo "<table cellpadding=3 cellspacing=3>";
echo "<th class='w40'>".$lang_label["icon"]."</th>";
echo "<th class='w180'>".$lang_label["group_name"]."</th>";
echo "<th class='w80'>".$lang_label["delete"]."</th>";
$sql1='SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre';
echo "<table cellpadding=3 cellspacing=3 width=400>";
echo "<th>".$lang_label["icon"]."</th>";
echo "<th>".$lang_label["group_name"]."</th>";
echo "<th>".$lang_label["parent"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
$sql1='SELECT * FROM tgrupo ORDER BY nombre';
$result=mysql_query($sql1);
$color=0;
while ($row=mysql_fetch_array($result)){
@ -91,7 +95,7 @@ if (comprueba_login() == 0)
echo "
<tr>
<td class='$tdcolor' align='center'>
<img src='images/groups_small/".show_icon_group($row["id_grupo"]).".png'
<img src='images/groups_small/".$row["icon"].".png'
border='0'>
</td>
<td class='$tdcolor'>
@ -99,6 +103,9 @@ if (comprueba_login() == 0)
sec2=godmode/grupos/configurar_grupo&
id_grupo=".$row["id_grupo"]."'>".$row["nombre"]."</a>
</b></td>
<td class='$tdcolor'>
".dame_nombre_grupo ($row["parent"])."
</td>
<td class='$tdcolor' align='center'>
<a href='index.php?sec=gagente&
sec2=godmode/grupos/lista_grupos&
@ -111,8 +118,8 @@ if (comprueba_login() == 0)
</tr>";
}
}
echo "<tr><td colspan='3'><div class='raya'></div></td></tr>";
echo "<tr><td colspan='3' align='right'>";
echo "<tr><td colspan='4'><div class='raya'></div></td></tr>";
echo "<tr><td colspan='4' align='right'>";
echo "<form method=post action='index.php?sec=gagente&
sec2=godmode/grupos/configurar_grupo&creacion_grupo=1'>";
echo "<input type='submit' class='sub' name='crt' value='".$lang_label["create_group"]."'>";

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnol<6F>icas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -16,7 +22,6 @@
// 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.
if (comprueba_login() == 0){
$id_user = $_SESSION["id_usuario"];
if ( (give_acl($id_user, 0, "LM")==1) OR (give_acl($id_user, 0, "AW")==1 ) OR (give_acl($id_user, 0, "PM")==1) OR (give_acl($id_user, 0, "DM")==1) OR (give_acl($id_user, 0, "UM")==1 )){
@ -31,12 +36,13 @@ if (comprueba_login() == 0){
<div id="menug">
<div id="god">
<?php
<?PHP
if ((give_acl($id_user, 0, "AW")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/agentes/modificar_agente" || $_GET["sec2"] == "godmode/agentes/configurar_agente")){
echo '<div id="god1s">';
}
else echo '<div id="god1">';
else
echo '<div id="god1">';
echo '<ul class="mn"><li><a href="index.php?sec=gagente&amp;sec2=godmode/agentes/modificar_agente" class="mn">'.$lang_label["manage_agents"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gagente"){
@ -49,10 +55,44 @@ if (comprueba_login() == 0){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/grupos/lista_grupos" || $_GET["sec2"] == "godmode/grupos/configurar_grupo")){
echo "<div class='arrowgs'>";
}
else echo "<div class='arrowg'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gagente&amp;sec2=godmode/grupos/lista_grupos' class='mn'>".$lang_label["manage_groups"]."</a></li></ul></div>";
}
}
if ((give_acl($id_user, 0, "AW")==1)){
if (isset($_GET["sec"]) && ($_GET["sec"] == "gmodules"))
echo '<div id="god_module_sel">';
else
echo '<div id="god_module">';
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.$lang_label["manage_modules"].'</a></li></ul></div>';
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_nc_groups")
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".$lang_label["nc_groups"]."</a></li></ul></div>";
}
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_network_components")
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".$lang_label["network_components"]."</a></li></ul></div>";
}
// Network Profiles
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_network_templates")
echo "<div class='arrowgs'>";
else
echo "<div class='arrowg'>";
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".$lang_label["network_templates"]."</a></li></ul></div>";
}
}
if ((give_acl($id_user, 0, "LM")==1)){
if (isset($_GET["sec2"]) && ($_GET["sec2"] == "godmode/alertas/modificar_alerta" || $_GET["sec2"] == "godmode/alertas/configurar_alerta")){
echo '<div id="god2s">';

View File

@ -0,0 +1,119 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access SNMP Group Management");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["create"])){ // Create module
$name = entrada_limpia ($_POST["name"]);
$parent = entrada_limpia ($_POST["parent"]);
$sql_insert="INSERT INTO tnetwork_component_group (name,parent)
VALUES ('$name', '$parent')";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
$id_sg = mysql_insert_id();
}
}
if (isset($_GET["update"])){ // if modified any parameter
$id_sg = entrada_limpia ($_GET["id_sg"]);
$name = entrada_limpia ($_POST["name"]);
$parent = entrada_limpia ($_POST["parent"]);
$sql_update ="UPDATE tnetwork_component_group
SET name = '$name', parent = '$parent'
WHERE id_sg = '$id_sg'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
}
if (isset($_GET["delete"])){ // if delete
$id_sg = entrada_limpia ($_GET["id_sg"]);
$sql_delete= "DELETE FROM tnetwork_component_group WHERE id_sg = ".$id_sg;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
$result=mysql_query($sql_delete);
}
echo "<h2>".$lang_label["network_component_group_management"]."</h2>";
echo "<table cellpadding=4 cellspacing=4 width=550>";
echo "<th>".$lang_label["name"]."</th>";
echo "<th>".$lang_label["parent"]."</th>";
echo "<th>".$lang_label["delete"]."</th>";
$sql1='SELECT * FROM tnetwork_component_group ORDER BY parent';
$result=mysql_query($sql1);
$color=0;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>
<td class='$tdcolor'>
<b><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups_form&edit=1&id_sg=".$row["id_sg"]."'>".$row["name"]."</A></B>
</td>
<td class='$tdcolor'>
".give_network_component_group_name ($row["parent"])."
</td>
<td class='$tdcolor' align='center'>
<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&delete=1&id_sg=".$row["id_sg"]."'
onClick='if (!confirm(\' ".$lang_label["are_you_sure"]."\'))
return false;'>
<img border='0' src='images/cancel.gif'></a>
</td>
</tr>";
}
echo "<tr><td colspan='3'><div class='raya'></div></td></tr>";
echo "<tr><td colspan='3' align='right'>";
echo "<form method=post action='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups_form&create=1'>";
echo "<input type='submit' class='sub' name='crt' value='".$lang_label["create"]."'>";
echo "</form></td></tr></table>";
?>

View File

@ -0,0 +1,87 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access SNMO Groups Management");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["edit"])){ // Edit mode
$id_sg = entrada_limpia ($_GET["id_sg"]);
$sql1 = "SELECT * FROM tnetwork_component_group where id_sg = $id_sg";
$result=mysql_query($sql1);
$row=mysql_fetch_array($result);
$name = $row["name"];
$parent = $row["parent"];
} elseif (isset($_GET["create"])){
$id_sg = -1;
$name = "";
$parent = "";
}
echo "<h2>".$lang_label["network_component_group_management"]."</h2>";
echo '<table width="500" cellspacing="4" cellpadding="4">';
// Different Form url if it's a create or if it's a update form
if ($id_sg != -1)
echo "<form name='snmp_c' method='post' action='http://pandora.localhost/index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&update=1&id_sg=$id_sg'>";
else
echo "<form name='snmp_c' method='post' action='http://pandora.localhost/index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&create=1'>";
echo "<tr><td class='lb' rowspan='3' width='5'>";
echo "<td class='datos'>".$lang_label["name"];
echo "<td class='datos'><input type='text' name='name' size=30 value='$name'>";
echo "<tr>";
echo "<td class='datos2'>".$lang_label["parent"];
echo "<td class='datos2'>";
echo "<select name='parent'>";
echo "<option value='$parent'>".give_network_component_group_name($parent);
$sql1 = "SELECT * FROM tnetwork_component_group where id_sg != '$parent'";
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result))
echo "<option value='".$row["id_sg"]."'>".give_network_component_group_name($row["id_sg"]);
echo "</select>";
echo " <tr><td colspan='3'><div class='raya'></div></td></tr>
<tr><td colspan='3' align='right'>";
if ($id_sg == -1)
echo "<input name='crtbutton' type='submit' class='sub' value='".$lang_label["create"]."'>";
else
echo "<input name='uptbutton' type='submit' class='sub' value='".$lang_label["update"]."'>";
echo "</form></table>";
?>

View File

@ -0,0 +1,255 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// 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");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
$type = "0";
$name = "";
$description = "";
$modulo_max="0";
$modulo_min="0";
$tcp_send="";
$tcp_rcv="";
$tcp_port="";
$snmp_oid="";
$snmp_community="";
$id_module_group="";
$module_interval="";
$id_group = "";
// ------------------
// CREATE MODULE
// ------------------
if (isset($_GET["create"])){ // Create module
if (isset($_POST["tipo"]))
$type = entrada_limpia($_POST["tipo"]);
if (isset($_POST["name"]))
$name = entrada_limpia($_POST["name"]);
if (isset($_POST["descripcion"]))
$description = entrada_limpia($_POST["descripcion"]);
if (isset($_POST["modulo_max"]))
$modulo_max = entrada_limpia($_POST["modulo_max"]);
if (isset($_POST["modulo_min"]))
$modulo_min = entrada_limpia($_POST["modulo_min"]);
if (isset($_POST["tcp_send"]))
$tcp_send = entrada_limpia($_POST["tcp_send"]);
if (isset($_POST["tcp_rcv"]))
$tcp_rcv = entrada_limpia($_POST["tcp_rcv"]);
if (isset($_POST["tcp_port"]))
$tcp_port = entrada_limpia($_POST["tcp_port"]);
if (isset($_POST["snmp_oid"]))
$snmp_oid = entrada_limpia($_POST["snmp_oid"]);
if (isset($_POST["snmp_community"]))
$snmp_community = entrada_limpia($_POST["snmp_community"]);
if (isset($_POST["id_module_group"]))
$id_module_group = entrada_limpia($_POST["id_module_group"]);
if (isset($_POST["module_interval"]))
$module_interval = entrada_limpia($_POST["module_interval"]);
if (isset($_POST["id_group"]))
$id_group = entrada_limpia($_POST["id_group"]);
$sql_insert="INSERT INTO tnetwork_component (name, description, module_interval, type, max, min, tcp_send, tcp_rcv, tcp_port, snmp_oid, snmp_community, id_module_group, id_group)
VALUES ('$name', '$description', '$module_interval', '$type', '$modulo_max', '$modulo_min', '$tcp_send', '$tcp_rcv', '$tcp_port', '$snmp_oid' ,'$snmp_community', '$id_module_group', '$id_group')";
$result=mysql_query($sql_insert);
if (! $result)
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
else {
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
$id_module = mysql_insert_id();
}
}
// ------------------
// UPDATE MODULE
// ------------------
if (isset($_GET["update"])){ // if modified any parameter
$id_nc = entrada_limpia ($_GET["id_nc"]);
if (isset($_POST["tipo"]))
$type = entrada_limpia($_POST["tipo"]);
if (isset($_POST["name"]))
$name = entrada_limpia($_POST["name"]);
if (isset($_POST["descripcion"]))
$description = entrada_limpia($_POST["descripcion"]);
if (isset($_POST["modulo_max"]))
$modulo_max = entrada_limpia($_POST["modulo_max"]);
if ($modulo_max == "")
$modulo_max = 0;
if (isset($_POST["modulo_min"]))
$modulo_min = entrada_limpia($_POST["modulo_min"]);
if ($modulo_min == "")
$modulo_min = 0;
if (isset($_POST["tcp_send"]))
$tcp_send = entrada_limpia($_POST["tcp_send"]);
if (isset($_POST["tcp_rcv"]))
$tcp_rcv = entrada_limpia($_POST["tcp_rcv"]);
if (isset($_POST["tcp_port"]))
$tcp_port = entrada_limpia($_POST["tcp_port"]);
if (isset($_POST["snmp_oid"]))
$snmp_oid = entrada_limpia($_POST["snmp_oid"]);
if (isset($_POST["snmp_community"]))
$snmp_community = entrada_limpia($_POST["snmp_community"]);
if (isset($_POST["id_module_group"]))
$id_module_group = entrada_limpia($_POST["id_module_group"]);
if (isset($_POST["module_interval"]))
$module_interval = entrada_limpia($_POST["module_interval"]);
if (isset($_POST["id_group"]))
$id_group = entrada_limpia($_POST["id_group"]);
$sql_update ="UPDATE tnetwork_component SET name = '$name',
description = '$description', snmp_oid = '$snmp_oid', snmp_community = '$snmp_community',
id_group = '$id_group', tcp_rcv = '$tcp_rcv', tcp_send = '$tcp_send', max = '$modulo_max',
min = '$modulo_min', tcp_port = '$tcp_port', id_module_group = '$id_module_group', type = '$type',
module_interval = '$module_interval' WHERE id_nc = '$id_nc'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
}
// ------------------
// DELETE MODULE
// ------------------
if (isset($_GET["delete"])){ // if delete
$id_nc = entrada_limpia ($_GET["id_nc"]);
$sql_delete= "DELETE FROM tnetwork_component WHERE id_nc = ".$id_nc;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
$sql_delete= "DELETE FROM tnetwork_profile_component WHERE id_nc = ".$id_nc;
$result=mysql_query($sql_delete);
}
// ------------------
// SHOW MODULES
// ------------------
echo "<h2>".$lang_label["network_component_management"]."</h2>";
// Show group selector
if (isset($_POST["ncgroup"]))
$ncgroup = $_POST["ncgroup"];
else
$ncgroup = 0;
echo "<form method='POST' action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components'>";
echo "<table cellpadding='3' cellspacing='3'><tr>";
echo "<td>".$lang_label["group"]."</td>";
echo "<td valign='middle'>";
echo "<select name='ncgroup' onChange='javascript:this.form.submit();'>";
echo "<option value='$ncgroup'>".give_network_component_group_name($ncgroup);
if ($ncgroup != 0)
echo "<option value='0'>".$lang_label["all"];
$sql1 = "SELECT * FROM tnetwork_component_group where id_sg != '$ncgroup'";
$result = mysql_query($sql1);
while ($row = mysql_fetch_array ($result))
echo "<option value='" . $row["id_sg"] . "'>". give_network_component_group_name ($row["id_sg"]);
echo "</select>";
echo "<td valign='middle'>";
echo "<input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'>";
echo "</td></form></table><br><br>";
if ($ncgroup != 0)
$sql1 = "SELECT * FROM tnetwork_component WHERE id_group = $ncgroup";
else
$sql1 = "SELECT * FROM tnetwork_component ORDER BY id_group";
$result = mysql_query ($sql1);
if ( $row = mysql_num_rows ($result)){
echo '<table width="750" cellpadding="4" cellspacing="4">';
echo '<tr>';
echo "<th>".$lang_label["module_name"];
echo "<th>".$lang_label["type"];
echo "<th>".$lang_label["interval"];
echo "<th>".$lang_label["description"];
echo "<th>".$lang_label["nc.group"];
//echo "<th>".$lang_label["module_group"];
echo "<th>".$lang_label["max_min"];
echo "<th width=50>".$lang_label["action"];
$color=1;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$id_tipo = $row["type"];
$id_group = $row["id_group"];
$nombre_modulo =$row["name"];
$descripcion = $row["description"];
$module_max = $row["max"];
$module_min = $row["min"];
$module_interval2 = $row["module_interval"];
$module_group2 = $row["id_module_group"];
echo "<tr><td class='".$tdcolor."_id'>";
echo "<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components_form&update=1&id_nc=".$row["id_nc"]."'>".$nombre_modulo."</a>";
echo "<td class='".$tdcolor."f9'>";
if ($id_tipo > 0) {
echo "<img src='images/".show_icon_type($id_tipo)."' border=0>";
}
if ($module_interval2!=0){
echo "<td class='$tdcolor'>".$module_interval2;
} else {
echo "<td class='$tdcolor'> N/A";
}
echo "<td class='$tdcolor'>".substr($descripcion,0,30)."</td>";
echo "<td class='$tdcolor'>".give_network_component_group_name($id_group)."</td>";
//echo "<td class='$tdcolor'>".
//substr(dame_nombre_grupomodulo($module_group2),0,15)."</td>";
echo "<td class='$tdcolor'>";
if ($module_max == $module_min) {
$module_max = "N/A";
$module_min = "N/A";
}
echo $module_max." / ".$module_min;
echo "<td class='$tdcolor' align='center'>";
echo "<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&delete=1&id_nc=".$row["id_nc"]."'>";
echo "<img src='images/cancel.gif' border=0 alt='".$lang_label["delete"]."'></A>";
}
echo "<tr><td colspan='7'><div class='raya'></div></td></tr>";
echo "<tr><td colspan='7' align='right'>";
echo "<form method=post action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components_form&create=1'>";
echo "<input type='submit' class='sub' name='crt' value='".$lang_label["create"]."'>";
echo "</form></td></tr></table>";
} else
echo "<div class='nf'>No modules</div>";
?>

View File

@ -0,0 +1,280 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// 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.
?>
<script language="JavaScript" type="text/javascript">
<!--
function type_change()
{
// type 1-4 - Generic_xxxxxx
if ((document.modulo.tipo.value > 0) && (document.modulo.tipo.value < 5)){
document.modulo.snmp_oid.style.background="#ddd";
document.modulo.snmp_oid.disabled=true;
document.modulo.snmp_community.style.background="#ddd";
document.modulo.snmp_community.disabled=true;
document.modulo.tcp_send.style.background="#ddd";
document.modulo.tcp_send.disabled=true;
document.modulo.tcp_rcv.style.background="#ddd";
document.modulo.tcp_rcv.disabled=true;
document.modulo.tcp_port.style.background="#ddd";
document.modulo.tcp_port.disabled=true;
document.modulo.ip_target.style.background="#ddd";
document.modulo.ip_target.disabled=true;
document.modulo.modulo_max.style.background="#fff";
document.modulo.modulo_max.disabled=false;
document.modulo.modulo_min.style.background="#fff";
document.modulo.modulo_min.disabled=false;
}
// type 15-18- SNMP
if ((document.modulo.tipo.value > 14) && (document.modulo.tipo.value < 19 )){
document.modulo.snmp_oid.style.background="#fff";
document.modulo.snmp_oid.style.disabled=false;
document.modulo.snmp_community.style.background="#fff";
document.modulo.snmp_community.disabled=false;
document.modulo.combo_snmp_oid.style.background="#fff";
document.modulo.combo_snmp_oid.disabled=false;
document.modulo.oid.disabled=false;
document.modulo.tcp_send.style.background="#ddd";
document.modulo.tcp_send.disabled=true;
document.modulo.tcp_rcv.style.background="#ddd";
document.modulo.tcp_rcv.disabled=true;
document.modulo.tcp_port.style.background="#ddd";
document.modulo.tcp_port.disabled=true;
document.modulo.ip_target.style.background="#fff";
document.modulo.ip_target.disabled=false;
if (document.modulo.tipo.value == 18) {
document.modulo.modulo_max.style.background="#ddd";
document.modulo.modulo_max.disabled=true;
document.modulo.modulo_min.style.background="#ddd";
document.modulo.modulo_min.disabled=true;
} else {
document.modulo.modulo_max.style.background="#fff";
document.modulo.modulo_max.disabled=false;
document.modulo.modulo_min.style.background="#fff";
document.modulo.modulo_min.disabled=false;
}
}
// type 6-7 - ICMP
if ((document.modulo.tipo.value == 6) || (document.modulo.tipo.value == 7)){
document.modulo.snmp_oid.style.background="#ddd";
document.modulo.snmp_oid.disabled=true;
document.modulo.snmp_community.style.background="#ddd";
document.modulo.snmp_community.disabled=true;
document.modulo.combo_snmp_oid.style.background="#ddd";
document.modulo.combo_snmp_oid.disabled=true;
document.modulo.oid.disabled=true;
document.modulo.tcp_send.style.background="#ddd";
document.modulo.tcp_send.disabled=true;
document.modulo.tcp_rcv.style.background="#ddd";
document.modulo.tcp_rcv.disabled=true;
document.modulo.tcp_port.style.background="#ddd";
document.modulo.tcp_port.disabled=true;
document.modulo.ip_target.style.background="#fff";
document.modulo.ip_target.disabled=false;
document.modulo.modulo_max.style.background="#fff";
document.modulo.modulo_max.disabled=false;
document.modulo.modulo_min.style.background="#fff";
document.modulo.modulo_min.disabled=false;
}
// type 8-11 - TCP
if ((document.modulo.tipo.value > 7) && (document.modulo.tipo.value < 12)){
document.modulo.snmp_oid.style.background="#ddd";
document.modulo.snmp_oid.disabled=true;
document.modulo.snmp_community.style.background="#ddd";
document.modulo.snmp_community.disabled=true;
document.modulo.tcp_send.style.background="#fff";
document.modulo.tcp_send.disabled=false;
document.modulo.tcp_rcv.style.background="#fff";
document.modulo.tcp_rcv.disabled=false;
document.modulo.tcp_port.style.background="#fff";
document.modulo.tcp_port.disabled=false;
document.modulo.ip_target.style.background="#fff";
document.modulo.ip_target.disabled=false;
document.modulo.modulo_max.style.background="#ddd";
document.modulo.modulo_max.disabled=true;
document.modulo.modulo_min.style.background="#ddd";
document.modulo.modulo_min.disabled=true;
}
// type 12 - UDP
if (document.modulo.tipo.value == 12){
document.modulo.snmp_oid.style.background="#ddd";
document.modulo.snmp_oid.disabled=true;
document.modulo.snmp_community.style.background="#ddd";
document.modulo.snmp_community.disabled=true;
document.modulo.tcp_send.style.background="#fff";
document.modulo.tcp_send.disabled=false;
document.modulo.tcp_rcv.style.background="#fff";
document.modulo.tcp_rcv.disabled=false;
document.modulo.tcp_port.style.background="#fff";
document.modulo.tcp_port.disabled=false;
document.modulo.ip_target.style.background="#fff";
document.modulo.ip_target.disabled=false;
document.modulo.modulo_max.style.background="#ddd";
document.modulo.modulo_max.disabled=true;
document.modulo.modulo_min.style.background="#ddd";
document.modulo.modulo_min.disabled=true;
}
}
//-->
</script>
<?PHP
// Load global vars
require("include/config.php");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
else
$id_user = "";
if (give_acl($id_user, 0, "PM")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation",
"Trying to access Agent Management");
require ("general/noaccess.php");
exit;
}
if (isset($_GET["update"])){ // Edit mode
$id_nc = entrada_limpia ($_GET["id_nc"]);
$sql1 = "SELECT * FROM tnetwork_component where id_nc = $id_nc";
$result=mysql_query($sql1);
$row=mysql_fetch_array($result);
$name = $row["name"];
$type = $row["type"];
$description = $row["description"];
$max = $row["max"];
$min = $row["min"];
$module_interval = $row["module_interval"];
$tcp_port = $row["tcp_port"];
$tcp_rcv = $row["tcp_rcv"];
$tcp_send = $row["tcp_send"];
$snmp_community = $row["snmp_community"];
$snmp_oid = $row["snmp_oid"];
$id_module_group = $row["id_module_group"];
$id_group = $row["id_group"];
} elseif (isset($_GET["create"])){
$id_nc = -1;
$name = "";
$snmp_oid = "";
$description = "";
$id_group = 1;
$oid = "";
$max = "0";
$min = "0";
$module_interval = "0";
$tcp_port = "";
$tcp_rcv = "";
$tcp_send = "";
$snmp_community = "public";
$id_module_group = "";
$id_group = "";
$type = 0;
}
echo "<h2>".$lang_label["network_component_management"]."</h2>";
echo '<table width="700" cellspacing="4" cellpadding="4">';
// Different Form url if it's a create or if it's a update form
if ($id_nc != -1)
echo "<form name='modulo' method='post' action='http://pandora.localhost/index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&update=1&id_nc=$id_nc'>";
else
echo "<form name='modulo' method='post' action='http://pandora.localhost/index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create=1'>";
echo "<tr><td class='lb' rowspan='10' width='5'>";
echo "<tr>";
echo '<tr><td class="datos2">'.$lang_label["module_name"];
echo "<td class='datos2'><input type='text' name='name' size='25' value='$name'>";
//-- Module type combobox
echo "<td class='datos2'>".$lang_label["module_type"];
echo "<td class='datos2'>";
echo '<select name="tipo" onChange="type_change()">';
$sql1="SELECT id_tipo, nombre FROM ttipo_modulo WHERE id_tipo != '$type' ORDER BY nombre";
$result=mysql_query($sql1);
echo "<option value='$type'>". dame_nombre_tipo_modulo($type);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_tipo"]."'>".$row["nombre"];
}
echo "</select>";
echo "<tr>";
echo "<td class='datos'>".$lang_label["group"];
echo "<td class='datos'>";
echo "<select name='id_group'>";
echo "<option value='$id_group'>".give_network_component_group_name($id_group);
$sql1 = "SELECT * FROM tnetwork_component_group where id_sg != '$id_group'";
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result))
echo "<option value='".$row["id_sg"]."'>".give_network_component_group_name($row["id_sg"]);
echo "</select>";
echo "<td class='datos'>".$lang_label["module_group"];
echo '<td class="datos">';
echo '<select name="id_module_group">';
if ($id_nc != -1 )
echo "<option value='".$id_module_group."'>".dame_nombre_grupomodulo($id_module_group);
$sql1='SELECT * FROM tmodule_group';
$result=mysql_query($sql1);
while ($row=mysql_fetch_array($result))
echo "<option value='".$row["id_mg"]."'>".$row["name"];
echo "</select>";
echo "<tr>";
echo '<td class="datos2">'.$lang_label["module_interval"];
echo '<td class="datos2">';
echo '<input type="text" name="module_interval" size="5" value="'.$module_interval.'">';
?>
<td class="datos2"><?php echo $lang_label["tcp_port"] ?>
<td class="datos2"><input type="text" name="tcp_port" size="5" value="<?php echo $tcp_port ?>">
<tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?>
<td class="datos"><input type="text" name="snmp_oid" size="25" value="<?php echo $snmp_oid ?>">
<td class="datos"><?php echo $lang_label["snmp_community"] ?>
<td class="datos"><input type="text" name="snmp_community" size="25" value="<?php echo $snmp_community ?>">
<tr><td class="datos2t"><?php echo $lang_label["tcp_send"] ?>
<td class="datos2"><textarea name="tcp_send" cols="20" rows="2"><?php echo $tcp_send ?></textarea>
<td class="datos2t"><?php echo $lang_label["tcp_rcv"] ?>
<td class="datos2"><textarea name="tcp_rcv" cols="20" rows="2"><?php echo $tcp_rcv ?></textarea>
<tr><td class="datos"><?php echo $lang_label["mindata"] ?>
<td class="datos"><input type="text" name="modulo_min" size="5" value="<?php echo $modulo_min ?>">
<td class="datos"><?php echo $lang_label["maxdata"] ?>
<td class="datos"><input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>">
<?PHP
echo '<tr><td class="datos2t">'.$lang_label["comments"];
echo '<td class="datos2" colspan=3>';
echo '<textarea name="descripcion" cols=70 rows=2>';
echo $description;
echo "</textarea>";
echo "<tr><td colspan='5'><div class='raya'></div></td></tr>";
echo "<tr>";
echo "<td colspan=5 align='right'>";
if ($id_nc != "-1")
echo '<input name="updbutton" type="submit" class="sub" value="'.$lang_label["update"].'">';
else
echo '<input name="crtbutton" type="submit" class="sub" value="'.$lang_label["add"].'">';
echo "</form>";
echo "</table>";
?>

View File

@ -0,0 +1,23 @@
<?PHP
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// 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");
?>

View File

@ -0,0 +1,112 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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");
if (comprueba_login() == 0)
$id_user = $_SESSION["id_usuario"];
if (give_acl($id_user, 0, "PM")==1) {
if (isset($_POST["update_module"])){ // if modified any parameter
$name = entrada_limpia($_POST["name"]);
$id_type = entrada_limpia($_POST["id_type"]);
$description = entrada_limpia($_POST["description"]);
$icon = entrada_limpia($_POST["icon"]);
$category = entrada_limpia($_POST["category"]);
$sql_update ="UPDATE ttipo_modulo
SET descripcion = '".$description."', categoria = '".$category."',
nombre = '".$name."', icon = '".$icon."'
WHERE id_tipo = '".$id_type."'";
$result=mysql_query($sql_update);
if (! $result)
echo "<h3 class='error'>".$lang_label["modify_module_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["modify_module_ok"]."</h3>";
}
/*if (isset($_GET["borrar_grupo"])){ // if delete
$id_borrar_modulo = entrada_limpia($_GET["id_grupo"]);
// First delete from tagente_modulo
$sql_delete= "DELETE FROM tgrupo WHERE id_grupo = ".$id_borrar_modulo;
$result=mysql_query($sql_delete);
if (! $result)
echo "<h3 class='error'>".$lang_label["delete_group_no"]."</h3>";
else
echo "<h3 class='suc'>".$lang_label["delete_group_ok"]."</h3>";
}*/
echo "<h2>".$lang_label["module_management"]."</h2>";
echo "<h3>".$lang_label["defined_modules"]."</h3>";
echo "<table cellpadding=4 cellspacing=4 width=750>";
echo "<th>".$lang_label["icon"]."</th>";
echo "<th>".$lang_label["name"]."</th>";
echo "<th>".$lang_label["type"]."</th>";
echo "<th>".$lang_label["descripcion"]."</th>";
$sql1='SELECT * FROM ttipo_modulo ORDER BY nombre';
$result=mysql_query($sql1);
$color=0;
while ($row=mysql_fetch_array($result)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
if ($row["id_grupo"] != 1){
echo "
<tr>
<td class='$tdcolor' align='center'>
<img src='images/".$row["icon"]."'
border='0'>
</td>
<td class='$tdcolor'>
<b><a href='index.php?sec=gmodules&
sec2=godmode/modules/manage_modules&
id_module=".$row["id_tipo"]."'>".$row["nombre"]."</a>
</b></td>
<td class='$tdcolor'>
".give_modulecategory_name ($row["categoria"])."
</td>
<td class='$tdcolor'>
".$row["descripcion"]."
</td>
</tr>";
}
}
echo "<tr><td colspan='4'><div class='raya'></div></td></tr>";
echo "<tr><td colspan='4' align='right'>";
echo "<form method=post action='index.php?sec=gmodules&
sec2=godmode/modules/manage_modules&create=1'>";
echo "<input type='submit' class='sub' name='crt' value='".$lang_label["create_module"]."'>";
echo "</form></td></tr></table>";
} // Fin pagina
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access module management");
require ("general/noaccess.php");
}
?>

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -16,7 +22,6 @@
// 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");
@ -66,7 +71,7 @@ if (comprueba_login() == 0) {
echo "<tr><td class='lb' rowspan='3' width='5'>";
echo "<td class='datos'>".$lang_label["name"]."</td><td class='datos'><input type='text' name='name' value='".$name."' class='w200'>";
echo "<tr><td class='datos2'>".$lang_label['ip_address']."</td><td class='datos2'><input type='text' name='address' value='".$address."' class='w200'>";
echo "<tr><td class='datos'>".$lang_label['description']."<td class='datos'><input type='text' name='description' value='".$description."' class='w200'><input type='hidden' name='server' value='".entrada_limpia($_GET["server"])."></input>";
echo "<tr><td class='datos'>".$lang_label['description']."<td class='datos'><input type='text' name='description' value='".$description."'><input type='hidden' name='server' value='".entrada_limpia($_GET["server"])."'></input>";
}
else {
echo "<div class='nf'>".$lang_label["no_server"]."</div>";

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -29,18 +35,19 @@ if (comprueba_login() == 0)
$days_purge=$_POST["days_purge"];
$config_graph_res=$_POST["graph_res"];
$config_step_compact=$_POST["step_compact"];
$config_graph_order=$_POST["graph_order"];
$config_truetype=$_POST["truetype"];
$config_bgimage=$_POST["bgimage"];
$config_show_unknown=$_POST["show_unknown"];
$config_show_lastalerts=$_POST["show_lastalerts"];
$result2=mysql_query("UPDATE tconfig SET VALUE='".$block_size."' WHERE TOKEN='block_size'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$language_code."' WHERE TOKEN='language_code'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$days_purge."' WHERE TOKEN='days_purge'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$days_compact." ' WHERE TOKEN='days_compact'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_graph_res."' WHERE TOKEN='graph_res'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_step_compact."' WHERE TOKEN='step_compact'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_truetype."' WHERE TOKEN='truetype'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_graph_order."' WHERE TOKEN='graph_order'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_bgimage."' WHERE token='bgimage'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_unknown."' WHERE token='show_unknown'");
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_lastalerts."' WHERE token='show_lastalerts'");
}
echo "<h2>".$lang_label["setup_screen"]."</h2>";
echo "<h3>".$lang_label["general_config"]."<a href='help/".$help_code."/chap9.php#9' target='_help' class='help'>&nbsp;<span>".$lang_label["help"]."</span></a></h3>";
@ -57,7 +64,6 @@ if (comprueba_login() == 0)
if ($row2=mysql_fetch_array($result2)){
echo '<option value="'.$row2["id_language"].'">'.$row2["name"];
}
while ($row=mysql_fetch_array($result)){
echo "<option value=".$row["id_language"].">".$row["name"];
}
@ -78,20 +84,21 @@ if (comprueba_login() == 0)
echo '<tr><td class="datos2">'.$lang_label["step_compact"];
echo '<td class="datos2"><input type="text" name="step_compact" size=5 value="'.$config_step_compact.'">';
echo '<tr><td class="datos">'.$lang_label["graph_order"];
echo '<td class="datos"><select name="graph_order" class="w120">';
if ($config_graph_order==0) {
echo '<option value="0">'.$lang_label["left_right"].'</option>';
echo '<option value="1">'.$lang_label["right_left"].'</option>';
echo '<tr><td class="datos">'.$lang_label["show_unknown"];
echo '<td class="datos"><select name="show_unknown" class="w120">';
if ($config_show_unknown==1) {
echo '<option value="1">'.$lang_label["active"].'</option>';
echo '<option value="0">'.$lang_label["disabled"].'</option>';
}
else {
echo '<option value="1">'.$lang_label["right_left"].'</option>';
echo '<option value="0">'.$lang_label["left_right"].'</option>';
echo '<option value="0">'.$lang_label["disabled"].'</option>';
echo '<option value="1">'.$lang_label["active"].'</option>';
}
echo '<tr><td class="datos2">'.$lang_label["truetype"];
echo '<td class="datos2"><select name="truetype" class="w120">';
if ($config_truetype==1) {
echo '<tr><td class="datos2">'.$lang_label["show_lastalerts"];
echo '<td class="datos2"><select name="show_lastalerts" class="w120">';
if ($config_show_lastalerts==1) {
echo '<option value="1">'.$lang_label["active"].'</option>';
echo '<option value="0">'.$lang_label["disabled"].'</option>';
}

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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.
// This is the base config file
//Pandora Version
@ -60,33 +63,43 @@ if (! mysql_connect($dbhost,$dbuser,$dbpassword)){
</div>
</div></body></html>');
}
// Default values for config
$language_code = "en";
$block_size = 25;
$days_purge = 30;
$days_compact = 7;
$config_graph_res = 3;
$config_step_compact = 1;
$config_bgimage = "background4.jpg";
$config_show_unknown = 0;
$config_show_lastalerts = 0;
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;
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 "show_unknown": $config_show_unknown = $row2["value"];
break;
case "show_lastalerts": $config_show_lastalerts = $row2["value"];
break;
}
}
if ($language_code == 'ast_es') {
$help_code='ast';
}
else $help_code = substr($language_code,0,2);
// Adjist helpcode from language_code
if ($language_code == 'ast_es')
$help_code = 'ast';
else
$help_code = substr($language_code,0,2);
?>

View File

@ -2,15 +2,19 @@
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -18,8 +22,6 @@
// 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.
// Functions
// ---------------------------------------------------------------
// input: var, string.
// mesg, mesage to show, var content.
@ -363,4 +365,15 @@ function pagination ($count, $url, $offset ) {
}
}
// Render data in a fashion way :-)
function format_numeric ( $number, $decimals=2, $dec_point=".", $thousands_sep=",") {
if ($number == 0)
return 0;
// If has decimals
if (fmod($number , 1)> 0)
return number_format ($number, 2, $dec_point, $thousands_sep);
else
return number_format ($number, 0, $dec_point, $thousands_sep);
}
?>

View File

@ -1,11 +1,27 @@
<?php
// Pandora - The Free Monitoring System
// This code is protected by GPL license.
// Este codigo esta protegido por la licencia GPL.
// Sancho Lerena <slerena@gmail.com>, 2003-2006
// Raul Mateos <raulofpandora@gmail.com>, 2005-2006
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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.
// Database functions
// ---------------------------------------------------------------
@ -399,7 +415,7 @@ function give_server_name($id_server){
// Return name of a module type when given ID
// ---------------------------------------------------------------
function dame_nombre_tipo_modulo($id){
function dame_nombre_tipo_modulo ($id){
require("config.php");
$query1="SELECT * FROM ttipo_modulo WHERE id_tipo =".$id;
$resq1=mysql_query($query1);
@ -414,14 +430,14 @@ function dame_nombre_tipo_modulo($id){
// Return name of a group when given ID
// ---------------------------------------------------------------
function dame_nombre_grupo($id){
require("config.php");
$query1="SELECT * FROM tgrupo WHERE id_grupo =".$id;
$resq1=mysql_query($query1);
if ($rowdup=mysql_fetch_array($resq1)){
$pro=$rowdup["nombre"];
}
else $pro = "";
function dame_nombre_grupo ($id){
require ("config.php");
$query1 = "SELECT * FROM tgrupo WHERE id_grupo = ".$id;
$resq1 = mysql_query($query1);
if ($rowdup = mysql_fetch_array ($resq1))
$pro = $rowdup["nombre"];
else
$pro = "";
return $pro;
}
@ -559,6 +575,7 @@ function dame_so_icon($id){
return $pro;
}
// ---------------------------------------------------------------
// Return email of a user given ID
// ---------------------------------------------------------------
@ -847,5 +864,38 @@ function group_belong_group($id_group_a, $id_groupset){
return 0;
}
// ---------------------------------------------------------------
// Return category name
// ---------------------------------------------------------------
function give_modulecategory_name ($value) {
require("config.php");
require ("include/languages/language_".$language_code.".php");
switch ($value) {
case 0: return $lang_label["cat_0"];
break;
case 1: return $lang_label["cat_1"];
break;
case 2: return $lang_label["cat_2"];
break;
case 3: return $lang_label["cat_3"];
break;
}
return $lang_label["unknown"];
}
// ---------------------------------------------------------------
// Return network component group name given its ID
// ---------------------------------------------------------------
function give_network_component_group_name ($id){
require("config.php");
$query1="SELECT * FROM tnetwork_component_group WHERE id_sg= ".$id;
$resq1=mysql_query($query1);
if ($rowdup=mysql_fetch_array($resq1))
$pro=$rowdup["name"];
else
$pro = "";
return $pro;
}
?>

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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["view_agents"]="View Agents";
$lang_label["manage_incidents"]="Manage Incidents";
$lang_label["view_users"]= "View Users";
@ -138,7 +141,7 @@ $lang_label["assigned_modules"]="Assigned modules";
$lang_label["learning_mode"]="Learning mode";
$lang_label["assigned_alerts"]="Assigned alerts";
$lang_label["alert_asociation_form"]="Alert association form";
$lang_label["module_asociation_form"]="Module association form";
$lang_label["module_asociation_form"]="Module assignment";
$lang_label["name_type"]="Name / Type";
$lang_label["min_max"]="Min/Max";
$lang_label["detailed_monitoragent_state"]="Monitor detail";
@ -395,7 +398,7 @@ $lang_label["copy_conf"]="Copy Configuration";
$lang_label["fromagent"]="From Agent";
$lang_label["toagent"]="To Agent(s):";
$lang_label["step_compact"]="Compact interpolation (Hours: 1 Fine, 10 medium, 20 bad)";
$lang_label["step_compact"]="Compact interpolation in hours (1 Fine-20 bad)";
$lang_label["setup_links"]="Links";
$lang_label["create_link_no"]="There was a problem creating link";
@ -655,19 +658,55 @@ $lang_label["no_monitors_g"]="This group doesn't have any monitor";
// New strings for 1.3 version
// 15 dev, new for 1.3 dev
$lang_label["reporting"]="Reporting";
$lang_label["agent_general_reporting"]="Agent overview";
// 5 Jan 2007
$lang_label["active_console"]="Active console";
$lang_label["validate_event_failed"]="Event validation failed";
// 21 feb 2007
$lang_label["load"]="Load";
$lang_label["information"]="General information";
$lang_label["parent"]="Parent";
$lang_label["show_unknown"]="Show unknown modules in global view";
$lang_label["show_lastalerts"]="Show last fired alerts in global view";
$lang_label["manage_modules"]="Manage modules";
$lang_label["modify_module_ok"]="Module updated successfully";
$lang_label["modify_module_no"]="Problem modifying module";
$lang_label["module_management"]="Module management";
$lang_label["defined_modules"]="Defined modules";
$lang_label["cat_0"] = "Software agent data";
$lang_label["cat_1"] = "Software agent monitor";
$lang_label["cat_2"] = "Network agent data";
$lang_label["cat_3"] = "Network agent monitor";
$lang_label["unknown"] = "Unknown";
$lang_label["create_module"]="Create module";
$lang_label["network_templates"]="Network templates";
$lang_label["snmp_modules"]="SNMP modules";
$lang_label["network_components_groups"]="Network components groups";
$lang_label["network_components"]="Network components";
$lang_label["create_ok"]="Created successfully";
$lang_label["create_no"]="Not created. Error inserting data";
$lang_label["modify_ok"]="Updated successfully";
$lang_label["modify_no"]="Not updated. Error updating data";
$lang_label["delete_no"]="Not deleted. Error deleting data";
$lang_label["delete_ok"]="Deleted successfully";
$lang_label["network_component_group_management"]="Network Component group management";
$lang_label["network_component_management"]="Network component management";
$lang_label["oid"]="OID";
$lang_label['recon_server']="Recon Server";
$lang_label['snmp_console']="SNMP Console";
$lang_label['network_server']="Network Server";
$lang_label['data_server']="Data Server";
$lang_label["md5_checksum"]="MD5 Check";
$lang_label["nc_groups"]="Component groups";
$lang_label["nc.group"]="NC.Group";
$lang_label["manual_config"]="Manual setup";
$lang_label["network_component"]="Network Component";
$lang_label["not_available_in_edit_mode"]="Not available in edition mode";
$lang_label["using_network_component"]="Using Network Component";
$lang_label["view_mode"]="View mode";
$lang_label["setup_mode"]="Setup mode";
$lang_label["refresh_data"]="Refresh data";
$lang_label["lag"]="LAG";
$lang_label["N/A"]="N/A";
global $lang_label;
global $help_label;
?>

View File

@ -1,14 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -16,7 +22,6 @@
// 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["view_agents"]="Ver agentes";
$lang_label["manage_incidents"]="Gesti&oacute;n de incidentes";
$lang_label["view_users"]="Ver usuarios";
@ -621,7 +626,7 @@ $lang_label["no_event"]="No hay eventos";
$lang_label["agent_access_rate"]="Accesibilidad agente (24h)";
$lang_label["agent_module_shareout"]="Distribuci&oacute;n de m&oacute;dulos";
$lang_label["int"]="Itv."; // Nombre corto para intervalo
$lang_label["manage_servers"]="Gesti&oacute;n de servidores";
$lang_label["manage_servers"]="Gesti&oacute;n servidores";
$lang_label["update_server"]="Actualizar servidor";
$lang_label["upd_server_ok"]="Servidor actualizado correctamente";
$lang_label["upd_server_no"]="Ha habido un problema al actualizar el servidor";
@ -652,6 +657,7 @@ $lang_label["reporting"]="Informes";
$lang_label["agent_general_reporting"]="Agent overview";
$lang_label["active_console"]="Consola activa";
$lang_label["parent"]="Padre";
global $lang_label;
global $help_label;

View File

@ -16,12 +16,12 @@ div#menug {
margin-bottom: 15px;
}
#god1 li, #god2 li, #god3 li, #god4 li, #god5 li, #god6 li, #god7 li, #god8 li, #god1s li,
#god2s li, #god3s li, #god4s li, #god5s li, #god6s li, #god7s li, #god8s li {
#god2s li, #god3s li, #god4s li, #god5s li, #god6s li, #god7s li, #god8s li, #god_module li, #god_module_sel li {
padding: 0px 0px 0px 30px;
}
div#god1>ul, div#god2>ul, div#god3>ul, div#god4>ul, div#god5>ul, div#god6>ul,
div#god7>ul, div#god8>ul, div#god1s>ul, div#god2s>ul, div#god3s>ul, div#god4s>ul,
div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul {
div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul, div#god_module>ul, div#god_module_sel>ul {
width: 124px;
}
#god1 li, #god1 li:hover, #god1s li {
@ -48,6 +48,9 @@ div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul {
#god8 li, #god8 li:hover, #god8s li {
background: url(../../images/god8.gif) no-repeat 5px 3px;
}
#god_module li, #god_module li:hover, #god_module_sel li {
background: url(../../images/brick.png) no-repeat 4px 5px;
}
div.arrowg>ul, div.arrowgs>ul {
width: 74%;
}
@ -59,7 +62,7 @@ div.arrowg>ul, div.arrowgs>ul {
#god a:hover,
#god1 li:hover, #god1s li, #god2 li:hover, #god2s li, #god3 li:hover, #god3s li,
#god4 li:hover, #god4s li, #god5 li:hover, #god5s li, #god6 li:hover, #god6s li,
#god7 li:hover, #god7s li, #god8 li:hover, #god8s li,
#god7 li:hover, #god7s li, #god8 li:hover, #god8s li, #god_module li:hover, #god_module_sel li,
.arrowg li:hover, .arrowgs li
{
background-color: #efefbd;

View File

@ -1,15 +1,19 @@
/*
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -361,9 +365,12 @@ td.datosf9i, td.datos2f9i {
.w155, .w155f10 {
width: 155px;
}
.top, .bgt, .f9l30t, td.datost, td.datos2t {
.top, .top_red, .bgt, .f9l30t, td.datost, td.datos2t {
vertical-align: top;
}
.top_red {
background: #ff0000;
}
.bot, .titb, td.datosb {
vertical-align: bottom;
}
@ -484,7 +491,7 @@ div.data_box {
background: #0FB800;
padding: 2px 10px 2px 10px;
color: #fff;
border: 1px solid #0F5800;
border: 1px solid #0D9D00;
font-weight: bold;
line-height: 18px;
}
@ -509,6 +516,36 @@ div.data_box {
background: #db6351;
border-top: none;
}
/* TAB TITLE */
#menu_tab_left .mn, #menu_tab_left ul, #menu_tab_left .mn ul
{
padding: 0px 0px 0px 0px;
list-style: none;
margin: 0px 0px 0px -20px;
}
#menu_tab_left .mn li
{
float: left;
position: relative;
}
#menu_tab_left li a, #menu_tab_left li.nomn a
{
background: #D84437;
padding: 2px 10px 2px 10px;
color: #fff;
border: 1px solid #C43E32;
font-weight: bold;
line-height: 18px;
}
#menu_tab_left .mn li a
{
display: block;
text-decoration: none;
}
span.users {
background: url(../../images/group.png) no-repeat;
}

View File

@ -2,15 +2,19 @@
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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");
@ -64,8 +67,7 @@ if (comprueba_login() == 0) {
<td class="datos"><b>'.$lang_label["agent_name"].'</b></td>
<td class="datos"><b>'.strtoupper(salida_limpia($nombre_agente));
echo "<td class='datos2' width='40'><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'>
<img src='images/refresh.gif' class='top' border=0></a>&nbsp;&nbsp;";
echo "<td class='datos2' width='40'><a class='info' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'><span>".$lang_label["refresh_data"]."</span>"."<img src='images/refresh.gif' class='top' border=0></a>&nbsp;&nbsp;";
// Data base access graph
echo '</td>';

View File

@ -2,15 +2,19 @@
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -18,7 +22,6 @@
// 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");
@ -54,7 +57,7 @@
$contador_grupo = 0;
$contador_agente = 0;
$array_index = 0;
// Prepare data to show
// For each valid group for this user, take data from agent and modules
foreach ($mis_grupos as $migrupo) {
if ($migrupo != "") {
@ -78,53 +81,65 @@
$id_agente = $row1["id_agente"];
// Check for recent alerts
if ($config_show_lastalerts == 1)
if (check_alert_fired($id_agente) == 1) {
$grupo[$array_index]["alerts"]++;
}
$grupo[$array_index]["agent"]++;
$grupo[$array_index]["group"] = dame_nombre_grupo ($migrupo);
// Estado grupo, agent
$contador_agente++;
$sql3 = "SELECT estado, timestamp, id_agente_modulo,
$sql3 = "SELECT estado, utimestamp, id_agente_modulo,
datos FROM tagente_estado
WHERE id_agente = ".$row1["id_agente"];
$result3 = mysql_query ($sql3);
while ($row3 = mysql_fetch_array ($result3)) {
$estado = $row3["estado"];
// Get module interval
$estado = $row3["estado"];
$ahora = date ("Y/m/d H:i:s");
$sql4 = "SELECT module_interval
FROM tagente_modulo
WHERE id_agente_modulo = ".$row3["id_agente_modulo"];
$result4 = mysql_query ($sql4);
if ($row4 = mysql_fetch_array ($result4)) {
$module_interval = $row4["module_interval"];
if ($module_interval > 0) {
$intervalo_comp = $module_interval;
} else {
$intervalo_comp = $intervalo;
}
}
$ultimo_contacto_modulo = $row3["timestamp"];
// Defines if module is down (interval x 2 > time last contact)
if ($ultimo_contacto_modulo != "0000-00-00 00:00:00") {
$seconds = strtotime ($ahora) -
strtotime ($ultimo_contacto_modulo);
if ($seconds >= ($intervalo_comp * 2)) {
$grupo[$array_index]["down"]++;
} elseif ($estado != 100) {
if ($row3["datos"] != 0) {
$grupo[$array_index]["ok"]++;
if ($config_show_unknown != 0){
// Get module interval
$sql4 = "SELECT module_interval
FROM tagente_modulo
WHERE id_agente_modulo = ".$row3["id_agente_modulo"];
$result4 = mysql_query ($sql4);
if ($row4 = mysql_fetch_array ($result4)) {
$module_interval = $row4["module_interval"];
if ($module_interval > 0) {
$intervalo_comp = $module_interval;
} else {
$grupo[$array_index]["bad"]++;
$intervalo_comp = $intervalo;
}
} elseif ($estado == 100) // For data module, not monitors
$grupo[$array_index]["data"]++; // Data module
}
}
$ultimo_contacto_modulo = $row3["utimestamp"];
// Defines if module is down (interval x 2 > time last contact)
if ($ultimo_contacto_modulo != 0) {
$seconds = strtotime ($ahora) -
$ultimo_contacto_modulo;
if ($seconds >= ($intervalo_comp * 2)) {
$grupo[$array_index]["down"]++;
} elseif ($estado != 100) {
if ($row3["datos"] != 0) {
$grupo[$array_index]["ok"]++;
} else {
$grupo[$array_index]["bad"]++;
}
} elseif ($estado == 100) // For data module, not monitors
$grupo[$array_index]["data"]++; // Data module
}
// do not use module interval neither down check
} elseif ($estado != 100) {
if ($row3["datos"] != 0) {
$grupo[$array_index]["ok"]++;
} else {
$grupo[$array_index]["bad"]++;
}
} elseif ($estado == 100) // For data module, not monitors
$grupo[$array_index]["data"]++; // Data module
}
}
}
if ($existen_agentes == 1){
@ -134,16 +149,14 @@
}
// Draw data
if ($contador_agente != 0) {
$ancho = ceil(sqrt($array_index+1));
$real_count =0;
echo "<table cellpadding=10 cellspacing=10>";
echo "<table cellpadding=10 cellspacing=10 border=0>";
for ($table=0; $table < $ancho; $table++) {
echo "<tr class='bot'>";
for ($table_row=0; $table_row < $ancho; $table_row++) {
if ($real_count < $array_index) {
$group_name = $grupo[$real_count]["group"];
$icono_grupo = $grupo[$real_count]["icon"];
$icono_type = "";
@ -170,60 +183,76 @@
<img src='images/dot_yellow.gif' alt=''>";
}
// TOOLTIP.
$celda = "<td class='top' width='100'>
<a href='index.php?sec=estado&amp;
$celda = "<td class='top' width='100'>";
// Yellow border if agents down / unknown
if ($grupo[$real_count]["down"] > 0)
$celda = "<td class='top' style='border: 3px solid #FFDD00;' width='100'>";
// Red border if agents bad
if ($grupo[$real_count]["bad"] > 0)
$celda = "<td class='top' style='border: 3px solid #ff0000;' width='100'>";
if (($grupo[$real_count]["bad"] > 0) && ($grupo[$real_count]["down"] > 0))
$celda = "<td class='top' style='border: 3px solid #F700FF;' width='100'>";
$celda .= "<a href='index.php?sec=estado&amp;
sec2=operation/agentes/estado_agente&amp;
refr=60&amp;
group_id=".$grupo[$real_count]["id_grupo"]."'
class='info'>
<img class='top'
src='images/groups_small/".$icono_grupo.".png' height='32' width='32' alt=''>
<span>
<table cellspacing='2' cellpadding='0'
style='margin-left:20px'>
<tr><td colspan='2' width='91' class='lb'>".
$lang_label["agents"].": </td></tr>
<tr><td colspan='2' class='datos' align='center'><b>".
$grupo[$real_count]["agent"]."</b></td></tr>
</table>
<table cellspacing='2' cellpadding='0'
style='margin-left:20px'>
<tr>
<td colspan='2' width='90' class='lb'>".
ucfirst($lang_label["monitors"]).":</td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_green.gif' align='top' alt='' >
".$lang_label["ok"].": </td>
<td class='datos'>
<font class='greenb'>".$grupo[$real_count]["ok"]."</font>
</td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_down.gif' align='top' alt=''>
".$lang_label["down"].": </td>
<td class='datos'><font class='#a9aa9a'>".
$grupo[$real_count]["down"]."</font></td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_red.gif' align='top' alt=''>
".$lang_label["fail"].": </td>
<td class='datos'><font class='redb'>".
$grupo[$real_count]["bad"]."</font></td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_yellow.gif' align='top' alt=''>
".$lang_label["alerts"].": </td>
<td class='datos'><font class='grey'>".
$grupo[$real_count]["alerts"]."</font></td>
</tr>
</table>
</span></a>";
class='info'>";
// Add group icon
$celda .= "<img class='top'
src='images/groups_small/".$icono_grupo.".png' height='32' width='32' alt=''>";
// Add float info table
$celda .= "
<span>
<table cellspacing='2' cellpadding='0'
style='margin-left:20px;'>
<tr><td colspan='2' width='91' class='lb'>".
$lang_label["agents"].": </td></tr>
<tr><td colspan='2' class='datos' align='center'><b>".
$grupo[$real_count]["agent"]."</b></td></tr>
</table>
<table cellspacing='2' cellpadding='0'
style='margin-left:20px'>
<tr>
<td colspan='2' width='90' class='lb'>".
ucfirst($lang_label["monitors"]).":</td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_green.gif' align='top' alt='' >
".$lang_label["ok"].": </td>
<td class='datos'>
<font class='greenb'>".$grupo[$real_count]["ok"]."</font>
</td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_down.gif' align='top' alt=''>
".$lang_label["down"].": </td>
<td class='datos'><font class='#a9aa9a'>".
$grupo[$real_count]["down"]."</font></td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_red.gif' align='top' alt=''>
".$lang_label["fail"].": </td>
<td class='datos'><font class='redb'>".
$grupo[$real_count]["bad"]."</font></td>
</tr>
<tr>
<td class='datos'>
<img src='images/b_yellow.gif' align='top' alt=''>
".$lang_label["alerts"].": </td>
<td class='datos'><font class='grey'>".
$grupo[$real_count]["alerts"]."</font></td>
</tr>
</table>
</span></a>";
// Render network exec module button, only when this group is writtable by user
if (give_acl ($id_user, $grupo[$real_count]["id_grupo"], "AW") == 1) {
$celda .= "&nbsp;<a href='index.php?

View File

@ -19,17 +19,15 @@
// Load globar vars
require("include/config.php");
if (comprueba_login() == 0) {
// $id_agente can be obtained as global variable or GET param.
if (isset($_GET["id_agente"])){
$id_agente = $_GET["id_agente"];
}
echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".$help_code."/chap3.php#3323' target='_help' class='help'>&nbsp;<span>".$lang_label["help"]."</span></a></h3>";
// Get all module from agent
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' and tagente_estado.estado != 100 order by tagente_modulo.nombre';
$result_t=mysql_query($sql_t);
if (mysql_num_rows ($result_t)) {
echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".$help_code."/chap3.php#3323' target='_help' class='help'>&nbsp;<span>".$lang_label["help"]."</span></a></h3>";
echo "<table width='750' cellpadding=3 cellspacing=3>";
echo "<tr><th>".$lang_label["type"]."<th>".$lang_label["module_name"]."<th>".$lang_label["description"]."<th>".$lang_label["status"]."<th>".$lang_label["interval"]."<th>".$lang_label["last_contact"];
$color=0;

View File

@ -1,13 +1,19 @@
<?PHP
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -104,6 +110,7 @@ if (comprueba_login() == 0) {
id_agente=".$id_agente."&
id_agente_modulo=".$row3["id_agente_modulo"]."&
flag=1&
tab=data&
refr=60'>
<img src='images/target.gif' border=0></a>";
} else {
@ -111,7 +118,7 @@ if (comprueba_login() == 0) {
sec2=operation/agentes/ver_agente&
id_agente=".$id_agente."&
id_agente_modulo=".$row3["id_agente_modulo"]."&
flag=1&
tab=data&
refr=60'>
<img src='images/refresh.gif' border=0></a>";
}
@ -149,24 +156,25 @@ if (comprueba_login() == 0) {
AND ($row3["id_tipo_modulo"] != 10)
AND ($row3["id_tipo_modulo"] != 17)){
echo "<td class=".$tdcolor.">";
if (($row3["datos"] != 0) AND (is_numeric($row3["datos"]))){
$mytempdata = fmod($row3["datos"], $row3["datos"]);
if ($mytempdata == 0)
if (($row3["datos"] != 0) AND (is_numeric($row3["datos"]))) {
$mytempdata = fmod($row3["datos"], 1);
if ($mytempdata == "0")
$myvalue = intval($row3["datos"]);
else
$myvalue = $row3["datos"];
if ($myvalue > 1000000) { // Add sufix "M" for millions
$mytempdata = $myvalue / 1000000;
echo $mytempdata." M";
echo format_numeric($mytempdata)." M";
} elseif ( $myvalue > 1000){ // Add sufix "K" for thousands
$mytempdata = $myvalue / 1000;
echo $mytempdata." K";
echo format_numeric ($mytempdata)." K";
} else
echo substr($myvalue,0,12);
} elseif ($row3["datos"] == 0)
echo "0";
else
echo substr($row3["datos"],0,12);
$handle = "stat".$nombre_tipo_modulo."_".$nombre_agente;
$url = 'reporting/procesos.php?agente='.$nombre_agente;
$win_handle=dechex(crc32($nombre_agente.$row3["nombre"]));
@ -184,6 +192,7 @@ if (comprueba_login() == 0) {
$link ="winopeng('reporting/stat_win.php?period=3600&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=60','hour_".$win_handle."')";
echo '<a href="javascript:'.$link.'"><img src="images/grafica_h.gif" border=0></a>';
}
// STRING DATA
else { # Writing string data in different way :)
echo "<td class='".$tdcolor."f9' colspan='2' title='".$row3["datos"]."'>";
echo salida_limpia(substr($row3["datos"],0,42));

View File

@ -1,15 +1,19 @@
<?php
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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
// 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
@ -17,7 +21,6 @@
// 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,6 +46,16 @@ if (comprueba_login() == 0) {
}
}
if (give_acl($id_usuario,$id_grupo, "AR") == 1){
echo "<div id='menu_tab_left'>
<ul class='mn'>
<li class='nomn'>";
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='../images/bricks.png' class='top' border=0>&nbsp; ".dame_nombre_agente($id_agente)." - ".$lang_label["view_mode"]."</A>";
echo "</li>";
echo "</ul></div>";
if (isset($_GET["tab"]))
$tab = $_GET["tab"];
else
@ -55,6 +68,8 @@ if (comprueba_login() == 0) {
echo "<li class='nomn'><a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.gif' width='16' class='top' border=0> Manage</A>";
echo "</li>";
}
// Main view
echo "<li class='nomn'>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0> Main</a>";
@ -84,8 +99,7 @@ if (comprueba_login() == 0) {
echo "<br>";
case "main": require "estado_generalagente.php";
echo "<br>";
//require "estado_monitores.php";
require "estado_monitores.php";
break;
case "data": require "estado_ultimopaquete.php";

View File

@ -20,6 +20,10 @@
// Load global vars
require("include/config.php");
$modules_server = 0;
$total_modules = 0;
$total_modules_data = 0;
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)) {
@ -28,26 +32,30 @@ if (comprueba_login() == 0) {
echo "<h2>".$lang_label["view_servers"]."</h2>";
echo "<h3>".$lang_label["server_detail"]."<a href='help/".$help_code."/chap7.php#7' target='_help' class='help'>&nbsp;<span>".$lang_label["help"]."</span></a></h3>";
// Get total modules defined
// Get total modules defined (network)
$sql1='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4';
$result1=mysql_query($sql1);
$row1=mysql_fetch_array($result1);
$total_modules = $row1[0];
// Get total modules defined (data)
$sql1='SELECT COUNT(processed_by_server) FROM tagente_estado WHERE processed_by_server LIKE "%_Data" ';
$result1=mysql_query($sql1);
$row1=mysql_fetch_array($result1);
$total_modules_data = $row1[0];
// Connect DataBase
$result=mysql_query($sql);
if (mysql_num_rows($result)){
echo "<table cellpadding='3' cellspacing='3' witdh=650>";
echo "<table cellpadding='4' cellspacing='4' witdh='750'>";
echo "<tr><th class='datos'>".$lang_label["name"]."</th>";
echo "<th class='datos'>".$lang_label['status']."</th>";
echo "<th class='datos'>".$lang_label['load']."</th>";
echo "<th class='datos'>".$lang_label['ip_address']."</th>";
echo "<th class='datos'>".$lang_label['modules']."</th>";
echo "<th class='datos'>".$lang_label['lag']."</th>";
echo "<th class='datos'>".$lang_label['description']."</th>";
echo "<th class='datos'>".$lang_label['network']."</th>";
echo "<th class='datos'>".$lang_label['data']."</th>";
echo "<th class='datos'>".$lang_label['snmp']."</th>";
echo "<th class='datos'>".$lang_label['master']."</th>";
echo "<th class='datos'>".$lang_label['type']."</th>";
// echo "<th class='datos'>".$lang_label['master']."</th>";
//echo "<th class='datos'>".$lang_label['checksum']."</th>";
//echo "<th class='datos'>".$lang_label['laststart']."</th>";
echo "<th class='datos'>".$lang_label['lastupdate']."</th>";
@ -61,6 +69,7 @@ if (comprueba_login() == 0) {
$tdcolor = "datos2";
$color = 1;
}
$id_server = $row["id_server"];
$name = $row["name"];
$address = $row["ip_address"];
$status = $row["status"];
@ -69,25 +78,33 @@ if (comprueba_login() == 0) {
$network_server = $row["network_server"];
$data_server = $row["data_server"];
$snmp_server = $row["snmp_server"];
$recon_server = $row["recon_server"];
$master = $row["master"];
$checksum = $row["checksum"];
$description = $row["description"];
$modules_server = 0;
// Get total modules defined for this server
$sql1='SELECT * FROM tagente where id_server = '.$row["id_server"];
$result1=mysql_query($sql1);
while ($row1=mysql_fetch_array($result1)){
$sql2='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4 AND id_agente = '.$row1["id_agente"];
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$modules_server = $modules_server + $row2[0];
}
if (($network_server == 1) OR ($data_server == 1))
if ($network_server == 1){
// Get total modules defined for this server (network modules)
$sql1='SELECT * FROM tagente where id_server = '.$row["id_server"];
$result1=mysql_query($sql1);
while ($row1=mysql_fetch_array($result1)){
$sql2='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4 AND id_agente = '.$row1["id_agente"];
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$modules_server = $modules_server + $row2[0];
}
} else {
// Get total modules defined for this server (data modules)
$sql2 = "SELECT COUNT(processed_by_server) FROM tagente_estado WHERE processed_by_server = '$name'";
$result2=mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$modules_server = $row2[0];
}
echo "<tr><td class='$tdcolor'>";
echo "<b>$name</b> ";
echo "<b><a href='index.php?sec=estado_server&sec2=operation/servers/view_server_detail&server_id=$id_server'>$name</a></b> ";
echo "<td class='$tdcolor' align='middle'>";
if ($status ==0){
echo "<img src='images/dot_red.gif'>";
@ -95,37 +112,73 @@ if (comprueba_login() == 0) {
echo "<img src='images/dot_green.gif'>";
}
echo "<td class='$tdcolor' align='middle'>";
$percentil = $modules_server / ($total_modules / 100);
echo '<img src="reporting/fgraph.php?tipo=progress&percent='.$percentil.'&height=20&width=100">';
//echo $modules_server . " / ". $total_modules;
echo "<td class='$tdcolor' align='middle'>";
echo "$address";
if (($network_server == 1) OR ($data_server == 1)){
// Progress bar calculations
if ($network_server == 1){
if ($total_modules == 0)
$percentil = 0;
$percentil = $modules_server / ($total_modules / 100);
$total_modules_temp = $total_modules;
} else {
if ($total_modules_data == 0)
$percentil = 0;
else
$percentil = $modules_server / ($total_modules_data / 100);
$total_modules_temp = $total_modules_data;
}
// Progress bar render
echo '<img src="reporting/fgraph.php?tipo=progress&percent='.$percentil.'&height=20&width=100">';
} else
echo "-";
echo "<td class='$tdcolor'>";
if (($network_server == 1) OR ($data_server == 1))
echo $modules_server . " / ". $total_modules_temp;
else
echo "-";
echo "<td class='$tdcolor'>";
// Calculate lag: get oldest module, for this server,
// and calculate difference in seconds
// Get total modules defined for this server
if (($network_server == 1) OR ($data_server == 1)){
$sql1 = "SELECT utimestamp, current_interval FROM tagente_estado WHERE processed_by_server = '$name' ";
$result1=mysql_query($sql1);
$nowtime = time();
$maxlag=0;
while ($row1=mysql_fetch_array($result1)){
if (($row1["utimestamp"] + $row1["current_interval"]) < $nowtime)
$maxlag = $nowtime - ($row1["utimestamp"] + $row1["current_interval"]);
}
echo $maxlag." sec";
} else
echo "-";
echo "<td class='".$tdcolor."f9'>".substr($description,0,25);
echo "<td class='$tdcolor' align='middle'>";
if ($network_server == 1){
echo "<img src='images/network.gif'>";
echo " <img src='images/network.gif'>";
}
echo "<td class='$tdcolor' align='middle'>";
if ($data_server == 1){
echo "<img src='images/data.gif'>";
echo "&nbsp; <img src='images/data.gif'>";
}
echo "<td class='$tdcolor' align='middle'>";
if ($snmp_server == 1){
echo "<img src='images/snmp.gif'>";
echo "&nbsp; <img src='images/snmp.gif'>";
}
if ($recon_server == 1){
echo "&nbsp; <img src='images/chart_organisation.png'>";
}
echo "<td class='$tdcolor' align='middle'>";
if ($master == 1){
echo "<img src='images/master.gif'>";
echo "&nbsp; <img src='images/master.gif'>";
}
if ($checksum == 1){
echo "&nbsp; <img src='images/binary.gif'>";
}
//echo "<td class='$tdcolor' align='middle'>";
//if ($checksum == 1){
//echo "<img src='images/binary.gif'>";
//}
//echo "<td class='".$tdcolor."f9' align='middle'>"
//.substr($laststart,0,25)."</td>";
echo "<td class='".$tdcolor."f9' align='middle'>";
if ($status ==0)
echo "<font color='red'>";
else
echo "<font color='black'>";
echo substr($keepalive,0,25)."</td>";
}
echo '<tr><td colspan="11"><div class="raya"></div></td></tr></table>';
@ -137,5 +190,19 @@ if (comprueba_login() == 0) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view");
require ("general/noaccess.php");
}
echo "<table cellpadding=4 cellspacing=4>";
echo "<tr><td>";
echo "<img src='images/network.gif'><td>".$lang_label["network_server"];
echo "<td>";
echo "<img src='images/master.gif'><td>".$lang_label["master"];
echo "<td>";
echo "<img src='images/data.gif'><td>".$lang_label["data_server"];
echo "<td>";
echo "<img src='images/binary.gif'><td>".$lang_label["md5_checksum"];
echo "<td>";
echo "<img src='images/snmp.gif'><td>".$lang_label["snmp_console"];
echo "<td>";
echo "<img src='images/chart_organisation.png'><td>".$lang_label["recon_server"];
echo "</table>";
}
?>

View File

@ -1,131 +1,244 @@
/*
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
-- MySQL dump 10.10
--
-- Host: localhost Database: pandora
-- ------------------------------------------------------
-- Server version 5.0.24a-Debian_9-log
// 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.
Create Database if not exists
*/
create database if not exists `pandora`;
USE `pandora`;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Database: pandora
# Table: 'tagent_access'
#
--
-- Table structure for table `estado_consola`
--
DROP TABLE IF EXISTS `estado_consola`;
CREATE TABLE `estado_consola` (
`id_usuario` varchar(50) NOT NULL,
`idPerfilActivo` int(5) NOT NULL,
`idVistaActiva` int(5) NOT NULL,
`menuX` int(5) NOT NULL,
`menuY` int(5) NOT NULL,
PRIMARY KEY (`id_usuario`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `objeto_consola`
--
DROP TABLE IF EXISTS `objeto_consola`;
CREATE TABLE `objeto_consola` (
`id_objeto` int(5) NOT NULL auto_increment,
`nom_img` varchar(50) NOT NULL,
`tipo` varchar(2) NOT NULL,
`left` int(5) NOT NULL,
`top` int(5) NOT NULL,
`id_tipo` varchar(20) NOT NULL,
`idVista` int(5) NOT NULL,
PRIMARY KEY (`id_objeto`)
) ENGINE=MyISAM AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;
--
-- Table structure for table `perfil`
--
DROP TABLE IF EXISTS `perfil`;
CREATE TABLE `perfil` (
`idPerfil` int(5) NOT NULL auto_increment,
`Nombre` varchar(50) NOT NULL,
`Descripcion` varchar(250) NOT NULL,
PRIMARY KEY (`idPerfil`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Table structure for table `perfil_vista`
--
DROP TABLE IF EXISTS `perfil_vista`;
CREATE TABLE `perfil_vista` (
`idPerfil` int(5) NOT NULL,
`idVista` int(5) NOT NULL,
`activa` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`idPerfil`,`idVista`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `relacion_estado`
--
DROP TABLE IF EXISTS `relacion_estado`;
CREATE TABLE `relacion_estado` (
`id_objeto` int(5) NOT NULL,
`relacion` varchar(50) NOT NULL,
PRIMARY KEY (`id_objeto`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `relacion_objetos`
--
DROP TABLE IF EXISTS `relacion_objetos`;
CREATE TABLE `relacion_objetos` (
`idObjeto1` int(5) NOT NULL,
`idObjeto2` int(5) NOT NULL,
PRIMARY KEY (`idObjeto1`,`idObjeto2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `taddress`
--
DROP TABLE IF EXISTS `taddress`;
CREATE TABLE `taddress` (
`id_a` bigint(20) unsigned NOT NULL auto_increment,
`ip` varchar(15) NOT NULL default '',
`ip_pack` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id_a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `taddress_agent`
--
DROP TABLE IF EXISTS `taddress_agent`;
CREATE TABLE `taddress_agent` (
`id_ag` bigint(20) unsigned NOT NULL auto_increment,
`id_a` bigint(20) unsigned NOT NULL default '0',
`id_agent` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`id_ag`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tagent_access`
--
DROP TABLE IF EXISTS `tagent_access`;
CREATE TABLE `tagent_access` (
`id_ac` bigint(20) unsigned NOT NULL auto_increment,
`id_agent` int(8) unsigned NOT NULL default '0',
`id_agent` int(11) NOT NULL default '0',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`utimestamp` integer unsigned NOT NULL default '0',
`utimestamp` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id_ac`),
KEY `agent_index` (`id_agent`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente'
#
--
-- Table structure for table `tagente`
--
DROP TABLE IF EXISTS `tagente`;
CREATE TABLE `tagente` (
`id_agente` int(8) unsigned NOT NULL auto_increment,
`id_agente` mediumint(8) unsigned NOT NULL auto_increment,
`nombre` varchar(100) NOT NULL default '',
`direccion` varchar(100) default '',
`comentarios` varchar(255) default '',
`id_grupo` int(8) unsigned NOT NULL default '0',
`ultimo_contacto` datetime NOT NULL default '0000-00-00 00:00:00',
`modo` tinyint(1) unsigned NOT NULL default '0',
`intervalo` int(8) unsigned NOT NULL default '300',
`id_os` tinyint(4) unsigned default '0',
`id_grupo` int(10) unsigned NOT NULL default '0',
`ultimo_contacto` datetime NOT NULL default '2004-01-01 00:00:00',
`modo` tinyint(1) NOT NULL default '0',
`intervalo` int(11) NOT NULL default '0',
`id_os` tinyint(3) unsigned default '0',
`os_version` varchar(100) default '',
`agent_version` varchar(100) default '',
`ultimo_contacto_remoto` datetime default '0000-00-00 00:00:00',
`disabled` tinyint(2) unsigned NOT NULL default '0',
`agent_type` tinyint(2) unsigned NOT NULL default '0',
`id_server` int(4) unsigned default '0',
`disabled` tinyint(2) NOT NULL default '0',
`agent_type` int(2) unsigned NOT NULL default '0',
`id_server` int(10) unsigned default '0',
PRIMARY KEY (`id_agente`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente_datos'
#
--
-- Table structure for table `tagente_datos`
--
DROP TABLE IF EXISTS `tagente_datos`;
CREATE TABLE `tagente_datos` (
`id_agente_datos` bigint(20) unsigned NOT NULL auto_increment,
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`id_agente_datos` bigint(10) unsigned NOT NULL auto_increment,
`id_agente_modulo` mediumint(8) unsigned NOT NULL default '0',
`datos` double(18,2) default NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`id_agente` mediumint(8) unsigned NOT NULL default '0',
`utimestamp` integer unsigned NOT NULL default '0',
`utimestamp` int(10) unsigned default '0',
PRIMARY KEY (`id_agente_datos`),
KEY `data_index_1` (`id_agente_modulo`, `id_agente` ),
) TYPE=InnoDB;
KEY `data_index2` (`id_agente`,`id_agente_modulo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente_datos_inc'
#
--
-- Table structure for table `tagente_datos_inc`
--
DROP TABLE IF EXISTS `tagente_datos_inc`;
CREATE TABLE `tagente_datos_inc` (
`id_adi` bigint(20) unsigned NOT NULL auto_increment,
`id_agente_modulo` mediumint(8) unsigned NOT NULL default '0',
`datos` double(18,2) default NULL,
`id_agente_modulo` bigint(20) NOT NULL default '0',
`datos` bigint(12) default NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id_adi`),
KEY `data_inc_index_1` (`id_agente_modulo`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente_datos_string'
#
--
-- Table structure for table `tagente_datos_string`
--
DROP TABLE IF EXISTS `tagente_datos_string`;
CREATE TABLE `tagente_datos_string` (
`id_tagente_datos_string` bigint(20) unsigned NOT NULL auto_increment,
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`id_agente_modulo` int(11) NOT NULL default '0',
`datos` tinytext NOT NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`id_agente` mediumint(8) unsigned NOT NULL default '0',
`utimestamp` integer unsigned NOT NULL default '0',
`id_agente` bigint(4) unsigned NOT NULL default '0',
`utimestamp` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id_tagente_datos_string`),
KEY `data_index_1` (`id_agente_modulo`, `id_agente` ),
) TYPE=InnoDB;
KEY `data_string_index_1` (`id_agente_modulo`),
KEY `data_string_index_2` (`id_agente`),
KEY `data_string_index_3` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente_estado'
#
--
-- Table structure for table `tagente_estado`
--
DROP TABLE IF EXISTS `tagente_estado`;
CREATE TABLE `tagente_estado` (
`id_agente_estado` int(10) unsigned NOT NULL auto_increment,
`id_agente_modulo` mediumint(8) unsigned NOT NULL default '0',
`id_agente_modulo` int(20) NOT NULL default '0',
`datos` varchar(255) NOT NULL default '',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`cambio` tinyint(2) unsigned NOT NULL default '0',
`estado` tinyint(2) unsigned NOT NULL default '0',
`id_agente` mediumint(8) unsigned NOT NULL default '0',
`cambio` int(11) NOT NULL default '0',
`estado` int(11) NOT NULL default '0',
`id_agente` int(11) NOT NULL default '0',
`last_try` datetime default NULL,
`utimestamp` integer unsigned NOT NULL default '0',
`utimestamp` bigint(20) NOT NULL default '0',
`inc_lastrealvalue` double(18,2) NOT NULL default '0.00',
`current_interval` int(10) unsigned NOT NULL default '0',
`processed_by_server` varchar(100) default NULL,
PRIMARY KEY (`id_agente_estado`),
KEY `status_index_1` (`id_agente_modulo`),
KEY `status_index_2` (`id_agente_modulo`,`estado`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tagente_modulo'
#
--
-- Table structure for table `tagente_modulo`
--
DROP TABLE IF EXISTS `tagente_modulo`;
CREATE TABLE `tagente_modulo` (
`id_agente_modulo` int(10) unsigned NOT NULL auto_increment,
`id_agente` int(10) unsigned NOT NULL default '0',
`id_tipo_modulo` int(10) unsigned NOT NULL default '0',
`id_agente_modulo` bigint(100) unsigned NOT NULL auto_increment,
`id_agente` int(11) NOT NULL default '0',
`id_tipo_modulo` int(11) NOT NULL default '0',
`descripcion` varchar(100) NOT NULL default '',
`nombre` varchar(100) NOT NULL default '',
`max` int(10) default '0',
`min` int(10) default '0',
`module_interval` int(8) unsigned default '0',
`tcp_port` int(5) unsigned default '0',
`max` bigint(20) default '0',
`min` bigint(20) default '0',
`module_interval` int(4) unsigned default '0',
`tcp_port` int(4) unsigned default '0',
`tcp_send` varchar(150) default '',
`tcp_rcv` varchar(100) default '',
`snmp_community` varchar(100) default '',
@ -135,11 +248,13 @@ CREATE TABLE `tagente_modulo` (
`flag` tinyint(3) unsigned default '0',
PRIMARY KEY (`id_agente_modulo`),
KEY `tam_agente` (`id_agente`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'talert_snmp'
#
--
-- Table structure for table `talert_snmp`
--
DROP TABLE IF EXISTS `talert_snmp`;
CREATE TABLE `talert_snmp` (
`id_as` int(10) unsigned NOT NULL auto_increment,
`id_alert` int(10) unsigned NOT NULL default '0',
@ -151,244 +266,358 @@ CREATE TABLE `talert_snmp` (
`agent` varchar(100) default '',
`custom_oid` varchar(200) default '',
`oid` varchar(255) NOT NULL default '',
`time_threshold` int(10) unsigned NOT NULL default '0',
`time_threshold` int(11) NOT NULL default '0',
`times_fired` int(2) unsigned NOT NULL default '0',
`last_fired` datetime NOT NULL default '0000-00-00 00:00:00',
`max_alerts` tinyint(4) unsigned NOT NULL default '1',
`min_alerts` tinyint(4) unsigned NOT NULL default '1',
`last_fired` datetime NOT NULL default '2005-01-01 00:00:00',
`max_alerts` int(11) NOT NULL default '1',
`min_alerts` int(11) NOT NULL default '1',
`internal_counter` int(2) unsigned NOT NULL default '0',
PRIMARY KEY (`id_as`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'talerta'
#
--
-- Table structure for table `talerta`
--
DROP TABLE IF EXISTS `talerta`;
CREATE TABLE `talerta` (
`id_alerta` int(10) unsigned NOT NULL auto_increment,
`nombre` varchar(100) NOT NULL default '',
`comando` varchar(100) default '',
`descripcion` varchar(255) default '',
PRIMARY KEY (`id_alerta`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'talerta_agente_modulo'
#
--
-- Table structure for table `talerta_agente_modulo`
--
DROP TABLE IF EXISTS `talerta_agente_modulo`;
CREATE TABLE `talerta_agente_modulo` (
`id_aam` int(10) unsigned NOT NULL auto_increment,
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`id_alerta` int(10) unsigned NOT NULL default '0',
`id_aam` int(11) unsigned NOT NULL auto_increment,
`id_agente_modulo` int(11) NOT NULL default '0',
`id_alerta` int(11) NOT NULL default '0',
`al_campo1` varchar(255) default '',
`al_campo2` varchar(255) default '',
`al_campo3` mediumtext,
`descripcion` varchar(255) default '',
`dis_max` int(8) default NULL,
`dis_min` int(8) default NULL,
`time_threshold` int(8) NOT NULL default '0',
`last_fired` datetime NOT NULL default '0000-00-00 00:00:00',
`max_alerts` tinyint(4) unsigned NOT NULL default '1',
`times_fired` tinyint(4) unsigned NOT NULL default '0',
`module_type` tinyint(4) unsigned NOT NULL default '0',
`min_alerts` tinyint(4) unsigned NOT NULL default '0',
`internal_counter` tinyint(4) unsigned default '0',
`dis_max` bigint(12) default NULL,
`dis_min` bigint(12) default NULL,
`time_threshold` int(11) NOT NULL default '0',
`last_fired` datetime NOT NULL default '2001-01-01 00:00:00',
`max_alerts` int(4) NOT NULL default '1',
`times_fired` int(11) NOT NULL default '0',
`module_type` int(11) NOT NULL default '0',
`min_alerts` int(4) NOT NULL default '0',
`internal_counter` int(4) default '0',
PRIMARY KEY (`id_aam`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tattachment'
#
--
-- Table structure for table `tattachment`
--
DROP TABLE IF EXISTS `tattachment`;
CREATE TABLE `tattachment` (
`id_attachment` int(10) unsigned NOT NULL auto_increment,
`id_incidencia` int(10) unsigned NOT NULL default '0',
`id_attachment` bigint(20) unsigned NOT NULL auto_increment,
`id_incidencia` bigint(20) NOT NULL default '0',
`id_usuario` varchar(60) NOT NULL default '',
`filename` varchar(255) NOT NULL default '',
`description` varchar(150) default '',
`size` int(10) unsigned NOT NULL default '0',
`size` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id_attachment`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tconfig'
#
--
-- Table structure for table `tconfig`
--
DROP TABLE IF EXISTS `tconfig`;
CREATE TABLE `tconfig` (
`id_config` int(10) unsigned NOT NULL auto_increment,
`token` varchar(100) NOT NULL default '',
`value` varchar(100) NOT NULL default '',
PRIMARY KEY (`id_config`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tconfig_os'
#
--
-- Table structure for table `tconfig_os`
--
DROP TABLE IF EXISTS `tconfig_os`;
CREATE TABLE `tconfig_os` (
`id_os` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`description` varchar(250) default '',
`icon_name` varchar(100) default '',
PRIMARY KEY (`id_os`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tevento'
#
--
-- Table structure for table `tevento`
--
DROP TABLE IF EXISTS `tevento`;
CREATE TABLE `tevento` (
`id_evento` bigint(20) unsigned NOT NULL auto_increment,
`id_agente` int(10) unsigned NOT NULL default '0',
`id_agente` bigint(20) NOT NULL default '0',
`id_usuario` varchar(60) NOT NULL default '0',
`id_grupo` int(10) unsigned NOT NULL default '0',
`estado` tinyint(4) unsigned NOT NULL default '0',
`id_grupo` bigint(20) NOT NULL default '0',
`estado` int(10) unsigned NOT NULL default '0',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`evento` varchar(255) NOT NULL default '',
PRIMARY KEY (`id_evento`),
KEY `indice_1` (`id_agente`),
KEY `indice_2` (`id_grupo`),
KEY `indice_3` (`id_usuario`)
) TYPE=InnoDB;
KEY `indice_1` (`id_agente`,`id_evento`),
KEY `indice_2` (`timestamp`,`id_evento`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tgrupo'
#
--
-- Table structure for table `tgrupo`
--
DROP TABLE IF EXISTS `tgrupo`;
CREATE TABLE `tgrupo` (
`id_grupo` mediumint(8) unsigned NOT NULL auto_increment,
`nombre` varchar(100) NOT NULL default '',
`icon` varchar(50) default NULL,
`parent` tinyint(4) NOT NULL default '-1',
PRIMARY KEY (`id_grupo`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tincidencia'
#
--
-- Table structure for table `tincidencia`
--
DROP TABLE IF EXISTS `tincidencia`;
CREATE TABLE `tincidencia` (
`id_incidencia` int(10) unsigned NOT NULL auto_increment,
`id_incidencia` bigint(20) unsigned NOT NULL auto_increment,
`inicio` datetime NOT NULL default '0000-00-00 00:00:00',
`cierre` datetime NOT NULL default '0000-00-00 00:00:00',
`titulo` varchar(100) NOT NULL default '',
`descripcion` mediumtext NOT NULL,
`id_usuario` varchar(100) NOT NULL default '',
`origen` varchar(100) NOT NULL default '',
`estado` tinyint(4) unsigned NOT NULL default '0',
`prioridad` tinyint(4) unsigned NOT NULL default '0',
`id_grupo` int(10) unsigned NOT NULL default '0',
`estado` int(11) NOT NULL default '0',
`prioridad` int(11) NOT NULL default '0',
`id_grupo` mediumint(9) NOT NULL default '0',
`actualizacion` datetime NOT NULL default '0000-00-00 00:00:00',
`id_creator` varchar(60) default NULL,
PRIMARY KEY (`id_incidencia`),
KEY `incident_index_1` (`id_usuario`,`id_incidencia`)
KEY `indident_index_2` (`id_grupo`),
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tlanguage'
#
--
-- Table structure for table `tlanguage`
--
DROP TABLE IF EXISTS `tlanguage`;
CREATE TABLE `tlanguage` (
`id_language` char(6) NOT NULL default '',
`name` varchar(50) NOT NULL default '',
`id_language` varchar(5) NOT NULL default '',
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id_language`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tlink'
#
--
-- Table structure for table `tlink`
--
DROP TABLE IF EXISTS `tlink`;
CREATE TABLE `tlink` (
`id_link` int(10) unsigned zerofill NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`link` varchar(255) NOT NULL default '',
PRIMARY KEY (`id_link`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tmensajes'
#
--
-- Table structure for table `tmensajes`
--
DROP TABLE IF EXISTS `tmensajes`;
CREATE TABLE `tmensajes` (
`id_mensaje` int(10) unsigned NOT NULL auto_increment,
`id_mensaje` bigint(20) unsigned NOT NULL auto_increment,
`id_usuario_origen` varchar(100) NOT NULL default '',
`id_usuario_destino` varchar(100) NOT NULL default '',
`mensaje` tinytext NOT NULL,
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`timestamp` datetime NOT NULL default '2005-01-01 00:00:00',
`subject` varchar(255) NOT NULL default '',
`estado` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id_mensaje`),
KEY `msg_index_1` (`id_usuario_origen`),
) TYPE=InnoDB;
PRIMARY KEY (`id_mensaje`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tmodule_group'
#
--
-- Table structure for table `tmodule_group`
--
DROP TABLE IF EXISTS `tmodule_group`;
CREATE TABLE `tmodule_group` (
`id_mg` int(10) unsigned NOT NULL auto_increment,
`id_mg` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(150) NOT NULL default '',
PRIMARY KEY (`id_mg`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tnota'
#
--
-- Table structure for table `tnetwork_component`
--
DROP TABLE IF EXISTS `tnetwork_component`;
CREATE TABLE `tnetwork_component` (
`id_nc` mediumint(12) unsigned NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
`description` varchar(250) default NULL,
`id_group` mediumint(9) NOT NULL default '1',
`type` smallint(6) NOT NULL default '6',
`max` bigint(20) NOT NULL default '0',
`min` bigint(20) NOT NULL default '0',
`module_interval` mediumint(8) unsigned NOT NULL default '0',
`tcp_port` int(10) unsigned NOT NULL default '0',
`tcp_send` varchar(255) NOT NULL,
`tcp_rcv` varchar(255) NOT NULL default 'NULL',
`snmp_community` varchar(255) NOT NULL default 'NULL',
`snmp_oid` varchar(400) NOT NULL,
`id_module_group` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`id_nc`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tnetwork_component_group`
--
DROP TABLE IF EXISTS `tnetwork_component_group`;
CREATE TABLE `tnetwork_component_group` (
`id_sg` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(200) NOT NULL default '',
`parent` mediumint(9) NOT NULL default '0',
PRIMARY KEY (`id_sg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tnetwork_profile`
--
DROP TABLE IF EXISTS `tnetwork_profile`;
CREATE TABLE `tnetwork_profile` (
`id_np` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`description` varchar(250) default '',
PRIMARY KEY (`id_np`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tnetwork_profile_component`
--
DROP TABLE IF EXISTS `tnetwork_profile_component`;
CREATE TABLE `tnetwork_profile_component` (
`id_npc` mediumint(8) unsigned NOT NULL auto_increment,
`id_nc` mediumint(8) unsigned NOT NULL default '0',
`id_np` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`id_npc`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tnota`
--
DROP TABLE IF EXISTS `tnota`;
CREATE TABLE `tnota` (
`id_nota` mediumint(8) unsigned NOT NULL auto_increment,
`id_usuario` varchar(100) NOT NULL default '0',
`timestamp` tinyblob NOT NULL,
`nota` mediumtext NOT NULL,
PRIMARY KEY (`id_nota`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tnota_inc'
#
--
-- Table structure for table `tnota_inc`
--
DROP TABLE IF EXISTS `tnota_inc`;
CREATE TABLE `tnota_inc` (
`id_nota_inc` mediumint(8) unsigned NOT NULL auto_increment,
`id_incidencia` mediumint(8) unsigned NOT NULL default '0',
`id_nota` mediumint(8) unsigned NOT NULL default '0',
`id_incidencia` mediumint(9) NOT NULL default '0',
`id_nota` mediumint(9) NOT NULL default '0',
PRIMARY KEY (`id_nota_inc`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'torigen'
#
--
-- Table structure for table `torigen`
--
DROP TABLE IF EXISTS `torigen`;
CREATE TABLE `torigen` (
`origen` varchar(100) NOT NULL default ''
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tperfil'
#
--
-- Table structure for table `tperfil`
--
DROP TABLE IF EXISTS `tperfil`;
CREATE TABLE `tperfil` (
`id_perfil` mediumint(8) unsigned NOT NULL auto_increment,
`id_perfil` int(10) unsigned NOT NULL auto_increment,
`name` varchar(60) NOT NULL default '',
`incident_edit` tinyint(3) unsigned NOT NULL default '0',
`incident_view` tinyint(3) unsigned NOT NULL default '0',
`incident_management` tinyint(3) unsigned NOT NULL default '0',
`agent_view` tinyint(3) unsigned NOT NULL default '0',
`agent_edit` tinyint(3) unsigned NOT NULL default '0',
`alert_edit` tinyint(3) unsigned NOT NULL default '0',
`user_management` tinyint(3) unsigned NOT NULL default '0',
`db_management` tinyint(3) unsigned NOT NULL default '0',
`alert_management` tinyint(3) unsigned NOT NULL default '0',
`pandora_management` tinyint(3) unsigned NOT NULL default '0',
`incident_edit` int(11) NOT NULL default '0',
`incident_view` int(11) NOT NULL default '0',
`incident_management` int(11) NOT NULL default '0',
`agent_view` int(11) NOT NULL default '0',
`agent_edit` int(11) NOT NULL default '0',
`alert_edit` int(11) NOT NULL default '0',
`user_management` int(11) NOT NULL default '0',
`db_management` int(11) NOT NULL default '0',
`alert_management` int(11) NOT NULL default '0',
`pandora_management` int(11) NOT NULL default '0',
PRIMARY KEY (`id_perfil`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tserver'
#
--
-- Table structure for table `trecon_task`
--
DROP TABLE IF EXISTS `trecon_task`;
CREATE TABLE `trecon_task` (
`id_rt` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`description` varchar(250) NOT NULL default '',
`type` tinyint(3) unsigned NOT NULL default '0',
`subnet` varchar(20) NOT NULL default '',
`id_network_server` int(10) unsigned NOT NULL default '0',
`id_network_profile` int(10) unsigned NOT NULL default '0',
`create_incident` tinyint(3) unsigned NOT NULL default '0',
`id_group` int(10) unsigned NOT NULL default '1',
`utimestamp` bigint(20) unsigned NOT NULL default '0',
`status` tinyint(4) NOT NULL default '0',
`interval` int(10) unsigned NOT NULL default '1440',
PRIMARY KEY (`id_rt`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `tserver`
--
DROP TABLE IF EXISTS `tserver`;
CREATE TABLE `tserver` (
`id_server` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`ip_address` varchar(100) NOT NULL default '',
`status` tinyint(3) unsigned NOT NULL default '0',
`status` int(11) NOT NULL default '0',
`laststart` datetime NOT NULL default '0000-00-00 00:00:00',
`keepalive` datetime NOT NULL default '0000-00-00 00:00:00',
`snmp_server` tinyint(3) unsigned NOT NULL default '1',
`network_server` tinyint(3) unsigned NOT NULL default '0',
`data_server` tinyint(3) unsigned NOT NULL default '0',
`master` tinyint(3) unsigned NOT NULL default '1',
`checksum` tinyint(3) unsigned NOT NULL default '1',
`description` varchar(255) NOT NULL default '',
`snmp_server` tinyint(3) unsigned NOT NULL default '0',
`network_server` tinyint(3) unsigned NOT NULL default '0',
`data_server` tinyint(3) unsigned NOT NULL default '0',
`master` tinyint(3) unsigned NOT NULL default '0',
`checksum` tinyint(3) unsigned NOT NULL default '0',
`description` varchar(255) default NULL,
`recon_server` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id_server`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tsesion'
#
--
-- Table structure for table `tsesion`
--
DROP TABLE IF EXISTS `tsesion`;
CREATE TABLE `tsesion` (
`ID_sesion` bigint(4) unsigned NOT NULL auto_increment,
`ID_usuario` varchar(60) NOT NULL default '0',
@ -397,43 +626,48 @@ CREATE TABLE `tsesion` (
`descripcion` varchar(200) NOT NULL default '',
`fecha` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ID_sesion`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'ttipo_modulo'
#
--
-- Table structure for table `ttipo_modulo`
--
DROP TABLE IF EXISTS `ttipo_modulo`;
CREATE TABLE `ttipo_modulo` (
`id_tipo` smallint(5) unsigned NOT NULL auto_increment,
`nombre` varchar(100) NOT NULL default '',
`categoria` tinyint(3) unsigned NOT NULL default '0',
`categoria` int(11) NOT NULL default '0',
`descripcion` varchar(100) NOT NULL default '',
`icon` varchar(100) default NULL,
PRIMARY KEY (`id_tipo`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'ttrap'
#
--
-- Table structure for table `ttrap`
--
DROP TABLE IF EXISTS `ttrap`;
CREATE TABLE `ttrap` (
`id_trap` int(10) unsigned NOT NULL auto_increment,
`id_trap` bigint(20) unsigned NOT NULL auto_increment,
`source` varchar(50) NOT NULL default '',
`oid` varchar(255) NOT NULL default '',
`oid_custom` varchar(255) default '',
`type` tinyint(3) unsigned NOT NULL default '0',
`type` int(11) NOT NULL default '0',
`type_custom` varchar(100) default '',
`value` varchar(255) default '',
`value_custom` varchar(255) default '',
`alerted` tinyint(3) unsigned NOT NULL default '0',
`status`tinyint(3) unsigned NOT NULL default '0',
`alerted` smallint(6) NOT NULL default '0',
`status` smallint(6) NOT NULL default '0',
`id_usuario` varchar(150) default '',
`timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`utimestamp` integer unsigned NOT NULL default '0',
PRIMARY KEY (`id_trap`)
) TYPE=InnoDB COMMENT='SNMP Trap table';
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='SNMP Trap table';
# Database: pandora
# Table: 'tusuario'
#
--
-- Table structure for table `tusuario`
--
DROP TABLE IF EXISTS `tusuario`;
CREATE TABLE `tusuario` (
`id_usuario` varchar(60) NOT NULL default '0',
`nombre_real` varchar(125) NOT NULL default '',
@ -443,17 +677,40 @@ CREATE TABLE `tusuario` (
`direccion` varchar(100) default '',
`telefono` varchar(100) default '',
`nivel` tinyint(1) NOT NULL default '0'
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Database: pandora
# Table: 'tusuario_perfil'
#
--
-- Table structure for table `tusuario_perfil`
--
DROP TABLE IF EXISTS `tusuario_perfil`;
CREATE TABLE `tusuario_perfil` (
`id_up` int(10) unsigned NOT NULL auto_increment,
`id_up` bigint(20) unsigned NOT NULL auto_increment,
`id_usuario` varchar(100) NOT NULL default '',
`id_perfil` tinyint(3) unsigned NOT NULL default '0',
`id_grupo` tinyint(3) unsigned NOT NULL default '0',
`id_perfil` int(20) NOT NULL default '0',
`id_grupo` int(11) NOT NULL default '0',
`assigned_by` varchar(100) NOT NULL default '',
PRIMARY KEY (`id_up`)
) TYPE=InnoDB;
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `vistas_consola`
--
DROP TABLE IF EXISTS `vistas_consola`;
CREATE TABLE `vistas_consola` (
`idVista` int(5) NOT NULL auto_increment,
`nombre` varchar(50) NOT NULL,
`descripcion` varchar(250) NOT NULL,
PRIMARY KEY (`idVista`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

View File

@ -1,16 +1,20 @@
<?php
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// Pandora FMS - the Free monitoring system
// ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
// Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com
// Javascript Active Console code.
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// 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; either version 2
// of the License, or (at your option) any later version.
// 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
@ -18,7 +22,6 @@
// 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
include ("../include/config.php");
include ("../include/functions.php");
@ -66,7 +69,9 @@ function dame_fecha($mh){
return $m;
}
function dame_fecha_grafico_timestamp ($timestamp) { return date('d/m H:i', $timestamp); }
function dame_fecha_grafico_timestamp ($timestamp) {
return date('d/m H:i', $timestamp);
}
function grafico_modulo_sparse ( $id_agente_modulo, $periodo, $draw_events,
$width, $height , $title, $unit_name ) {
@ -1259,7 +1264,6 @@ function progress_bar($progress,$width,$height) {
if ($height == 0) {
$height = 20;
}
//$rating = $_GET['rating'];
$ratingbar = (($rating/100)*$width)-2;
$image = imagecreate($width,$height);
@ -1268,7 +1272,7 @@ function progress_bar($progress,$width,$height) {
$border = ImageColorAllocate($image,0,0,0);
$red = ImageColorAllocate($image,255,60,75);
$fill = ImageColorAllocate($image,44,81,150);
$rating = format_numeric ( $rating, 2);
ImageFilledRectangle($image,0,0,$width-1,$height-1,$back);
if ($rating > 100)
ImageFilledRectangle($image,1,1,$ratingbar,$height-1,$red);