2010-02-19 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Enabled FF protection for module states (not just events). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2388 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a003fd22e4
commit
24d57bbcbf
|
@ -1,3 +1,8 @@
|
||||||
|
2010-02-19 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm: Enabled FF protection for module states
|
||||||
|
(not just events).
|
||||||
|
|
||||||
2010-02-19 Sancho Lerena <slerena@artica.es>
|
2010-02-19 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Added comments to new statistical functions.
|
* lib/PandoraFMS/Core.pm: Added comments to new statistical functions.
|
||||||
|
|
|
@ -693,25 +693,32 @@ sub pandora_process_module ($$$$$$$$$;$) {
|
||||||
pandora_update_module_on_error ($pa_config, $module->{'id_agente_modulo'}, $dbh);
|
pandora_update_module_on_error ($pa_config, $module->{'id_agente_modulo'}, $dbh);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
my $last_status = $agent_status->{'last_status'};
|
||||||
|
my $status = $agent_status->{'estado'};
|
||||||
|
my $status_changes = $agent_status->{'status_changes'};
|
||||||
|
|
||||||
# Get current status
|
# Get new status
|
||||||
my $status = get_module_status ($processed_data, $module, $module_type);
|
my $new_status = get_module_status ($processed_data, $module, $module_type);
|
||||||
|
|
||||||
|
#Update module status
|
||||||
|
my $current_utimestamp = time ();
|
||||||
|
if ($last_status == $new_status) {
|
||||||
|
$status_changes++;
|
||||||
|
} else {
|
||||||
|
$status_changes = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status_changes == $module->{'min_ff_event'}) {
|
||||||
|
generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $dbh);
|
||||||
|
$status = $new_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
$last_status = $new_status;
|
||||||
|
|
||||||
# Generate alerts
|
# Generate alerts
|
||||||
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh) == 0) {
|
if (pandora_inhibit_alerts ($pa_config, $agent, $dbh) == 0) {
|
||||||
pandora_generate_alerts ($pa_config, $processed_data, $status, $agent, $module, $utimestamp, $dbh, $extraMacros);
|
pandora_generate_alerts ($pa_config, $processed_data, $status, $agent, $module, $utimestamp, $dbh, $extraMacros);
|
||||||
}
|
}
|
||||||
|
|
||||||
#Update module status
|
|
||||||
my $current_utimestamp = time ();
|
|
||||||
my ($status_changes, $last_status) = ($status != $agent_status->{'estado'}) ?
|
|
||||||
(0, $agent_status->{'estado'}) :
|
|
||||||
($agent_status->{'status_changes'} + 1, $agent_status->{'last_status'});
|
|
||||||
|
|
||||||
# Generate events
|
|
||||||
if ($status_changes == $module->{'min_ff_event'}) {
|
|
||||||
generate_status_event ($pa_config, $processed_data, $agent, $module, $status, $last_status, $dbh);
|
|
||||||
}
|
|
||||||
|
|
||||||
# tagente_estado.last_try defaults to NULL, should default to '0000-00-00 00:00:00'
|
# tagente_estado.last_try defaults to NULL, should default to '0000-00-00 00:00:00'
|
||||||
$agent_status->{'last_try'} = '0000-00-00 00:00:00' unless defined ($agent_status->{'last_try'});
|
$agent_status->{'last_try'} = '0000-00-00 00:00:00' unless defined ($agent_status->{'last_try'});
|
||||||
|
|
Loading…
Reference in New Issue