";
if ($recon_server == 1)
echo "$name ";
else
echo "$name";
echo " | ";
if ($status ==0){
echo "";
} else {
echo "";
}
echo " | ";
if (($network_server == 1) OR ($data_server == 1)){
// Progress bar calculations
if ($network_server == 1){
if ($total_modules == 0)
$percentil = 0;
if ($total_modules > 0)
$percentil = $modules_server / ($total_modules / 100);
else
$percentil = 0;
$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;
}
} 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;
else
$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 '';
// Number of modules
echo " | ";
if (($recon_server ==1) OR ($network_server == 1) OR ($data_server == 1))
echo $modules_server . " / ". $total_modules_temp;
else
echo "-";
// LAG CHECK
echo " | ";
// 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' AND estado < 100";
$nowtime = time();
$maxlag=0;
if ($result1=mysql_query($sql1))
while ($row1=mysql_fetch_array($result1)){
if (($row1["utimestamp"] + $row1["current_interval"]) < $nowtime)
$maxlag2 = $nowtime - ($row1["utimestamp"] + $row1["current_interval"]);
if ($maxlag2 > $maxlag)
$maxlag = $maxlag2;
}
if ($maxlag < 60)
echo $maxlag." sec";
elseif ($maxlag < 86400)
echo format_numeric($maxlag/60) . " min";
elseif ($maxlag > 86400)
echo "+1 ".$lang_label["day"];
} elseif ($recon_server == 1) {
$sql1 = "SELECT * FROM trecon_task WHERE id_network_server = $id_server";
$result1=mysql_query($sql1);
$nowtime = time();
$maxlag=0;$maxlag2=0;
while ($row1=mysql_fetch_array($result1)){
if (($row1["utimestamp"] + $row1["interval_sweep"]) < $nowtime){
$maxlag2 = $nowtime - ($row1["utimestamp"] + $row1["interval_sweep"]);
if ($maxlag2 > $maxlag)
$maxlag = $maxlag2;
}
}
if ($maxlag < 60)
echo $maxlag." sec";
elseif ($maxlag < 86400)
echo format_numeric($maxlag/60) . " min";
elseif ($maxlag > 86400)
echo "+1 ".$lang_label["day"];
} else
echo "--";
echo " | ".substr($description,0,25);
echo " | ";
if ($network_server == 1){
echo " ";
}
if ($data_server == 1){
echo " ";
}
if ($snmp_server == 1){
echo " ";
}
if ($recon_server == 1){
echo " ";
}
if ($master == 1){
echo " ";
}
if ($checksum == 1){
echo " ";
}
//echo " | "
//.substr($laststart,0,25)." | ";
echo "";
echo $version;
echo " | ";
// if ($status ==0)
echo substr($keepalive,0,25)." | ";
}
echo '