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:
parent
864dc4b0c3
commit
f0cab8a3d2
|
@ -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.
|
||||
|
|
|
@ -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'});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue