2009-09-03 Sancho Lerena <slerena@artica.es>

* lib/PandoraFMS/PredictionServer.pm: Fixed some warning on non init
          variables.

        * lib/PandoraFMS/Core.pm: Now uses alert name instead alert description
        in event description.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1911 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-09-03 17:09:52 +00:00
parent 7a7cd63ec8
commit a807d395e9
3 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2009-09-03 Sancho Lerena <slerena@artica.es>
* lib/PandoraFMS/PredictionServer.pm: Fixed some warning on non init
variables.
* lib/PandoraFMS/Core.pm: Now uses alert name instead alert description
in event description.
2009-09-02 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Decode HTML entities for all alert types.

View File

@ -213,7 +213,7 @@ sub pandora_process_alert ($$$$$$$) {
# Generate an event
pandora_event ($pa_config, "Alert ceased (" .
$alert->{'descripcion'} . ")", $agent->{'id_grupo'},
$alert->{'name'} . ")", $agent->{'id_grupo'},
$agent->{'id_agente'}, $alert->{'priority'}, $id, $alert->{'id_agent_module'},
"alert_recovered", $dbh);
@ -401,7 +401,7 @@ sub pandora_execute_alert ($$$$$$$) {
# Generate an event
my ($text, $event) = ($alert_mode == 0) ? ('recovered', 'alert_recovered') : ('fired', 'alert_fired');
pandora_event ($pa_config, "Alert $text (" . $alert->{'description'} . ")",
pandora_event ($pa_config, "Alert $text (" . $alert->{'name'} . ")",
$agent->{'id_grupo'}, $agent->{'id_agente'}, $alert->{'priority'}, (defined ($alert->{'id_template_module'})) ? $alert->{'id_template_module'} : 0,
$alert->{'id_agent_module'}, $event, $dbh);
}

View File

@ -184,10 +184,11 @@ sub exec_prediction_module ($$$$) {
$temp1 = $week_utimestamp[$i] + $agent_module->{'module_interval'};
# Get data for week $i in the past
$average_interval = get_db_value ($dbh, 'SELECT AVG(datos) FROM tagente_datos WHERE id_agente_modulo = ? AND utimestamp > ? AND utimestamp < ?', $target_module->{'id_agente_modulo'}, $week_utimestamp[$i], $temp1);
# Need to get data outside interval because no data.
if ($average_interval == 0){
if (!(defined($average_interval)) || ($average_interval == 0)) {
$last_data = get_db_value ($dbh, 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ? AND utimestamp > ? LIMIT 1', $target_module->{'id_agente_modulo'}, $week_utimestamp[$i]);
$sum_data++ if ($last_data != 0);