mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2008-07-08 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Basic support for async modules. General stats (tactical), do not shown async modules as uknown anymore. * operation/agentes/estado_agente.php, operation/agentes/estado_ultimopaquete.php: Support for async modules. * godmode/agentes/modificar_agente.php: Fixed stupid bug in search field in last commit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@943 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dae75937fb
commit
54263a3a1a
@ -1,5 +1,14 @@
|
|||||||
2008-07-08 Sancho Lerena <slerena@artica.es>
|
2008-07-08 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
|
* include/functions_reporting.php: Basic support for async modules.
|
||||||
|
General stats (tactical), do not shown async modules as uknown anymore.
|
||||||
|
|
||||||
|
* operation/agentes/estado_agente.php,
|
||||||
|
operation/agentes/estado_ultimopaquete.php: Support for async modules.
|
||||||
|
|
||||||
|
* godmode/agentes/modificar_agente.php: Fixed stupid bug in search
|
||||||
|
field in last commit.
|
||||||
|
|
||||||
* operation/reporting/graph_viewer.php: Added controls to view in the
|
* operation/reporting/graph_viewer.php: Added controls to view in the
|
||||||
new combined graphic mode (lines), and to change size to three pre-
|
new combined graphic mode (lines), and to change size to three pre-
|
||||||
defined sizes.
|
defined sizes.
|
||||||
|
@ -158,7 +158,7 @@ echo "</form>";
|
|||||||
echo "</td></table>";
|
echo "</td></table>";
|
||||||
|
|
||||||
if ($search != ""){
|
if ($search != ""){
|
||||||
$search_sql = " AND nombre LIKE '%$search%' ";
|
$search_sql = " nombre LIKE '%$search%' ";
|
||||||
} else {
|
} else {
|
||||||
$search_sql = " 1 = 1";
|
$search_sql = " 1 = 1";
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ function general_stats ($id_user, $id_group = 0) {
|
|||||||
$existen_agentes = 1;
|
$existen_agentes = 1;
|
||||||
|
|
||||||
// SQL Join to get monitor status for agents belong this group
|
// SQL Join to get monitor status for agents belong this group
|
||||||
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo FROM tagente, tagente_estado, tagente_modulo WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 ";
|
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo, tagente_modulo.id_tipo_modulo FROM tagente, tagente_estado, tagente_modulo WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 ";
|
||||||
if ($result1 = mysql_query ($sql1)){
|
if ($result1 = mysql_query ($sql1)){
|
||||||
while ($row1 = mysql_fetch_array ($result1)) {
|
while ($row1 = mysql_fetch_array ($result1)) {
|
||||||
$id_agente = $row1[0];
|
$id_agente = $row1[0];
|
||||||
@ -145,6 +145,11 @@ function general_stats ($id_user, $id_group = 0) {
|
|||||||
$utimestamp = $row1[4];
|
$utimestamp = $row1[4];
|
||||||
$seconds = $ahora_sec - $utimestamp;
|
$seconds = $ahora_sec - $utimestamp;
|
||||||
$id_agente_modulo = $row1[5];
|
$id_agente_modulo = $row1[5];
|
||||||
|
$module_type = $row1[6];
|
||||||
|
if (($module_type < 21) OR ($module_type == 100))
|
||||||
|
$async = 0;
|
||||||
|
else
|
||||||
|
$async = 1;
|
||||||
if ($estado != 100){
|
if ($estado != 100){
|
||||||
// Monitor check
|
// Monitor check
|
||||||
$monitor_checks++;
|
$monitor_checks++;
|
||||||
@ -172,7 +177,7 @@ function general_stats ($id_user, $id_group = 0) {
|
|||||||
// Data check
|
// Data check
|
||||||
if ($utimestamp == 0)
|
if ($utimestamp == 0)
|
||||||
$data_not_init++;
|
$data_not_init++;
|
||||||
elseif ($seconds >= ($module_interval*2))
|
elseif (($seconds >= ($module_interval*2)) AND ($async == 0))
|
||||||
$data_unknown++;
|
$data_unknown++;
|
||||||
$data_checks++;
|
$data_checks++;
|
||||||
// Alert
|
// Alert
|
||||||
|
@ -184,6 +184,8 @@ if (mysql_num_rows($result)){
|
|||||||
$est_modulo = $row_t["estado"];
|
$est_modulo = $row_t["estado"];
|
||||||
$ultimo_contacto_modulo = $row_t["timestamp"];
|
$ultimo_contacto_modulo = $row_t["timestamp"];
|
||||||
$module_interval = $row_t["module_interval"];
|
$module_interval = $row_t["module_interval"];
|
||||||
|
$module_type = $row_t["id_tipo_modulo"];
|
||||||
|
|
||||||
if ($module_interval > $biginterval)
|
if ($module_interval > $biginterval)
|
||||||
$biginterval = $module_interval;
|
$biginterval = $module_interval;
|
||||||
if ($module_interval !=0)
|
if ($module_interval !=0)
|
||||||
@ -194,11 +196,16 @@ if (mysql_num_rows($result)){
|
|||||||
$seconds = strtotime($ahora) - strtotime($ultimo_contacto_modulo);
|
$seconds = strtotime($ahora) - strtotime($ultimo_contacto_modulo);
|
||||||
else
|
else
|
||||||
$seconds = -1;
|
$seconds = -1;
|
||||||
|
if (($module_type < 21) OR ($module_type == 100)){
|
||||||
|
$async = 0;
|
||||||
|
} else {
|
||||||
|
$async = 1;
|
||||||
|
}
|
||||||
# Defines if Agent is down (interval x 2 > time last contact
|
# Defines if Agent is down (interval x 2 > time last contact
|
||||||
if ($seconds >= ($intervalo_comp*2)){ // If (intervalx2) secs. ago we don't get anything, show alert
|
if ($seconds >= ($intervalo_comp*2)){ // If (intervalx2) secs. ago we don't get anything, show alert
|
||||||
if ($est_modulo != 100)
|
if ($est_modulo != 100)
|
||||||
$numero_monitor++;
|
$numero_monitor++;
|
||||||
|
if ($async == 0)
|
||||||
$monitor_down++;
|
$monitor_down++;
|
||||||
}
|
}
|
||||||
elseif ($est_modulo != 100) { // estado=100 are data modules
|
elseif ($est_modulo != 100) { // estado=100 are data modules
|
||||||
|
@ -189,6 +189,9 @@ if (mysql_num_rows ($result3)) {
|
|||||||
echo $lang_label["never"];
|
echo $lang_label["never"];
|
||||||
} else {
|
} else {
|
||||||
$ahora = time();
|
$ahora = time();
|
||||||
|
if (($row3["id_tipo_modulo"] > 20) AND ($row3["id_tipo_modulo"] < 100)){
|
||||||
|
echo human_time_comparation($row3["timestamp"]);
|
||||||
|
} else {
|
||||||
if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) {
|
if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) {
|
||||||
echo "<font color='red'>";
|
echo "<font color='red'>";
|
||||||
echo human_time_comparation($row3["timestamp"]);
|
echo human_time_comparation($row3["timestamp"]);
|
||||||
@ -196,6 +199,7 @@ if (mysql_num_rows ($result3)) {
|
|||||||
} else
|
} else
|
||||||
echo human_time_comparation($row3["timestamp"]);
|
echo human_time_comparation($row3["timestamp"]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user