2010-03-10 Sancho Lerena <slerena@artica.es>

* lib/PandoraFMS/DataServer.pm: Fix for annoying notices from
        Perl due reference to undefined variable (GIS).




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2504 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-03-10 18:46:52 +00:00
parent a8ad0542e2
commit 43ab03aa9c
2 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,8 @@
2010-03-10 Sancho Lerena <slerena@artica.es> 2010-03-10 Sancho Lerena <slerena@artica.es>
* lib/PandoraFMS/DataServer.pm: Fix for annoying notices from
Perl due reference to undefined variable (GIS).
* lib/PandoraFMS/Core.pm: Automonitoring includes now status of * lib/PandoraFMS/Core.pm: Automonitoring includes now status of
database maintance and warns if more than 24hrs without running database maintance and warns if more than 24hrs without running
database maintance script. database maintance script.

View File

@ -184,22 +184,25 @@ sub process_xml_data ($$$$$) {
# Validate the GIS informtation # Validate the GIS informtation
# If position data (at least longitude and latitde) are not valid should be ignored
if ($longitude !~ /[-+]?[0-9]*\.?[0-9]+/ || $latitude !~ /[-+]?[0-9]*\.?[0-9]+/ || !defined($longitude) || !defined($latitude)) {
$valid_position_data = 0;
$longitude = '';
$latitude = '';
$altitude='';
}
if (!defined($altitude) || $altitude !~ /[-+]?[0-9,11,12]/) { if (!defined($altitude) || $altitude !~ /[-+]?[0-9,11,12]/) {
$altitude = 0; # Default value $altitude = ''; # Default value
} # This could be a valid position data, not always will get altitude
}
if (!defined($position_description) ) { #FIXME: Validate the data with a regexp
$position_description = ''; # Default value
}
if (!defined($longitude) || $longitude !~ /[-+]?[0-9,11,12]/) {
$longitude = ''; # Default value
$valid_position_data = 0;
}
if (!defined($latitude) || $latitude !~ /[-+]?[0-9,11,12]/) {
$latitude = ''; # Default value
$valid_position_data = 0;
}
if (!defined($position_description) ) { #FIXME: Validate the data with a regexp
$position_description = ''; # Default value
}
logger($pa_config, "Getting GIS Data=timezone_offset=$timezone_offset longitude=$longitude latitude=$latitude altitude=$altitude position_description=$position_description", 8); logger($pa_config, "Getting GIS Data=timezone_offset=$timezone_offset longitude=$longitude latitude=$latitude altitude=$altitude position_description=$position_description", 8);
} }
# Unknown agent! # Unknown agent!