2009-04-23 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Core.pm: Fixed *inc data processing.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1650 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2009-04-23 09:20:46 +00:00
parent 864dc4b0c3
commit f0cab8a3d2
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2009-04-23 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Fixed *inc data processing.
2009-04-22 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm: Fixed SNMP alerts.

View File

@ -1024,9 +1024,21 @@ sub process_inc_data ($$$$) {
return undef;
}
# Negative increment, reset inc data
if ($data < $data_inc->{'datos'}) {
db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ?', $module->{'id_agente_modulo'});
db_insert ($dbh, 'INSERT INTO tagente_datos_inc
(`id_agente_modulo`, `datos`, `utimestamp`)
VALUES (?, ?, ?)', $module->{'id_agente_modulo'}, $data, $utimestamp);
return undef;
}
# Should not happen
return 0 if ($utimestamp == $data_inc->{'utimestamp'});
# Update inc data
db_do ($dbh, 'UPDATE tagente_datos_inc SET datos = ?, utimestamp = ? WHERE id_agente_modulo = ?', $data, $utimestamp, $module->{'id_agente_modulo'});
return ($data - $data_inc->{'datos'}) / ($utimestamp - $data_inc->{'utimestamp'});
}