2014-09-06 Junichi Satoh <junichi@rworks.jp>

* lib/PandoraFMS/Core.pm: Fixed that unknown modules are never
	recovered when module data is received correctly in/after the
	race condition (module execution time exceeds its interval).
This commit is contained in:
Junichi Satoh 2014-09-06 11:16:46 +09:00
parent 6412dc7e17
commit e49311ae2a
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2014-09-06 Junichi Satoh <junichi@rworks.jp>
* lib/PandoraFMS/Core.pm: Fixed that unknown modules are never
recovered when module data is received correctly in/after the
race condition (module execution time exceeds its interval).
2014-09-03 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Tools.pm: Added basic support to log to syslog.

View File

@ -4223,7 +4223,7 @@ sub pandora_module_unknown ($$) {
# Set the module state to normal
logger ($pa_config, "Module " . $module->{'nombre'} . " is going to NORMAL", 10);
db_do ($dbh, 'UPDATE tagente_estado SET last_known_status = estado, last_status = 0, estado = 0 WHERE id_agente_estado = ?', $module->{'id_agente_estado'});
db_do ($dbh, 'UPDATE tagente_estado SET last_status = 0, estado = 0 WHERE id_agente_estado = ?', $module->{'id_agente_estado'});
# Get agent information
my $agent = get_db_single_row ($dbh, 'SELECT *
@ -4265,7 +4265,7 @@ sub pandora_module_unknown ($$) {
else {
# Set the module state to unknown
logger ($pa_config, "Module " . $module->{'nombre'} . " is going to UNKNOWN", 10);
db_do ($dbh, 'UPDATE tagente_estado SET last_known_status = estado, last_status = 3, estado = 3 WHERE id_agente_estado = ?', $module->{'id_agente_estado'});
db_do ($dbh, 'UPDATE tagente_estado SET last_status = 3, estado = 3 WHERE id_agente_estado = ?', $module->{'id_agente_estado'});
# Get agent information
my $agent = get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE id_agente = ?', $module->{'id_agente'});