2009-05-27 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/DataServer.pm: Fixed timestamps for data lists. Made
          XML::Simple return an empty string instead of an empty hash when an
          empty value is found in an XML data file.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1715 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2009-05-27 16:09:29 +00:00
parent d24c74247f
commit fc0fc1f0e4
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2009-05-27 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DataServer.pm: Fixed timestamps for data lists. Made
XML::Simple return an empty string instead of an empty hash when an
empty value is found in an XML data file.
2009-05-12 Sancho Lerena <slerena@gmail.com>
* pandora_package_installer: Removed old, unused script.

View File

@ -118,7 +118,7 @@ sub data_consumer ($$) {
for (1..3) {
eval {
threads->yield;
$xml_data = XMLin ($file_name, forcearray => 'module');
$xml_data = XMLin ($file_name, forcearray => 'module', suppressempty => '');
};
# Invalid XML
@ -202,7 +202,7 @@ sub process_xml_data ($$$$) {
next unless defined ($data->{'value'});
$module_data->{'data'} = $data->{'value'};
my $data_timestamp = (defined ($data->{'timestamp'})) ? $data->{'timestamp'} : $timestamp;
my $data_timestamp = (defined ($data->{'timestamp'})) ? $data->{'timestamp'}->[0] : $timestamp;
process_module_data ($pa_config, $module_data, $server_id, $agent_name, $module_name,
$module_type, $interval, $data_timestamp, $dbh);
}
@ -237,7 +237,7 @@ sub process_module_data ($$$$$$$$$) {
my $max = (defined ($data->{'max'})) ? $data->{'max'}->[0] : 0;
my $min = (defined ($data->{'min'})) ? $data->{'min'}->[0] : 0;
my $description = (defined ($data->{'description'})) ? $data->{'description'}->[0] : '';
# Create the module
pandora_create_module ($agent->{'id_agente'}, $module_id, $module_name,
$max, $min, $description, $interval, $dbh);