* More cosmetic changes for godmode forms.

* Manage config works now for all module types (problems with new modules in 1.2 version).
* Added some modifications in language_en (Assigned server -> Assigned Network Server).
* Monitor view, module view, alert view and godmode view is now ordered by name.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@73 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2006-07-02 21:25:53 +00:00
parent d04a111393
commit afc2702efd
7 changed files with 162 additions and 114 deletions

View File

@ -556,34 +556,32 @@ if (give_acl($id_user, 0, "AW")==1) {
$result=mysql_query($sql_delete); $result=mysql_query($sql_delete);
} }
?>
<h2><?php echo $lang_label["agent_conf"]; ?></h2>
<?php // ========================
// AGENT GENERAL DATA FORM
// ========================
echo "<h2>".$lang_label["agent_conf"]."</h2>";
if (isset($_GET["creacion"])){echo "<h3>".$lang_label["create_agent"]."<a href='help/".substr($language_code,0,2)."/chap3.php#32' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";} if (isset($_GET["creacion"])){echo "<h3>".$lang_label["create_agent"]."<a href='help/".substr($language_code,0,2)."/chap3.php#32' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";}
else {echo "<h3>".$lang_label["update_agent"]."<a href='help/".substr($language_code,0,2)."/chap3.php#32' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";} else {echo "<h3>".$lang_label["update_agent"]."<a href='help/".substr($language_code,0,2)."/chap3.php#32' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";}
?> echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente"> if ($creacion_agente == 1)
<?php echo "<input type='hidden' name='create_agent' value='1'>";
if ($creacion_agente == 1) else {
echo "<input type='hidden' name='create_agent' value='1'>"; echo "<input type='hidden' name='update_agent' value='1'>";
else { echo "<input type='hidden' name='id_agente' value='".$id_agente."'>";
echo "<input type='hidden' name='update_agent' value='1'>"; }
echo "<input type='hidden' name='id_agente' value='".$id_agente."'>"; echo '<table width="650" cellpadding="3" cellspacing="3" class="fon">';
} echo "<tr><td class='lb' rowspan='9' width='5'>";
?> echo '<td class="datos"><b>'.$lang_label["agent_name"].'</b></td><td class="datos"><input type="text" name="agente" size=30 value="'.$nombre_agente.'">';
<table width="650" cellpadding="3" cellspacing="3" class="fon">
<tr><td class='lb' rowspan='9' width='5'>
<td class="datos"><b><?php echo $lang_label["agent_name"]?></b></td><td class="datos"><input type="text" name="agente" size=30 value="<?php echo $nombre_agente ?>">
<?php
if (isset($_GET["creacion"])){ if (isset($_GET["creacion"])){
echo "&nbsp;"; echo "&nbsp;";
} else { } else {
echo "&nbsp;<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."' <img src='images/setup.gif' width=25 valign='top' align='middle' border=0></a>&nbsp;<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'><img src='images/lupa.gif' border='0' align='middle'></a>"; echo "&nbsp;<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."' <img src='images/setup.gif' width=25 valign='top' align='middle' border=0></a>&nbsp;<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'><img src='images/lupa.gif' border='0' align='middle'></a>";
} }
?> ?>
<tr><td class="datos"><b><?php echo $lang_label["ip_address"]?></b><td class="datos"><input type="text" name="direccion" size=30 value="<?php echo $direccion_agente ?>"> <tr><td class="datos2"><b><?php echo $lang_label["ip_address"]?></b><td class="datos2"><input type="text" name="direccion" size=30 value="<?php echo $direccion_agente ?>">
<!-- Desplegable para el grupo --> <!-- Desplegable para el grupo -->
<tr><td class="datos"><b><?php echo $lang_label["group"]?></b><td class="datos"><select name="grupo" class="w130"> <tr><td class="datos"><b><?php echo $lang_label["group"]?></b><td class="datos"><select name="grupo" class="w130">
<?php <?php
@ -600,7 +598,7 @@ while ($row=mysql_fetch_array($result)){
} }
?> ?>
</select> </select>
<tr><td class="datos"><b><?php echo $lang_label["interval"]?></b></td><td class="datos"><input type="text" name="intervalo" size="15" value="<?php echo $intervalo?>"></td> <tr><td class="datos2"><b><?php echo $lang_label["interval"]?></b></td><td class="datos2"><input type="text" name="intervalo" size="15" value="<?php echo $intervalo?>"></td>
<tr><td class="datos"><b><?php echo $lang_label["os"]?></b></td><td class="datos"> <tr><td class="datos"><b><?php echo $lang_label["os"]?></b></td><td class="datos">
<select name="os_name" class="w130"> <select name="os_name" class="w130">
<?php <?php
@ -615,11 +613,11 @@ while ($row=mysql_fetch_array($result)){
?> ?>
</select> </select>
<tr><td class="datos"><b><?php echo $lang_label["server"]?></b></td><td class="datos"> <tr><td class="datos2"><b><?php echo $lang_label["server"]?></b></td><td class="datos2">
<select name="id_server" class="w130"> <select name="id_server" class="w130">
<?php <?php
echo "<option value='".$id_server."'>".give_server_name($id_server); echo "<option value='".$id_server."'>".give_server_name($id_server);
$sql1='SELECT * FROM tserver ORDER BY name'; $sql1='SELECT * FROM tserver where network_server = 1 ORDER BY name';
$result=mysql_query($sql1); $result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){ while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["id_server"]."'>".$row["name"]; echo "<option value='".$row["id_server"]."'>".$row["name"];
@ -630,8 +628,8 @@ while ($row=mysql_fetch_array($result)){
<tr><td class="datos"><b><?php echo $lang_label["description"]?></b><td class="datos"><input type="text" name="comentarios" size="55" value="<?php echo $comentarios ?>"></td> <tr><td class="datos"><b><?php echo $lang_label["description"]?></b><td class="datos"><input type="text" name="comentarios" size="55" value="<?php echo $comentarios ?>"></td>
<tr><td class="datos"><b><?php echo $lang_label["module_definition"]?></b> <tr><td class="datos2"><b><?php echo $lang_label["module_definition"]?></b>
<td class="datos"> <td class="datos2">
<?php if ($modo == "1"){ <?php if ($modo == "1"){
echo $lang_label["learning_mode"].'<input type="radio" class="chk" name="modo" value="1" checked >'; echo $lang_label["learning_mode"].'<input type="radio" class="chk" name="modo" value="1" checked >';
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$lang_label["normal_mode"].' <input type="radio" class="chk" name="modo" value="0">'; echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$lang_label["normal_mode"].' <input type="radio" class="chk" name="modo" value="0">';
@ -670,58 +668,72 @@ if ( $creacion_agente != 1) {
while ($row_t=mysql_fetch_array($result_t)){ while ($row_t=mysql_fetch_array($result_t)){
$iconindex[$row_t["id_tipo"]] = $row_t["icon"]; $iconindex[$row_t["id_tipo"]] = $row_t["icon"];
} }
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"'; $sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'" order by nombre';
$result=mysql_query($sql1); $result=mysql_query($sql1);
if ($row=mysql_num_rows($result)){ if ($row=mysql_num_rows($result)){
?> ?>
<h3><?php echo $lang_label["assigned_modules"]?> </h3> <h3><?php echo $lang_label["assigned_modules"]?> </h3>
<table width="700" cellpadding="3" cellspacing="3" class="fon"> <table width="700" cellpadding="3" cellspacing="3" class="fon">
<tr> <tr>
<th><?php echo $lang_label["module_name"]?> <th><?php echo $lang_label["module_name"]?>
<th><?php echo $lang_label["type"]?> <th><?php echo $lang_label["type"]?>
<th><?php echo $lang_label["interval"]?> <th><?php echo $lang_label["interval"]?>
<th><?php echo $lang_label["description"]?> <th><?php echo $lang_label["description"]?>
<th><?php echo $lang_label["module_group"]?> <th><?php echo $lang_label["module_group"]?>
<th><?php echo $lang_label["max_min"]?> <th><?php echo $lang_label["max_min"]?>
<th width="50"><?php echo $lang_label["action"]?> <th width="50"><?php echo $lang_label["action"]?>
<?php <?php
while ($row=mysql_fetch_array($result)){ $color=1;
$id_tipo = $row["id_tipo_modulo"]; while ($row=mysql_fetch_array($result)){
$nombre_modulo =$row["nombre"]; if ($color == 1){
$descripcion = $row["descripcion"]; $tdcolor="datos";
$module_max = $row["max"]; $color =0;
$module_min = $row["min"]; } else {
$module_interval2 = $row["module_interval"]; $tdcolor="datos2";
$module_group2 = $row["id_module_group"]; $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='datos_id'>".$nombre_modulo; echo "<tr><td class='$tdcolor_id'>".$nombre_modulo;
echo "<td class='datosf9'>"; echo "<td class='$tdcolorf9'>";
if ($id_tipo > 0) { if ($id_tipo > 0) {
echo "<img src='images/".$iconindex[$id_tipo]."' border=0>"; echo "<img src='images/".$iconindex[$id_tipo]."' border=0>";
} }
echo "<td class='datos'>".$module_interval2; if ($module_interval2!=0){
echo "<td class='datos'>".substr($descripcion,0,30); echo "<td class='$tdcolor'>".$module_interval2;
echo "<td class='datos'>".substr(dame_nombre_grupomodulo($module_group2),0,15); } else {
echo "<td class='datos'>"; echo "<td class='$tdcolor'> N/A";
if ($module_max == $module_min) { }
$module_max = "N/A";
$module_min = "N/A"; echo "<td class='$tdcolor'>".substr($descripcion,0,30);
} echo "<td class='$tdcolor'>".substr(dame_nombre_grupomodulo($module_group2),0,15);
echo $module_max." / ".$module_min; echo "<td class='$tdcolor'>";
echo "<td class='datos'>"; if ($module_max == $module_min) {
if ($id_tipo != -1) $module_max = "N/A";
echo "<a href='index.php?sec=gagente&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; "; $module_min = "N/A";
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."&update_module=".$row["id_agente_modulo"]."#modules'><img src='images/config.gif' border=0 alt='".$lang_label["update"]."'></b></a>"; }
} echo $module_max." / ".$module_min;
echo "<tr><td colspan='7'><div class='raya'></div></td></tr>"; echo "<td class='$tdcolor'>";
}else echo "<font class='red'>No modules</font>"; if ($id_tipo != -1)
echo "<a href='index.php?sec=gagente&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."&update_module=".$row["id_agente_modulo"]."#modules'><img src='images/config.gif' border=0 alt='".$lang_label["update"]."'></b></a>";
}
echo "<tr><td colspan='7'><div class='raya'></div></td></tr>";
} else
echo "<font class='red'>No modules</font>";
?> ?>
</table> </table>
<?php <?php
// ==================================================================================== // ====================================================================================
// View alerts // VIEW ALERTS
// ====================================================================================<br> // ====================================================================================<br>
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"'; $sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"';
@ -739,6 +751,7 @@ if ($row=mysql_num_rows($result)){
<th><?php echo $lang_label["description"] ?> <th><?php echo $lang_label["description"] ?>
<th width="50"><?php echo $lang_label["action"] ?> <th width="50"><?php echo $lang_label["action"] ?>
<?php <?php
$color=1;
while ($row=mysql_fetch_array($result)){ // All modules of this agent while ($row=mysql_fetch_array($result)){ // All modules of this agent
$id_tipo = $row["id_tipo_modulo"]; $id_tipo = $row["id_tipo_modulo"];
$nombre_modulo =$row["nombre"]; $nombre_modulo =$row["nombre"];
@ -750,23 +763,30 @@ while ($row=mysql_fetch_array($result)){ // All modules of this agent
$sql3='SELECT * FROM talerta_agente_modulo WHERE id_agente_modulo = '.$row["id_agente_modulo"]; // From all the alerts give me which are to my agent $sql3='SELECT * FROM talerta_agente_modulo WHERE id_agente_modulo = '.$row["id_agente_modulo"]; // From all the alerts give me which are to my agent
$result3=mysql_query($sql3); $result3=mysql_query($sql3);
while ($row3=mysql_fetch_array($result3)){ while ($row3=mysql_fetch_array($result3)){
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$sql4='SELECT * FROM talerta WHERE id_alerta = '.$row3["id_alerta"]; $sql4='SELECT * FROM talerta WHERE id_alerta = '.$row3["id_alerta"];
$result4=mysql_query($sql4); $result4=mysql_query($sql4);
$row4=mysql_fetch_array($result4); $row4=mysql_fetch_array($result4);
// Alert name defined by $row4["nombre"]; // Alert name defined by $row4["nombre"];
$tipo_modulo = $row2["nombre"]; $tipo_modulo = $row2["nombre"];
$nombre_alerta = $row4["nombre"]; $nombre_alerta = $row4["nombre"];
echo "<tr><td class=datos>"; echo "<tr><td class='$tdcolor'>";
echo $nombre_modulo."/".$tipo_modulo; echo $nombre_modulo."/".$tipo_modulo;
echo "<td class=datos>"; echo "<td class=$tdcolor>";
echo $nombre_alerta; echo $nombre_alerta;
echo "<td class=datos>"; echo "<td class='$tdcolor'>";
echo $row3["time_threshold"]; echo $row3["time_threshold"];
echo "<td class=datos>"; echo "<td class='$tdcolor'>";
echo $row3["dis_min"]."/".$row3["dis_max"]; echo $row3["dis_min"]."/".$row3["dis_max"];
echo "<td class=datos>"; echo "<td class='$tdcolor'>";
echo salida_limpia($row3["descripcion"]); echo salida_limpia($row3["descripcion"]);
echo "<td class=datos>"; echo "<td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente); $id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){ if (give_acl($id_user, $id_grupo, "LW")==1){
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."&delete_alert=".$row3["id_aam"]."'><img src='images/cancel.gif' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; "; echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."&delete_alert=".$row3["id_aam"]."'><img src='images/cancel.gif' border=0 alt='".$lang_label["delete"]."'></a> &nbsp; ";
@ -840,9 +860,9 @@ else {
?> ?>
</select> </select>
<tr><td class="datos"><?php echo $lang_label["module_name"] ?> <tr><td class="datos2"><?php echo $lang_label["module_name"] ?>
<td class="datos"><input type="text" name="nombre" size="20" value="<?php echo $modulo_nombre ?>"> <td class="datos2"><input type="text" name="nombre" size="20" value="<?php echo $modulo_nombre ?>">
<td class="datos"><?php echo $lang_label["module_interval"] ?><td class="datos"> <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 ?>"> <input type="text" name="module_interval" size="5" value="<?php echo $module_interval ?>">
<tr><td class="datos"><?php echo $lang_label["ip_target"] ?> <tr><td class="datos"><?php echo $lang_label["ip_target"] ?>
@ -850,12 +870,12 @@ else {
<td class="datos"><?php echo $lang_label["tcp_port"] ?> <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 ?>"> <td class="datos"><input type="text" name="tcp_port" size="5" value="<?php echo $tcp_port ?>">
<tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?> <tr><td class="datos2"><?php echo $lang_label["snmp_oid"] ?>
<td class="datos"><input type="text" name="snmp_oid" size="15" value="<?php echo $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"> <input type="submit" name="oid" value="Get Value">
<td class="datos"><?php echo $lang_label["snmp_community"] ?> <td class="datos2"><?php echo $lang_label["snmp_community"] ?>
<td class="datos"><input type="text" name="snmp_community" size="20" value="<?php echo $snmp_community ?>"> <td class="datos2"><input type="text" name="snmp_community" size="20" value="<?php echo $snmp_community ?>">
<tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?> <tr><td class="datos"><?php echo $lang_label["snmp_oid"] ?>
@ -874,19 +894,19 @@ if (isset($_POST["oid"])){
?> ?>
</select> </select>
<tr><td class="datost"><?php echo $lang_label["tcp_send"] ?> <tr><td class="datos2t"><?php echo $lang_label["tcp_send"] ?>
<td class="datos"><textarea name="tcp_send" cols="17" rows="3"><?php echo $tcp_send ?></textarea> <td class="datos2"><textarea name="tcp_send" cols="17" rows="3"><?php echo $tcp_send ?></textarea>
<td class="datost"><?php echo $lang_label["tcp_rcv"] ?> <td class="datos2t"><?php echo $lang_label["tcp_rcv"] ?>
<td class="datos"><textarea name="tcp_rcv" cols="17" rows="3"><?php echo $tcp_rcv ?></textarea> <td class="datos2"><textarea name="tcp_rcv" cols="17" rows="3"><?php echo $tcp_rcv ?></textarea>
<tr><td class="datos"><?php echo $lang_label["mindata"] ?> <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"><input type="text" name="modulo_min" size="5" value="<?php echo $modulo_min ?>">
<td class="datos"><?php echo $lang_label["maxdata"] ?> <td class="datos"><?php echo $lang_label["maxdata"] ?>
<td class="datos"><input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>"> <td class="datos"><input type="text" name="modulo_max" size="5" value="<?php echo $modulo_max ?>">
<tr><td class="datost"><?php echo $lang_label["comments"] ?> <tr><td class="datos2t"><?php echo $lang_label["comments"] ?>
<td class="datos" colspan=3> <td class="datos2" colspan=3>
<textarea name="descripcion" cols=52 rows=2> <textarea name="descripcion" cols=52 rows=2>
<?php echo $modulo_descripcion ?> <?php echo $modulo_descripcion ?>
</textarea> </textarea>
@ -946,18 +966,18 @@ while ($row=mysql_fetch_array($result)){
</select> </select>
<a name="alerts"> <!-- Don't Delete !! --> <a name="alerts"> <!-- Don't Delete !! -->
<tr><td class="datos"><?php echo $lang_label["min_value"] ?> <tr><td class="datos2"><?php echo $lang_label["min_value"] ?>
<td class="datos"><input type="text" name="minimo" size="5" value="<?php echo $alerta_dis_max ?>"> <td class="datos2"><input type="text" name="minimo" size="5" value="<?php echo $alerta_dis_max ?>">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $lang_label["max_value"] ?> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $lang_label["max_value"] ?> &nbsp;&nbsp;&nbsp;
<input type="text" name="maximo" size="5" value="<?php echo $alerta_dis_min ?>"> <input type="text" name="maximo" size="5" value="<?php echo $alerta_dis_min ?>">
<tr><td class="datos"><?php echo $lang_label["description"] ?> <tr><td class="datos"><?php echo $lang_label["description"] ?>
<td class="datos"><input type="text" name="descripcion" size="39" value ="<?php echo $alerta_descripcion ?>"> <td class="datos"><input type="text" name="descripcion" size="39" value ="<?php echo $alerta_descripcion ?>">
<tr><td class="datos"><?php echo $lang_label["field1"] ?> <tr><td class="datos2"><?php echo $lang_label["field1"] ?>
<td class="datos"><input type="text" name="campo_1" size="39" value="<?php echo $alerta_campo1 ?>"> <td class="datos2"><input type="text" name="campo_1" size="39" value="<?php echo $alerta_campo1 ?>">
<tr><td class="datos"><?php echo $lang_label["field2"] ?> <tr><td class="datos"><?php echo $lang_label["field2"] ?>
<td class="datos"><input type="text" name="campo_2" size="39" value="<?php echo $alerta_campo2 ?>"> <td class="datos"><input type="text" name="campo_2" size="39" value="<?php echo $alerta_campo2 ?>">
<tr><td class="datos"><?php echo $lang_label["field3"] ?> <tr><td class="datos2"><?php echo $lang_label["field3"] ?>
<td class="datos"><textarea name="campo_3" cols="36" rows="3"><?php echo $alerta_campo3 ?></textarea> <td class="datos2"><textarea name="campo_3" cols="36" rows="3"><?php echo $alerta_campo3 ?></textarea>
<tr><td class="datos"><?php echo $lang_label["time_threshold"] ?> <tr><td class="datos"><?php echo $lang_label["time_threshold"] ?>
<td class="datos"><select name="time_threshold"> <td class="datos"><select name="time_threshold">
<?PHP <?PHP
@ -982,8 +1002,8 @@ while ($row=mysql_fetch_array($result)){
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input type="text" name="other" size="5"> <input type="text" name="other" size="5">
<tr><td class="datos"><?php echo $lang_label["min_alerts"] ?> <tr><td class="datos2"><?php echo $lang_label["min_alerts"] ?>
<td class="datos"> <td class="datos2">
<input type="text" name="min_alerts" size="5" value="<?php if (isset($alerta_min_alerts)) {echo$alerta_min_alerts;} ?>"> <input type="text" name="min_alerts" size="5" value="<?php if (isset($alerta_min_alerts)) {echo$alerta_min_alerts;} ?>">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php echo $lang_label["max_alerts"] ?> <?php echo $lang_label["max_alerts"] ?>

View File

@ -2,7 +2,7 @@
// Pandora - the Free monitoring system // Pandora - the Free monitoring system
// ==================================== // ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com // Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L, info@artica.es // Copyright (c) 2005-2006 Artica Soluciones Tecnol<EFBFBD>icas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com // Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
@ -73,6 +73,8 @@ if (comprueba_login() == 0)
$b=-1; $b=-1;
else else
$b=0; $b=0;
// Module read
if ($modulos ==1){ if ($modulos ==1){
for ($b=$b; $b < count($origen_modulo); $b++){ for ($b=$b; $b < count($origen_modulo); $b++){
if ($multiple == 0) if ($multiple == 0)
@ -88,17 +90,33 @@ if (comprueba_login() == 0)
// Read every module in source agent // Read every module in source agent
$o_descripcion = $row["descripcion"]; $o_descripcion = $row["descripcion"];
$o_max = $row["max"];
$o_min = $row["min"];
$o_module_interval = $row["module_interval"];
$o_tcp_port = $row["tcp_port"];
$o_tcp_send = $row["tcp_send"];
$o_tcp_rcv = $row["tcp_rcv"];
$o_snmp_community = $row["snmp_community"];
$o_snmp_oid = $row["snmp_oid"];
$o_ip_target = $row["ip_target"];
$o_id_module_group = $row["id_module_group"];
// Write every module in destination agent // Write every module in destination agent
if ($o_nombre != "agent_keepalive") { if ($o_nombre != "agent_keepalive") {
$sql = "INSERT INTO tagente_modulo (id_agente,id_tipo_modulo,descripcion,nombre) VALUES $sql = "INSERT INTO tagente_modulo (id_agente,id_tipo_modulo,descripcion,nombre, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, ip_target, id_module_group, flag) VALUES
(".$d_id_agente.",'".$o_id_tipo_modulo."','".$o_descripcion."','".$o_nombre."')"; (".$d_id_agente.",'".$o_id_tipo_modulo."','".$o_descripcion."','".$o_nombre."', '$o_max', '$o_min', '$o_module_interval', '$o_tcp_port','$o_tcp_send','$o_tcp_rcv','$o_snmp_community','$o_snmp_oid','$o_ip_target',$o_id_module_group, 1)";
$result2=mysql_query($sql); $result2=mysql_query($sql);
//echo "DEBUG INSERT $sql <br>"; // echo "DEBUG INSERT $sql <br>";
echo "<br>&nbsp;&nbsp;".$lang_label["copymod"]." ->".$o_nombre; echo "<br>&nbsp;&nbsp;".$lang_label["copymod"]." ->".$o_nombre;
} }
} }
} }
} }
if ($multiple == 0)
$b=-1;
else
$b=0;
// Alertas
if ($alertas == 1){ if ($alertas == 1){
for ($b=$b; $b < count($origen_modulo); $b++){ for ($b=$b; $b < count($origen_modulo); $b++){
if ($multiple == 0) if ($multiple == 0)
@ -111,8 +129,6 @@ if (comprueba_login() == 0)
$o_id_tipo_modulo = $row["id_tipo_modulo"]; $o_id_tipo_modulo = $row["id_tipo_modulo"];
$o_nombre = $row["nombre"]; $o_nombre = $row["nombre"];
$d_id_agente = $id_agente; // destination agent id $d_id_agente = $id_agente; // destination agent id
$o_descripcion = $row["descripcion"];
// For each agent module, given as $o_id_agente_modulo: // For each agent module, given as $o_id_agente_modulo:
// Searching if destination agent has a agente_modulo with same type and name that source // Searching if destination agent has a agente_modulo with same type and name that source
$sqlp="SELECT * FROM tagente_modulo WHERE id_agente = ".$d_id_agente." AND nombre = '".$o_nombre."' AND id_tipo_modulo = ".$o_id_tipo_modulo; $sqlp="SELECT * FROM tagente_modulo WHERE id_agente = ".$d_id_agente." AND nombre = '".$o_nombre."' AND id_tipo_modulo = ".$o_id_tipo_modulo;
@ -120,7 +136,6 @@ if (comprueba_login() == 0)
if ( $rowp=mysql_fetch_array($resultp)){ if ( $rowp=mysql_fetch_array($resultp)){
// If rowp success get ID // If rowp success get ID
$d_id_agente_modulo = $rowp["id_agente_modulo"]; $d_id_agente_modulo = $rowp["id_agente_modulo"];
// Read every alert from source agent // Read every alert from source agent
$sql2='SELECT * FROM talerta_agente_modulo WHERE id_agente_modulo = '.$o_id_agente_modulo; $sql2='SELECT * FROM talerta_agente_modulo WHERE id_agente_modulo = '.$o_id_agente_modulo;
$result3=mysql_query($sql2); $result3=mysql_query($sql2);
@ -135,10 +150,10 @@ if (comprueba_login() == 0)
$o_time_threshold = $row3["time_threshold"]; $o_time_threshold = $row3["time_threshold"];
$o_last_fired = "2001-01-01 00:00:00"; $o_last_fired = "2001-01-01 00:00:00";
$o_max_alerts = $row3["max_alerts"]; $o_max_alerts = $row3["max_alerts"];
$o_min_alerts = $row3["min_alerts"];
$o_times_fired = 0; $o_times_fired = 0;
// Insert // Insert
$sql_al="INSERT INTO talerta_agente_modulo (id_agente_modulo, id_alerta, al_campo1, al_campo2, al_campo3, descripcion, dis_max, dis_min, time_threshold, last_fired, max_alerts, times_fired) VALUES ( ".$d_id_agente_modulo.", $sql_al="INSERT INTO talerta_agente_modulo (id_agente_modulo, id_alerta, al_campo1, al_campo2, al_campo3, descripcion, dis_max, dis_min, time_threshold, last_fired, max_alerts, times_fired, min_alerts) VALUES ( ".$d_id_agente_modulo.",
".$o_id_alerta.", ".$o_id_alerta.",
'".$o_al_campo1."', '".$o_al_campo1."',
'".$o_al_campo2."', '".$o_al_campo2."',
@ -149,9 +164,9 @@ if (comprueba_login() == 0)
".$o_time_threshold.", ".$o_time_threshold.",
'".$o_last_fired."', '".$o_last_fired."',
".$o_max_alerts.", ".$o_max_alerts.",
".$o_times_fired.")"; ".$o_times_fired.", $o_min_alerts)";
$result_al=mysql_query($sql_al); $result_al=mysql_query($sql_al);
//echo "DEBUG SQL: $sql_al <br>"; // echo "DEBUG SQL: $sql_al <br>";
echo "<br>&nbsp;&nbsp;".$lang_label["copyale"]." ->".$o_descripcion; echo "<br>&nbsp;&nbsp;".$lang_label["copyale"]." ->".$o_descripcion;
} }
} else } else
@ -244,7 +259,7 @@ if (comprueba_login() == 0)
echo "<option value=".$_POST["origen"].">".dame_nombre_agente($_POST["origen"]); echo "<option value=".$_POST["origen"].">".dame_nombre_agente($_POST["origen"]);
} }
// Show combo with agents // Show combo with agents
$sql1='SELECT * FROM tagente'; $sql1='SELECT * FROM tagente order by nombre';
$result=mysql_query($sql1); $result=mysql_query($sql1);
while ($row=mysql_fetch_array($result)){ while ($row=mysql_fetch_array($result)){
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ){ if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ){
@ -260,7 +275,7 @@ if (comprueba_login() == 0)
if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) { if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) {
// Populate Module/Agent combo // Populate Module/Agent combo
$agente_modulo = $_POST["origen"]; $agente_modulo = $_POST["origen"];
$sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo; $sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$agente_modulo. " order by nombre";
$result = mysql_query($sql1); $result = mysql_query($sql1);
while ($row=mysql_fetch_array($result)){ while ($row=mysql_fetch_array($result)){
echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"]; echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"];

View File

@ -563,7 +563,7 @@ $lang_label["mindata"]="Minimum Data";
$lang_label["snmp_oid"]="SNMP OID"; $lang_label["snmp_oid"]="SNMP OID";
$lang_label["module_interval"]="Module Interval"; $lang_label["module_interval"]="Module Interval";
$lang_label["snmp_community"]="SNMP Community"; $lang_label["snmp_community"]="SNMP Community";
$lang_label["server_asigned"]="Server assigned"; $lang_label["server_asigned"]="Network Server assigned";
$lang_label["remote"]="Remote"; $lang_label["remote"]="Remote";
$lang_label["default_server"]="Active Server"; $lang_label["default_server"]="Active Server";
$lang_label["incident_manag"]="Incident management"; $lang_label["incident_manag"]="Incident management";

View File

@ -12,7 +12,7 @@ if (comprueba_login() == 0) {
if (isset($_GET["id_agente"])){ if (isset($_GET["id_agente"])){
$id_agente = $_GET["id_agente"]; $id_agente = $_GET["id_agente"];
$query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo'; $query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo order by tagente_modulo.nombre';
$result_gen=mysql_query($query_gen); $result_gen=mysql_query($query_gen);
if (mysql_num_rows ($result_gen)) { if (mysql_num_rows ($result_gen)) {
echo "<h3>".$lang_label["alert_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3324' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>"; echo "<h3>".$lang_label["alert_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3324' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";

View File

@ -21,6 +21,19 @@ if (comprueba_login() == 0)
if (give_acl($iduser_temp,$row["id_grupo"], "AR") == 1) if (give_acl($iduser_temp,$row["id_grupo"], "AR") == 1)
$mis_grupos[]=$row["id_grupo"]; //All my groups in an array $mis_grupos[]=$row["id_grupo"]; //All my groups in an array
} }
// Update network modules for this group
// Check for Network FLAG change request
if (isset($_GET["update_netgroup"])){
if (give_acl($id_user, $_GET["update_netgroup"], "AW")==1){
$sql = "SELECT * FROM tagente where id_grupo = ".$_GET["update_netgroup"];
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
$id_agente = $row["id_agente"];
$query2 ="UPDATE tagente_modulo SET flag=1 WHERE id_agente = ".$id_agente;
$res=mysql_query($query2);
}
}
}
$contador_grupo = 0; $contador_grupo = 0;
$contador_agente=0; $contador_agente=0;
$array_index = 0; $array_index = 0;

View File

@ -15,7 +15,7 @@ if (comprueba_login() == 0) {
} }
// Get all module from agent // 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; $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.' order by tagente_modulo.nombre';
$result_t=mysql_query($sql_t); $result_t=mysql_query($sql_t);
if (mysql_num_rows ($result_t)) { if (mysql_num_rows ($result_t)) {
echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3323' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>"; echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3323' target='_help'><img src='images/help.gif' border='0' class='help'></a></h3>";

View File

@ -68,7 +68,7 @@ if (comprueba_login() == 0) {
$intervalo_agente = $row_t["intervalo"]; $intervalo_agente = $row_t["intervalo"];
// Get last packet // Get last packet
$sql3='SELECT * FROM tagente_modulo, tagente_estado WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo ORDER BY id_module_group'; $sql3='SELECT * FROM tagente_modulo, tagente_estado WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo ORDER BY id_module_group, nombre';
//$sql3='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente.' order by id_module_group'; //$sql3='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente.' order by id_module_group';
$label_group=0; $label_group=0;
$last_label = ""; $last_label = "";