2007-03-19 Sancho Lerena <slerena@artica.es>
* functions_db.php: Added give_network_profile_name() function. * language_en.php: Added new strings. * index.php, ver_agente.php, estado_generalagente.php: Some style fixes. * view_server.php: Added support for recon servers. Added LAG check for server processing queue. * view_server_detail.php: Added, to get updated information in realtime for queues processed by recon server. * modificar_agente.php: Now deletes associated IP addresses when deleting an agent. * manage_network_templates*.php: Manage network templates / profiles. * manage_recontask*.php: Editor for network tasks (recon server). * menu.php: Added new options. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@397 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
720b82edf5
commit
46d686fece
|
@ -1,3 +1,27 @@
|
|||
2007-03-19 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* functions_db.php: Added give_network_profile_name() function.
|
||||
|
||||
* language_en.php: Added new strings.
|
||||
|
||||
* index.php, ver_agente.php, estado_generalagente.php: Some style
|
||||
fixes.
|
||||
|
||||
* view_server.php: Added support for recon servers. Added LAG
|
||||
check for server processing queue.
|
||||
|
||||
* view_server_detail.php: Added, to get updated information in
|
||||
realtime for queues processed by recon server.
|
||||
|
||||
* modificar_agente.php: Now deletes associated IP addresses when
|
||||
deleting an agent.
|
||||
|
||||
* manage_network_templates*.php: Manage network templates / profiles.
|
||||
|
||||
* manage_recontask*.php: Editor for network tasks (recon server).
|
||||
|
||||
* menu.php: Added new options.
|
||||
|
||||
2007-03-12 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* pandoradb.sql: Upgraded scheme, many changes and many tables
|
||||
|
|
|
@ -78,8 +78,17 @@ if (isset($_GET["borrar_agente"])){ // if delete agent
|
|||
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");
|
||||
|
||||
// Delete IPs from tadress table and taddress_agent
|
||||
$sql = "SELECT * FROM taddress_agent where id_agent = $id_agente";
|
||||
$result=mysql_query($sql);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
$sql2="DELETE FROM taddress where id_a = ".$row["id_a"];
|
||||
$result2=mysql_query($sql2);
|
||||
}
|
||||
$sql = "DELETE FROM taddress_agent where id_agent = $id_agente";
|
||||
$result=mysql_query($sql);
|
||||
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'");
|
||||
|
|
|
@ -32,7 +32,7 @@ if (comprueba_login() == 0)
|
|||
<div align='justify'>
|
||||
<?php echo $lang_label["dbsetup_info"]; ?>
|
||||
</div><br>
|
||||
<img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1">
|
||||
<!-- <img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1"> -->
|
||||
</table>
|
||||
<?php
|
||||
} else {
|
||||
|
|
|
@ -116,9 +116,49 @@ if (comprueba_login() == 0){
|
|||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/modificar_server"){
|
||||
echo '<div id="god5s">';
|
||||
}
|
||||
else echo '<div id="god5">';
|
||||
} else
|
||||
echo '<div id="god5">';
|
||||
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server" class="mn">'.$lang_label["manage_servers"].'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gservers"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/manage_recontask"){
|
||||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".$lang_label["manage_recontask"]."</a></li></ul></div>";
|
||||
}
|
||||
/*
|
||||
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">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente" class="mn">'.$lang_label["manage_agents"].'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gagente"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/agentes/manage_config"){
|
||||
echo "<div class='arrowgs'>";
|
||||
}
|
||||
else echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/agentes/manage_config' class='mn'>".$lang_label["manage_config"]."</a></li></ul></div>";
|
||||
|
||||
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'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/grupos/lista_grupos' class='mn'>".$lang_label["manage_groups"]."</a></li></ul></div>";
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/admin_access_logs"){
|
||||
echo '<div id="god6s">';
|
||||
|
|
|
@ -18,6 +18,68 @@
|
|||
// 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 Network Profile Management");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["delete"])){ // if delete
|
||||
$id_np = entrada_limpia ($_GET["delete"]);
|
||||
$sql_delete= "DELETE FROM tnetwork_profile WHERE id_np = ".$id_np;
|
||||
$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_profile_management"]."</h2>";
|
||||
|
||||
echo "<table cellpadding=4 cellspacing=4 width=550>";
|
||||
echo "<th>".$lang_label["name"]."</th>";
|
||||
echo "<th>".$lang_label["description"]."</th>";
|
||||
echo "<th>".$lang_label["number_of_modules"]."</th>";
|
||||
$sql1='SELECT * FROM tnetwork_profile ORDER BY name';
|
||||
$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_network_templates_form&id_np=".$row["id_np"]."'>".$row["name"]."</A></B>
|
||||
</td>
|
||||
<td class='$tdcolor'>
|
||||
".$row["description"]."
|
||||
</td>
|
||||
<td class='$tdcolor' align='center'>
|
||||
<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates&delete=".$row["id_np"]."'
|
||||
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_network_templates_form&id_np=-1'>";
|
||||
echo "<input type='submit' class='sub' name='crt' value='".$lang_label["create"]."'>";
|
||||
echo "</form></td></tr></table>";
|
||||
|
||||
?>
|
|
@ -0,0 +1,200 @@
|
|||
<?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 Network Profile Management");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (isset($_GET["delete_module"])){ // Delete module from profile
|
||||
$id_npc = $_GET["delete_module"];
|
||||
$sql1="DELETE FROM tnetwork_profile_component WHERE id_npc = $id_npc";
|
||||
$result=mysql_query($sql1);
|
||||
if (! $result)
|
||||
echo "<h3 class='error'>".$lang_label["delete_no"]."</h3>";
|
||||
else {
|
||||
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["add_module"])){ // Add module to profile
|
||||
$id_nc = $_POST["component"];
|
||||
$id_np = $_GET["id_np"];
|
||||
$sql1="INSERT INTO tnetwork_profile_component (id_np,id_nc) VALUES ($id_np, $id_nc)";
|
||||
$result=mysql_query($sql1);
|
||||
if (! $result)
|
||||
echo "<h3 class='error'>".$lang_label["create_no"]."</h3>";
|
||||
else {
|
||||
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
|
||||
}
|
||||
}
|
||||
|
||||
$ncgroup = -1;
|
||||
|
||||
if (isset($_GET["refresh_module"])){ //Refresh module info from group combo
|
||||
$ncgroup = $_POST["ncgroup"];
|
||||
}
|
||||
|
||||
|
||||
if (isset($_GET["id_np"])){ // Read module data
|
||||
$id_np = $_GET["id_np"];
|
||||
if ($id_np != -1){
|
||||
$sql1="SELECT * FROM tnetwork_profile WHERE id_np = $id_np";
|
||||
$result=mysql_query($sql1);
|
||||
$row=mysql_fetch_array($result);
|
||||
$description = $row["description"];
|
||||
$name = $row["name"];
|
||||
} else {
|
||||
$comentarios = "";
|
||||
$name = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["create"])){ // Create module
|
||||
$name = entrada_limpia ($_POST["name"]);
|
||||
$description = entrada_limpia ($_POST["description"]);
|
||||
$sql_insert="INSERT INTO tnetwork_profile (name,description)
|
||||
VALUES ('$name', '$description')";
|
||||
$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_np = mysql_insert_id();
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["update"])){ // Update profile
|
||||
$id_np = $_GET["update"];
|
||||
$name = entrada_limpia ($_POST["name"]);
|
||||
$description = entrada_limpia ($_POST["description"]);
|
||||
$sql_insert="UPDATE tnetwork_profile set name = '$name', description = '$description' WHERE id_np = $id_np";
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result)
|
||||
echo "<h3 class='error'>".$lang_label["modify_no"]."</h3>";
|
||||
else {
|
||||
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "<h2>".$lang_label["network_profile_management"]."</h2>";
|
||||
echo "<table width='550' cellpadding='4' cellspacing='4'>";
|
||||
|
||||
if ($id_np == -1)
|
||||
echo '<form name="new_user" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&create=1"><tr><td class="lb" rowspan="4" width="3">';
|
||||
else
|
||||
echo '<form name="user_mod" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&update='.$id_np.'"><tr><td class="lb" rowspan="4" width="3">';
|
||||
|
||||
echo "<tr><td class='datos'>".$lang_label["name"];
|
||||
echo "<td class='datos'>";
|
||||
echo "<input type='text' size=25 name='name' value='$name'>";
|
||||
|
||||
echo "<tr><td class='datos2'>".$lang_label["description"];
|
||||
echo "<td class='datos2'>";
|
||||
echo "<textarea cols=50 rows=2 name='description'>";
|
||||
echo $description;
|
||||
echo "</textarea>";
|
||||
echo "</td></tr></table>";
|
||||
|
||||
if ($id_np != -1){
|
||||
// Show associated modules, allow to delete, and to add
|
||||
echo '<table width="550" cellpadding="4" cellspacing="4">';
|
||||
echo '<tr>';
|
||||
echo "<th>".$lang_label["module_name"];
|
||||
echo "<th>".$lang_label["type"];
|
||||
echo "<th>".$lang_label["description"];
|
||||
echo "<th>".$lang_label["nc.group"];
|
||||
echo "<th>X";
|
||||
$color =0;
|
||||
$sql1 = "SELECT * FROM tnetwork_profile_component where id_np = $id_np";
|
||||
$result = mysql_query ($sql1);
|
||||
while ( $row = mysql_fetch_array($result)) {
|
||||
$id_nc = $row["id_nc"];
|
||||
$id_npc = $row["id_npc"];
|
||||
$sql2 = "SELECT * FROM tnetwork_component where id_nc = $id_nc";
|
||||
$result2 = mysql_query ($sql2);
|
||||
if ($row2=mysql_fetch_array($result2)){
|
||||
if ($color == 1){
|
||||
$tdcolor="datos";
|
||||
$color =0;
|
||||
} else {
|
||||
$tdcolor="datos2";
|
||||
$color =1;
|
||||
}
|
||||
$id_tipo = $row2["type"];
|
||||
$id_group = $row2["id_group"];
|
||||
$nombre_modulo =$row2["name"];
|
||||
$descripcion = $row2["description"];
|
||||
$module_group2 = $row2["id_module_group"];
|
||||
|
||||
echo "<tr><td class='".$tdcolor."_id'>";
|
||||
echo $nombre_modulo;
|
||||
echo "<td class='".$tdcolor."f9'>";
|
||||
if ($id_tipo > 0) {
|
||||
echo "<img src='images/".show_icon_type($id_tipo)."' border=0>";
|
||||
}
|
||||
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'><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np=$id_np&delete_module=$id_npc'><img src='images/cancel.gif'></a></td>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
echo "<table width=550>";
|
||||
echo '<tr><td><div class="raya"></div></td></tr>';
|
||||
echo '<tr><td align="right" >';
|
||||
if ($id_np == -1)
|
||||
echo '<input name="crtbutton" type="submit" class="sub" value="'.$lang_label["create"].'">';
|
||||
else
|
||||
echo '<input name="crtbutton" type="submit" class="sub" value="'.$lang_label["update"].'">';
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
if ($id_np != -1){
|
||||
echo "<h3>"."Add module"."</h3>";
|
||||
echo "<table>";
|
||||
echo '<tr><td valign="top">';
|
||||
echo '<form name="add_module" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&add_module=1">';
|
||||
$sql1 = "SELECT * FROM tnetwork_component ORDER BY id_group";
|
||||
$result = mysql_query ($sql1);
|
||||
echo "<select name='component'>";
|
||||
while ($row = mysql_fetch_array($result)) {
|
||||
echo "<option value='" . $row["id_nc"] . "'>". $row["name"]." / ".give_network_component_group_name ($row["id_group"]);
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
echo '<td valign="top">';
|
||||
echo '<input name="crtbutton" type="submit" class="sub" value="'.$lang_label["add"].'">';
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,174 @@
|
|||
<?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
|
||||
// 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) || (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;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------
|
||||
// DELETE A RECON TASKs
|
||||
// --------------------------------
|
||||
if (isset($_GET["delete"])) {
|
||||
$id = entrada_limpia($_GET["delete"]);
|
||||
$sql = "DELETE FROM trecon_task WHERE id_rt = $id ";
|
||||
$result = mysql_query($sql);
|
||||
if ($result)
|
||||
echo "<h3 class='suc'>".$lang_label["delete_ok"]."</h3>";
|
||||
else
|
||||
echo "<h3 class='suc'>".$lang_label["delete_no"]."</h3>";
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------
|
||||
// UPDATE A RECON TASK
|
||||
// --------------------------------
|
||||
if (isset($_GET["update"])) {
|
||||
$id = entrada_limpia($_GET["update"]);
|
||||
$name = entrada_limpia($_POST["name"]);
|
||||
$network = entrada_limpia($_POST["network"]);
|
||||
$description = entrada_limpia($_POST["description"]);
|
||||
$id_server = entrada_limpia($_POST["id_server"]);
|
||||
$type = entrada_limpia($_POST["type"]);
|
||||
$server_assigned = entrada_limpia($_POST["server_assigned"]);
|
||||
$interval = entrada_limpia($_POST["interval"]);
|
||||
$id_group = entrada_limpia($_POST["id_group"]);
|
||||
$create_incident = entrada_limpia($_POST["create_incident"]);
|
||||
$id_network_profile = entrada_limpia($_POST["id_network_profile"]);
|
||||
$sql = "UPDATE trecon_task SET name = '".$name."', subnet = '".$network."', description='".$description."', type = $type, id_network_server = $id_server, create_incident = $create_incident, id_group = $id_group, interval_sweep = $interval, id_network_server_assigned = $server_assigned, id_network_profile = $id_network_profile WHERE id_rt = $id";
|
||||
$result=mysql_query($sql);
|
||||
if ($result)
|
||||
echo "<h3 class='suc'>".$lang_label["modify_ok"]."</h3>";
|
||||
else
|
||||
echo "<h3 class='suc'>".$lang_label["modify_no"]."</h3>";
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
// CREATE A RECON TASK
|
||||
// --------------------------------
|
||||
if (isset($_GET["create"])) {
|
||||
$name = entrada_limpia($_POST["name"]);
|
||||
$network = entrada_limpia($_POST["network"]);
|
||||
$description = entrada_limpia($_POST["description"]);
|
||||
$id_server = entrada_limpia($_POST["id_server"]);
|
||||
$type = entrada_limpia($_POST["type"]);
|
||||
$server_assigned = entrada_limpia($_POST["server_assigned"]);
|
||||
$interval = entrada_limpia($_POST["interval"]);
|
||||
$id_group = entrada_limpia($_POST["id_group"]);
|
||||
$create_incident = entrada_limpia($_POST["create_incident"]);
|
||||
$id_network_profile = entrada_limpia($_POST["id_network_profile"]);
|
||||
$sql = "INSERT INTO trecon_task (name, subnet, description, type, id_network_server, create_incident, id_group, id_network_server_assigned, id_network_profile, interval_sweep) VALUES ( '$name', '$network', '$description', $type, $id_server, $create_incident, $id_group, $server_assigned, $id_network_profile, $interval)";
|
||||
$result=mysql_query($sql);
|
||||
if ($result)
|
||||
echo "<h3 class='suc'>".$lang_label["create_ok"]."</h3>";
|
||||
else
|
||||
echo "<h3 class='suc'>".$lang_label["create_no"]."</h3>";
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
// SHOW TABLE WITH ALL RECON TASKs
|
||||
// --------------------------------
|
||||
echo "<h2>".$lang_label["manage_recontask"]."</h2>";
|
||||
$query="SELECT * FROM trecon_task";
|
||||
$result=mysql_query($query);
|
||||
$color=1;
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' witdh='750'>";
|
||||
echo "<tr><th class='datos'>".$lang_label["name"];
|
||||
echo "<th class='datos'>".$lang_label['type'];
|
||||
echo "<th class='datos'>".$lang_label['network'];
|
||||
echo "<th class='datos'>".$lang_label['network_profile'];
|
||||
echo "<th class='datos'>".$lang_label['group'];
|
||||
echo "<th class='datos'>".$lang_label['incident'];
|
||||
echo "<th class='datos'>".$lang_label['interval'];
|
||||
echo "<th class='datos'>".$lang_label['recon_server'];
|
||||
echo "<th class='datos'>".$lang_label['network_server'];
|
||||
echo "<th class='datos'>X";
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
$id_rt = $row["id_rt"];
|
||||
$name = $row["name"];
|
||||
$network = $row["subnet"];
|
||||
$description = $row["description"];
|
||||
$id_server = $row["server"];
|
||||
$type = $row["type"];
|
||||
$id_network_server = $row["id_network_server"];
|
||||
$interval = $row["interval_sweep"];
|
||||
$id_group = $row["id_group"];
|
||||
$create_incident = $row["create_incident"];
|
||||
$id_network_profile = $row["id_network_profile"];
|
||||
$id_network_server_assigned = $row["id_network_server_assigned"];
|
||||
if ($color == 1){
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
}
|
||||
else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
echo "<tr>";
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&update=$id_rt'><b>$name</b></A>";
|
||||
|
||||
echo "<td class='$tdcolor'>";
|
||||
if ($type ==1)
|
||||
echo "ICMP";
|
||||
|
||||
// Network
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo $network;
|
||||
|
||||
// Network profile name
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo "<a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates&id=$id_network_profile'>".give_network_profile_name($id_network_profile)."</a>";
|
||||
|
||||
// GROUP
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
echo "<img class='bot' src='images/groups_small/".show_icon_group($id_group).".png'>";
|
||||
// INCIDENT
|
||||
echo "<td class='$tdcolor'>";
|
||||
if ($create_incident == 1)
|
||||
echo $lang_label["yes"];
|
||||
else
|
||||
echo $lang_label["no"];
|
||||
// INTERVAL
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
echo $interval;
|
||||
// Recon server
|
||||
echo "<td class='$tdcolor'f9 >";
|
||||
echo "<a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server=$id_network_server'>".give_server_name($id_network_server)."</a>";
|
||||
// Network server assigned
|
||||
echo "<td class='$tdcolor'f9 >";
|
||||
echo "<a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server=$id_network_server_assigned'>".give_server_name($id_network_server_assigned)."</a>";;
|
||||
|
||||
// ACTION
|
||||
echo "<td class='".$tdcolor."' align='center'><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask&delete=$id_rt'><img src='images/cancel.gif' border='0'>";
|
||||
|
||||
}
|
||||
|
||||
echo '<tr><td colspan="12"><div class="raya"></div></td></tr>';
|
||||
echo "<tr><td align='right' colspan='11'>";
|
||||
echo "<form method='post' action='index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create'>";
|
||||
echo "<input type='submit' class='sub' name='crt'
|
||||
value='".$lang_label["create"]."'>";
|
||||
echo "</form></table>";
|
||||
|
||||
?>
|
|
@ -0,0 +1,187 @@
|
|||
<?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) || (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_rt = $_GET["update"];
|
||||
$query="SELECT * FROM trecon_task where id_rt = $id_rt";
|
||||
$result=mysql_query($query);
|
||||
$row=mysql_fetch_array($result);
|
||||
$name = $row["name"];
|
||||
$network = $row["subnet"];
|
||||
$description = $row["description"];
|
||||
$id_server = $row["server"];
|
||||
$type = $row["type"];
|
||||
$id_network_server = $row["id_network_server"];
|
||||
$interval = $row["interval_sweep"];
|
||||
$id_group = $row["id_group"];
|
||||
$create_incident = $row["create_incident"];
|
||||
$id_network_profile = $row["id_network_profile"];
|
||||
$id_network_server_assigned = $row["id_network_server_assigned"];
|
||||
|
||||
} elseif (isset($_GET["create"])){
|
||||
$id_rt = -1;
|
||||
$name = "";
|
||||
$network = "";
|
||||
$description = "";
|
||||
$id_server = 0;
|
||||
$type = 1;
|
||||
$id_network_server = 0;
|
||||
$interval = 43200;
|
||||
$id_group = 1;
|
||||
$create_incident = 1;
|
||||
$id_network_profile = 1;
|
||||
$id_network_server_assigned = 0;
|
||||
}
|
||||
|
||||
echo "<h2>".$lang_label["manage_recontask"]."</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_rt != -1)
|
||||
echo "<form name='modulo' method='post' action='index.php?sec=gservers&sec2=godmode/servers/manage_recontask&update=$id_rt'>";
|
||||
else
|
||||
echo "<form name='modulo' method='post' action='index.php?sec=gservers&sec2=godmode/servers/manage_recontask&create=1'>";
|
||||
echo "<tr><td class='lb' rowspan='8' width='5'>";
|
||||
|
||||
//name
|
||||
echo "<tr>";
|
||||
echo '<tr><td class="datos2">'.$lang_label["task_name"];
|
||||
echo "<td class='datos2'><input type='text' name='name' size='25' value='$name'>";
|
||||
//-- Recon server
|
||||
|
||||
echo "<td class='datos2'>".$lang_label["recon_server"];
|
||||
echo "<td class='datos2'>";
|
||||
echo '<select name="id_server">';
|
||||
echo "<option value='$id_network_server'>". give_server_name($id_network_server);
|
||||
$sql1="SELECT id_server, name FROM tserver WHERE recon_server = 1 ORDER BY name ";
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"];
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
// Network
|
||||
echo "<tr>";
|
||||
echo '<td class="datos">'.$lang_label["network"];
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="network" size="25" value="'.$network.'">';
|
||||
// Interval
|
||||
echo '<td class="datos">'.$lang_label["interval"];
|
||||
echo '<td class="datos">';
|
||||
echo "<select name='interval'>";
|
||||
if ($interval != 0){
|
||||
if ($interval < 43200)
|
||||
echo "<option value='$interval'>".($interval / 3600).$lang_label["hours"];
|
||||
else
|
||||
echo "<option value='$interval'>".($interval / 86400).$lang_label["days"];
|
||||
}
|
||||
echo "<option value='3600'>1 ".$lang_label["hour"];
|
||||
echo "<option value='7200'>2 ".$lang_label["hours"];
|
||||
echo "<option value='21600'>6 ".$lang_label["hours"];
|
||||
echo "<option value='43200'>1/2 ".$lang_label["day"];
|
||||
echo "<option value='86400'>1 ".$lang_label["day"];
|
||||
echo "<option value='432000'>5 ".$lang_label["days"];
|
||||
echo "<option value='604800'>1 ".$lang_label["week"];
|
||||
echo "<option value='1209600'>2 ".$lang_label["week"];
|
||||
echo "<option value='2592000'>1 ".$lang_label["month"];
|
||||
echo "</select>";
|
||||
|
||||
// Network profile
|
||||
echo "<tr>";
|
||||
echo "<td class='datos2'>".$lang_label["network_profile"];
|
||||
echo "<td class='datos2'>";
|
||||
echo "<select name='id_network_profile'>";
|
||||
echo "<option value='$id_network_profile'>".give_network_profile_name($id_network_profile);
|
||||
$sql1 = "SELECT * FROM tnetwork_profile where id_np != '$id_network_profile'";
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result))
|
||||
echo "<option value='".$row["id_np"]."'>".$row["name"];
|
||||
echo "</select>";
|
||||
//-- Network server
|
||||
echo "<td class='datos2'>".$lang_label["network_server"];
|
||||
echo "<td class='datos2'>";
|
||||
echo '<select name="server_assigned">';
|
||||
$sql1="SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name ";
|
||||
$result=mysql_query($sql1);
|
||||
echo "<option value='$id_network_server_assigned'>". give_server_name($id_network_server_assigned);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"];
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
// Group
|
||||
echo "<tr>";
|
||||
echo "<td class='datos'>".$lang_label["group"];
|
||||
echo "<td class='datos'>";
|
||||
echo "<select name='id_group'>";
|
||||
echo "<option value='$id_group'>".dame_nombre_grupo($id_group);
|
||||
$sql1 = "SELECT * FROM tgrupo where id_grupo != $id_group";
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result))
|
||||
echo "<option value='".$row["id_grupo"]."'>".$row["nombre"];
|
||||
echo "</select>";
|
||||
|
||||
// TYPE
|
||||
echo "<td class='datos'>".$lang_label["type"];
|
||||
echo "<td class='datos'>";
|
||||
echo "<select name='type'>";
|
||||
echo "<option value='1'>ICMP";
|
||||
echo "</select>";
|
||||
|
||||
// Incident
|
||||
echo "<tr>";
|
||||
echo "<td class='datos2'>".$lang_label["incident"];
|
||||
echo "<td class='datos2'>";
|
||||
echo "<select name='create_incident'>";
|
||||
if ($type == 1){
|
||||
echo "<option value='1'>".$lang_label["yes"];
|
||||
echo "<option value='0'>".$lang_label["no"];
|
||||
}
|
||||
else {
|
||||
echo "<option value='0'>".$lang_label["no"];
|
||||
echo "<option value='1'>".$lang_label["yes"];
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<td class='datos2' colspan=2> </td></tr>";
|
||||
|
||||
echo '<tr><td class="datost">'.$lang_label["comments"];
|
||||
echo '<td class="datos" colspan=3>';
|
||||
echo '<textarea name="description" 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_rt != "-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>";
|
||||
|
||||
?>
|
|
@ -102,7 +102,7 @@ if (comprueba_login() == 0) {
|
|||
echo "<th class='datos'>".$lang_label['checksum'];
|
||||
echo "<th class='datos'>".$lang_label['laststart'];
|
||||
echo "<th class='datos'>".$lang_label['lastupdate'];
|
||||
echo "<th class='datos'>".$lang_label['action'];
|
||||
echo "<th class='datos'>".$lang_label['delete'];
|
||||
$color=1;
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
$name = $row["name"];
|
||||
|
@ -127,7 +127,7 @@ if (comprueba_login() == 0) {
|
|||
$color = 1;
|
||||
}
|
||||
echo "<tr><td class='$tdcolor'>";
|
||||
echo "<b>$name</b>";
|
||||
echo "<a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server=".$id_server."'><b>$name</b></a>";
|
||||
echo "<td class='$tdcolor' align='middle'>";
|
||||
if ($status ==0){
|
||||
echo "<img src='images/dot_red.gif'>";
|
||||
|
@ -159,7 +159,7 @@ if (comprueba_login() == 0) {
|
|||
}
|
||||
echo "<td class='".$tdcolor."f9' align='middle'>".substr($keepalive,0,25);
|
||||
echo "<td class='".$tdcolor."f9' align='middle'>".substr($laststart,0,25);
|
||||
echo "<td class='".$tdcolor."f9' align='middle'><a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server=".$id_server."'><img src='images/config.gif' border='0'></a> <a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server_del=".$id_server."&delete'><img src='images/cancel.gif' border='0'>";
|
||||
echo "<td class='".$tdcolor."f9' align='middle'><a href='index.php?sec=gserver&sec2=godmode/servers/modificar_server&server_del=".$id_server."&delete'><img src='images/cancel.gif' border='0'>";
|
||||
}
|
||||
echo '<tr><td colspan="12"><div class="raya"></div></td></tr></table>';
|
||||
}
|
||||
|
|
|
@ -898,4 +898,19 @@ function give_network_component_group_name ($id){
|
|||
return $pro;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Return network profile name name given its ID
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
function give_network_profile_name ($id_np){
|
||||
require("config.php");
|
||||
$query1="SELECT * FROM tnetwork_profile WHERE id_np= ".$id_np;
|
||||
$resq1=mysql_query($query1);
|
||||
if ($rowdup=mysql_fetch_array($resq1))
|
||||
$pro=$rowdup["name"];
|
||||
else
|
||||
$pro = "";
|
||||
return $pro;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -707,6 +707,26 @@ $lang_label["setup_mode"]="Setup mode";
|
|||
$lang_label["refresh_data"]="Refresh data";
|
||||
$lang_label["lag"]="LAG";
|
||||
$lang_label["N/A"]="N/A";
|
||||
$lang_label["done"]="Done";
|
||||
$lang_label["pending"]="Pending";
|
||||
$lang_label['progress']="Progress";
|
||||
$lang_label['task_name']="Task name";
|
||||
$lang_label["days"]="days";
|
||||
$lang_label["day"]="day";
|
||||
$lang_label["week"]="week";
|
||||
$lang_label["weeks"]="weeks";
|
||||
$lang_label["month"]="month";
|
||||
$lang_label["months"]="monts";
|
||||
$lang_label["hours"]="hours";
|
||||
$lang_label["hour"]="hour";
|
||||
$lang_label['network_profile']="Network profile";
|
||||
$lang_label["manage_recontask"]="Manage recontask";
|
||||
$lang_label["yes"]="Yes";
|
||||
$lang_label["no"]="No";
|
||||
$lang_label["view"]="View";
|
||||
$lang_label["number_of_modules"]="# Modules";
|
||||
$lang_label["network_profile_management"]="Network profile management";
|
||||
|
||||
global $lang_label;
|
||||
global $help_label;
|
||||
?>
|
|
@ -45,9 +45,9 @@ if ($develop_bypass != 1){
|
|||
}
|
||||
// Check perms for config.php
|
||||
if ((substr(sprintf('%o', fileperms('include/config.php')), -4) != "0600") &&
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0660") &&
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0640") &&
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0600"))
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0660") &&
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0640") &&
|
||||
(substr(sprintf('%o', fileperms('include/config.php')), -4) != "0600"))
|
||||
{
|
||||
include "general/error_perms.php";
|
||||
exit;
|
||||
|
@ -184,7 +184,7 @@ if (isset ($_GET["refr"])){
|
|||
<div id="menu"><?php require ("general/main_menu.php"); ?></div>
|
||||
<div id="main">
|
||||
<div id='head'><?php require("general/header.php"); ?></div>
|
||||
<div style='height: 40px'> </div>
|
||||
<!-- <div style='height: 10px'> </div> -->
|
||||
<div class='data_box'>
|
||||
|
||||
<?php
|
||||
|
@ -195,9 +195,9 @@ if (isset ($_GET["refr"])){
|
|||
} else {
|
||||
echo "<br><b class='error'>Sorry! I can't find the page!</b>";
|
||||
}
|
||||
} elseif (isset ($_GET["sec"])) {
|
||||
} else
|
||||
require ("general/logon_ok.php"); //default
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@ echo "
|
|||
<img src='images/b_red.gif'> - ".$lang_label["red_light"]."</td>
|
||||
<td class='f9i'>
|
||||
<img src='images/b_yellow.gif'> - ".$lang_label["yellow_light"]."</td>
|
||||
<td class='f9l'>
|
||||
<td class='f9i'>
|
||||
<img src='images/dot_red.gif'> - ".$lang_label["fired"]."</td>
|
||||
<tr><td class='f9i'>
|
||||
<img src='images/b_white.gif'> - ".$lang_label["no_light"]."</td>
|
||||
|
|
|
@ -280,7 +280,7 @@ if (comprueba_login() == 0) {
|
|||
if ($biginterval > 0){
|
||||
$percentil = round($diferencia/(($biginterval*2) / 100));
|
||||
} else {
|
||||
echo "N/A";
|
||||
$percentil = -1;
|
||||
}
|
||||
echo "<a href='#' class='info2'>
|
||||
<img src='reporting/fgraph.php?tipo=progress&percent=".
|
||||
|
|
|
@ -101,7 +101,7 @@ if (comprueba_login() == 0) {
|
|||
echo '<tr>
|
||||
<td class="datos2"><b>'.salida_limpia($lang_label["group"]).'</b></td>
|
||||
<td class="datos2" colspan="2">
|
||||
<img class="bot" src="images/groups_small/'.show_icon_group($row["id_grupo"]).'.png" > '.dame_grupo($id_grupo).'</td></tr>';
|
||||
<img class="bot" src="images/groups_small/'.show_icon_group($row["id_grupo"]).'.png" > '.dame_grupo($id_grupo).'<br>'.dame_grupo($id_group).'</td></tr>';
|
||||
if ($agent_type == 0) {
|
||||
echo '<tr><td class="datos"><b>'.$lang_label["agentversion"].'</b>
|
||||
<td class="datos" colspan=2>'.salida_limpia($agent_version).'</td>';
|
||||
|
@ -192,7 +192,7 @@ if (comprueba_login() == 0) {
|
|||
</td></tr>
|
||||
</table></td></tr>
|
||||
</table>
|
||||
<div style='height:40px'> </div>";
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -96,14 +96,15 @@ if (comprueba_login() == 0) {
|
|||
switch ($tab) {
|
||||
/* http://pandora.localhost/index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=600 */
|
||||
case "manage": require "estado_generalagente.php";
|
||||
echo "<br>";
|
||||
break;
|
||||
|
||||
case "main": require "estado_generalagente.php";
|
||||
require "estado_monitores.php";
|
||||
|
||||
break;
|
||||
|
||||
case "data": require "estado_ultimopaquete.php";
|
||||
break;
|
||||
|
||||
case "alert": require "estado_alertas.php";
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,10 @@ if (comprueba_login() == 0) {
|
|||
}
|
||||
|
||||
echo "<tr><td class='$tdcolor'>";
|
||||
echo "<b><a href='index.php?sec=estado_server&sec2=operation/servers/view_server_detail&server_id=$id_server'>$name</a></b> ";
|
||||
if ($recon_server == 1)
|
||||
echo "<b><a href='index.php?sec=estado_server&sec2=operation/servers/view_server_detail&server_id=$id_server'>$name</a></b> ";
|
||||
else
|
||||
echo "<b>$name</b>";
|
||||
echo "<td class='$tdcolor' align='middle'>";
|
||||
if ($status ==0){
|
||||
echo "<img src='images/dot_red.gif'>";
|
||||
|
@ -126,28 +129,63 @@ if (comprueba_login() == 0) {
|
|||
$percentil = $modules_server / ($total_modules_data / 100);
|
||||
$total_modules_temp = $total_modules_data;
|
||||
}
|
||||
} elseif ($recon_server == 1){
|
||||
|
||||
$sql2 = "SELECT COUNT(id_rt) FROM trecon_task WHERE id_network_server = $id_server";
|
||||
$result2=mysql_query($sql2);
|
||||
$row2=mysql_fetch_array($result2);
|
||||
$modules_server = $row2[0];
|
||||
|
||||
$sql2 = "SELECT COUNT(id_rt) FROM trecon_task";
|
||||
$result2=mysql_query($sql2);
|
||||
$row2=mysql_fetch_array($result2);
|
||||
$total_modules = $row2[0];
|
||||
if ($total_modules == 0)
|
||||
$percentil = 0;
|
||||
$percentil = $modules_server / ($total_modules / 100);
|
||||
$total_modules_temp = $total_modules;
|
||||
}
|
||||
else
|
||||
echo "-";
|
||||
|
||||
if (($network_server == 1) OR ($data_server == 1) OR ($recon_server == 1))
|
||||
// Progress bar render
|
||||
echo '<img src="reporting/fgraph.php?tipo=progress&percent='.$percentil.'&height=20&width=100">';
|
||||
} else
|
||||
echo "-";
|
||||
|
||||
// Number of modules
|
||||
echo "<td class='$tdcolor'>";
|
||||
if (($network_server == 1) OR ($data_server == 1))
|
||||
if (($recon_server ==1) OR ($network_server == 1) OR ($data_server == 1))
|
||||
echo $modules_server . " / ". $total_modules_temp;
|
||||
else
|
||||
echo "-";
|
||||
|
||||
// LAG CHECK
|
||||
echo "<td class='$tdcolor'>";
|
||||
// Calculate lag: get oldest module, for this server,
|
||||
// Calculate lag: get oldest module of any proc_type, 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' ";
|
||||
$sql1 = "SELECT utimestamp, current_interval FROM tagente_estado WHERE processed_by_server = '$name' AND estado < 100";
|
||||
$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"]);
|
||||
$maxlag2 = $nowtime - ($row1["utimestamp"] + $row1["current_interval"]);
|
||||
if ($maxlag2 > $maxlag)
|
||||
$maxlag = $maxlag2;
|
||||
}
|
||||
echo $maxlag." sec";
|
||||
} elseif ($recon_server == 1) {
|
||||
$sql1 = "SELECT * FROM trecon_task WHERE id_network_server = $id_server";
|
||||
$result1=mysql_query($sql1);
|
||||
$nowtime = time();
|
||||
$maxlag=0;
|
||||
while ($row1=mysql_fetch_array($result1)){
|
||||
if (($row1["utimestamp"] + $row1["interval"]) < $nowtime)
|
||||
$maxlag2 = $nowtime - ($row1["utimestamp"] + $row1["interval"]);
|
||||
if ($maxlag2 > $maxlag)
|
||||
$maxlag = $maxlag2;
|
||||
}
|
||||
echo $maxlag." sec";
|
||||
} else
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
// Pandora - the Free monitoring system
|
||||
// ====================================
|
||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
||||
|
||||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
$modules_server = 0;
|
||||
$total_modules = 0;
|
||||
$total_modules_data = 0;
|
||||
|
||||
if ((comprueba_login() == 0) AND (give_acl($id_user, 0, "AR")==1) ) {
|
||||
|
||||
// --------------------------------
|
||||
// FORCE A RECON TASK
|
||||
// --------------------------------
|
||||
if (give_acl($id_user, 0, "PM")==1){
|
||||
if (isset($_GET["force"])) {
|
||||
$id = entrada_limpia($_GET["force"]);
|
||||
$sql = "UPDATE trecon_task set utimestamp = 0, status = -1 WHERE id_rt = $id ";
|
||||
$result = mysql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$id_server = $_GET["server_id"];
|
||||
$sql = "SELECT * FROM tserver where id_server = $id_server";
|
||||
$result=mysql_query($sql);
|
||||
$row=mysql_fetch_array($result);
|
||||
$server_name = $row["name"];
|
||||
$id_server = $row[0];
|
||||
|
||||
echo "<h2>".$lang_label["server_detail"]." - $server_name </h2>";
|
||||
// Show network tasks for Recon Server
|
||||
if ($row["recon_server"]){
|
||||
$sql = "SELECT * FROM trecon_task where id_network_server = $id_server";
|
||||
// Connect DataBase
|
||||
$result=mysql_query($sql);
|
||||
if (mysql_num_rows($result)){
|
||||
echo "<table cellpadding='4' cellspacing='4' withd='800'>";
|
||||
echo "<tr><th class='datos'><th class='datos'>".$lang_label["task_name"]."</th>";
|
||||
echo "<th class='datos'>".$lang_label['interval']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['network']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['type']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['status']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['network_profile']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['group']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['progress']."</th>";
|
||||
echo "<th class='datos'>".$lang_label['lastupdate']."</th>";
|
||||
echo "<th class='datos'></th>";
|
||||
$color=1;
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
if ($color == 1){
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
}
|
||||
else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
$id_rt = $row["id_rt"];
|
||||
$name = $row["name"];
|
||||
$status = $row["status"];
|
||||
$utimestamp = $row["utimestamp"];
|
||||
$interval = $row["interval_sweep"];
|
||||
$create_incident = $row["create_incident"];
|
||||
$id_network_server_assigned = $row["id_network_server_assigned"];
|
||||
$subnet = $row["subnet"];
|
||||
$id_group = $row["id_group"];
|
||||
$id_network_profile = $row["id_network_profile"];
|
||||
$type = $row["type"];
|
||||
echo "<tr>";
|
||||
// Name
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo "<a href='index.php?sec=estado_server&sec2=operation/servers/view_server_detail&server_id=$id_server&force=$id_rt'><img src='images/target.gif' border='0'></A>";
|
||||
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo "<b>$name</b>";
|
||||
// Interval
|
||||
echo "<td class='$tdcolor'>";
|
||||
if ($interval != 0){
|
||||
if ($interval < 43200)
|
||||
echo "~ ".floor ($interval / 3600)." ".$lang_label["hours"];
|
||||
else
|
||||
echo "~ ".floor ($interval / 86400)." ".$lang_label["days"];
|
||||
} else
|
||||
echo $interval;
|
||||
|
||||
// Subnet
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo $subnet;
|
||||
// Type
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
if ($type == 1){
|
||||
echo "ICMP";
|
||||
}
|
||||
elseif ($type == 2){
|
||||
echo "SNMP";
|
||||
}
|
||||
// status
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
if ($status == -1)
|
||||
echo $lang_label["done"];
|
||||
else
|
||||
echo $lang_label["pending"];
|
||||
// Network profile
|
||||
echo "<td class='$tdcolor'>";
|
||||
echo give_network_profile_name($id_network_profile);
|
||||
|
||||
// Group
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
echo "<img class='bot' src='images/groups_small/".show_icon_group($id_group).".png'>";
|
||||
|
||||
// Progress
|
||||
echo "<td class='$tdcolor' align='center'>";
|
||||
if ($status < 0)
|
||||
echo "-";
|
||||
else
|
||||
echo '<img src="reporting/fgraph.php?tipo=progress&percent='.$status.'&height=20&width=100">';
|
||||
|
||||
// Last execution
|
||||
echo "<td class='".$tdcolor."f9' >";
|
||||
$keepalive = strftime ( "%m/%d/%y %H:%M:%S" , $utimestamp );
|
||||
echo substr($keepalive,0,25)."</td>";
|
||||
|
||||
echo "<td class='$tdcolor'>";
|
||||
if (give_acl($id_user, 0, "PM")==1){
|
||||
echo "<a href='http://pandora.localhost/index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&update=$id_rt'>";
|
||||
echo "<img src='../images/wrench_orange.png'></A>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue