2007-03-19 20:39:40 +01:00
|
|
|
<?php
|
|
|
|
|
2008-01-10 17:40:00 +01:00
|
|
|
// Pandora FMS - the Free Monitoring System
|
|
|
|
// ========================================
|
|
|
|
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.com
|
|
|
|
// Main PHP/SQL code development, project architecture and management.
|
|
|
|
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
|
|
|
// CSS and some PHP code additions
|
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
2007-03-19 20:39:40 +01:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-19 02:24:05 +02:00
|
|
|
$id_server = get_parameter ("server_id", -1);
|
2007-03-19 20:39:40 +01:00
|
|
|
$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];
|
|
|
|
|
2008-06-19 02:24:05 +02:00
|
|
|
echo "<h2>".$lang_label["server_detail"]." - $server_name ";
|
|
|
|
echo " ";
|
|
|
|
echo "<a href='index.php?sec=estado_server&sec2=operation/servers/view_server_detail&server_id=$id_server'>";
|
|
|
|
echo "<img src='images/refresh.png'>";
|
|
|
|
echo "</A>";
|
|
|
|
echo "</h2>";
|
2007-03-19 20:39:40 +01:00
|
|
|
// 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)){
|
2008-06-19 02:24:05 +02:00
|
|
|
echo "<table cellpadding='4' cellspacing='4' width='760' class='databox'>";
|
2007-03-19 20:39:40 +01:00
|
|
|
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'>";
|
2007-06-27 19:45:42 +02:00
|
|
|
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.png' border='0'></a>";
|
2007-03-19 20:39:40 +01:00
|
|
|
|
|
|
|
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){
|
2008-06-19 02:24:05 +02:00
|
|
|
echo "TCP Port";
|
2007-03-19 20:39:40 +01:00
|
|
|
}
|
|
|
|
// 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
|
2007-06-27 19:45:42 +02:00
|
|
|
echo "<td class='".$tdcolor."f9'>";
|
2007-03-19 20:39:40 +01:00
|
|
|
$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){
|
2007-04-18 18:48:38 +02:00
|
|
|
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&update=$id_rt'>";
|
2007-06-27 19:45:42 +02:00
|
|
|
echo "<img src='images/wrench_orange.png'></a>";
|
2007-03-19 20:39:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</table>";
|
2007-12-17 00:56:31 +01:00
|
|
|
} else {
|
|
|
|
echo "This server has no recon tasks assigned";
|
2007-03-19 20:39:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-04-18 18:48:38 +02:00
|
|
|
?>
|