mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#9678 Fixed _time_down_human_ and _time_down_seconds_
This commit is contained in:
parent
a8902fed18
commit
f9b2c9a243
@ -1299,13 +1299,17 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
|
|||||||
$group = get_db_single_row ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo = ?', $agent->{'id_grupo'});
|
$group = get_db_single_row ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo = ?', $agent->{'id_grupo'});
|
||||||
}
|
}
|
||||||
|
|
||||||
my $agent_status;
|
my $time_down;
|
||||||
if(ref ($module) eq "HASH") {
|
if ($alert_mode == RECOVERED_ALERT && defined($extra_macros->{'_modulelaststatuschange_'})) {
|
||||||
$agent_status = get_db_single_row ($dbh, 'SELECT * FROM tagente_estado WHERE id_agente_modulo = ?', $module->{'id_agente_modulo'});
|
$time_down = (time() - $extra_macros->{'_modulelaststatuschange_'});
|
||||||
|
} else {
|
||||||
|
my $agent_status;
|
||||||
|
if(ref ($module) eq "HASH") {
|
||||||
|
$agent_status = get_db_single_row ($dbh, 'SELECT * FROM tagente_estado WHERE id_agente_modulo = ?', $module->{'id_agente_modulo'});
|
||||||
|
}
|
||||||
|
$time_down = (defined ($agent_status)) ? (time() - $agent_status->{'last_status_change'}) : undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $time_down = (defined ($agent_status)) ? (time() - $agent_status->{'last_status_change'}) : undef;
|
|
||||||
|
|
||||||
if (is_numeric($data)) {
|
if (is_numeric($data)) {
|
||||||
my $data_precision = $pa_config->{'graph_precision'};
|
my $data_precision = $pa_config->{'graph_precision'};
|
||||||
$data = sprintf("%.$data_precision" . "f", $data);
|
$data = sprintf("%.$data_precision" . "f", $data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user