2011-12-26 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Core.pm: Discard inc data when a second value
	  with the same timestamp arrives. Thanks to eXXon.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5305 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2011-12-26 11:45:19 +00:00
parent afdc15e750
commit edd00a8f88
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-12-26 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Discard inc data when a second value
with the same timestamp arrives. Thanks to eXXon.
2011-12-23 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Added Netflow server configuration

View File

@ -1820,6 +1820,9 @@ sub process_data ($$$$$) {
if ($module_type =~ m/_inc$/) {
$data = process_inc_data ($data, $module, $utimestamp, $dbh);
# Same timestamp as previous data. Discard.
return undef if($data == -1);
# Not an error, no previous data
if (!defined($data)){
$data_object->{'data'} = 0;
@ -1868,7 +1871,7 @@ sub process_inc_data ($$$$) {
}
# Should not happen
return 0 if ($utimestamp == $data_inc->{'utimestamp'});
return -1 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'});