mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-9701-incorrect-non-dataserver-lag-calculation' into 'develop'
Fix non dataserver lag calculation See merge request artica/pandorafms!5540
This commit is contained in:
commit
83860a9e5c
@ -5628,16 +5628,26 @@ sub pandora_server_statistics ($$) {
|
|||||||
# Non-dataserver LAG calculation:
|
# Non-dataserver LAG calculation:
|
||||||
if ($server->{"server_type"} != DATASERVER){
|
if ($server->{"server_type"} != DATASERVER){
|
||||||
|
|
||||||
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag
|
$lag_row = get_db_single_row ($dbh,
|
||||||
FROM tagente_estado, tagente_modulo
|
"SELECT COUNT(tam.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
|
||||||
WHERE utimestamp > 0
|
FROM (
|
||||||
|
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
|
||||||
|
FROM tagente_estado
|
||||||
|
WHERE tagente_estado.current_interval > 0
|
||||||
|
AND tagente_estado.last_execution_try > 0
|
||||||
|
AND tagente_estado.running_by = ?
|
||||||
|
) tae
|
||||||
|
JOIN (
|
||||||
|
SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag
|
||||||
|
FROM tagente_modulo LEFT JOIN tagente
|
||||||
|
ON tagente_modulo.id_agente = tagente.id_agente
|
||||||
|
WHERE tagente.disabled = 0
|
||||||
AND tagente_modulo.disabled = 0
|
AND tagente_modulo.disabled = 0
|
||||||
AND tagente_modulo.id_tipo_modulo < 5
|
AND tagente_modulo.id_tipo_modulo < 5
|
||||||
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
) tam
|
||||||
AND current_interval > 0
|
ON tae.id_agente_modulo = tam.id_agente_modulo
|
||||||
AND (UNIX_TIMESTAMP() - utimestamp) < ( current_interval * 10)
|
WHERE (UNIX_TIMESTAMP() - tae.last_execution_try) < ( tae.current_interval * 10)
|
||||||
AND running_by = ?
|
AND (tam.flag = 1 OR (UNIX_TIMESTAMP() - tae.last_execution_try) > tae.current_interval)", $server->{"id_server"});
|
||||||
AND (UNIX_TIMESTAMP() - utimestamp) > (current_interval * 1.1)", $server->{"id_server"});
|
|
||||||
}
|
}
|
||||||
# Dataserver LAG calculation:
|
# Dataserver LAG calculation:
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user