diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index f1ba2b268f..b050628a82 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2009-10-16 Ramon Novoa + + * lib/PandoraFMS/DataServer.pm: Do not process disabled modules. + + * bin/pandora_server: Start logging before trying to connect to the DB. + 2009-10-16 Sancho Lerena * lib/PandoraFMS/Core.pm: Keepalive was not working properly. Keepalive diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 300a1629a0..1212453625 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -60,15 +60,15 @@ sub pandora_shutdown () { ######################################################################################## sub pandora_startup () { + # Start logging + pandora_start_log (\%Config); + # Connect to the DB $DBH = db_connect ('mysql', $Config{'dbname'}, $Config{'dbhost'}, 3306, $Config{'dbuser'}, $Config{'dbpass'}); pandora_audit (\%Config, 'Pandora FMS Server Daemon starting', 'SYSTEM', 'System', $DBH); - # Start logging - pandora_start_log (\%Config); - # Load servers pandora_reset_server (\%Config, $DBH); push (@Servers, new PandoraFMS::DataServer (\%Config, $DBH)); diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 3a36d7858a..c609a626dd 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -133,7 +133,7 @@ sub data_consumer ($$) { next; } - # Ignore the timestamp in the XML and use the file timestamp instead + # Ignore the timestamp in the XML and use the file timestamp instead $xml_data->{'timestamp'} = strftime ("%Y-%m-%d %H:%M:%S", localtime((stat($file_name))[9])) if ($pa_config->{'use_xml_timestamp'} eq '1' || ! defined ($xml_data->{'timestamp'})); unlink ($file_name); @@ -274,6 +274,9 @@ sub process_module_data ($$$$$$$$$) { return unless defined $module; } + # Module disabled! + return if ($module->{'disabled'} eq '1'); + # Parse the timestamp and process the module if ($timestamp =~ /(\d+)\/(\d+)\/(\d+) +(\d+):(\d+):(\d+)/ || $timestamp =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/) {