2011-02-07 Sancho Lerena <slerena@artica.es>

* pandora_server/DEBIAN/control,
        pandora_server/pandora_server.spec,
        pandora_server/pandora_server.redhat.spec: Added LWP dependency for
        reverse Geocoding feature. This is included on all distros.

        * pandora_server/conf/pandora_server.conf,
        pandora_server/lib/PandoraFMS/Config.pm,
        pandora_server/lib/PandoraFMS/DataServer.pm: Added support for reverse geocoding using
        GoogleMaps api.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3806 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2011-02-07 13:45:34 +00:00
parent a25c82dc8b
commit 2bf04d4c39
8 changed files with 45 additions and 4 deletions

View File

@ -1,3 +1,15 @@
2011-02-07 Sancho Lerena <slerena@artica.es>
* pandora_server/DEBIAN/control,
pandora_server/pandora_server.spec,
pandora_server/pandora_server.redhat.spec: Added LWP dependency for
reverse Geocoding feature. This is included on all distros.
* pandora_server/conf/pandora_server.conf,
pandora_server/lib/PandoraFMS/Config.pm,
pandora_server/lib/PandoraFMS/DataServer.pm: Added support for reverse geocoding using
GoogleMaps api.
2011-01-31 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/DB.pm: Fixed a codification bug with

View File

@ -6,5 +6,5 @@ Section: admin
Installed-Size: 640
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Homepage: http://pandorafms.org/
Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo
Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl
Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server.

View File

@ -272,3 +272,11 @@ max_queue_files 250
# Update parent from the agent xml
#update_parent 1
#
#
# This enable realtime reverse geocoding using Google Maps public api.
# This requires internet access, and could have performance penalties processing GIS
# information due the connetion needed to resolve all GIS input.
#
# google_maps_description 1

View File

@ -231,6 +231,7 @@ sub pandora_load_config {
$pa_config->{"recon_reverse_geolocation_file"} = '/usr/local/share/GeoIP/GeoIPCity.dat'; # 3.1
$pa_config->{"recon_location_scatter_radius"} = 50; # 3.1
$pa_config->{"update_parent"} = 0; # 3.1
$pa_config->{"google_maps_description"} = 0;
$pa_config->{"max_queue_files"} = 250;
@ -547,6 +548,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^restart\s+([0-1])/i) {
$pa_config->{'restart'} = clean_blank($1);
}
elsif ($parametro =~ m/^google_maps_description\s+([0-1])/i) {
$pa_config->{'google_maps_description'} = clean_blank($1);
}
elsif ($parametro =~ m/^activate_gis\s+([0-1])/i) {
$pa_config->{'activate_gis'} = clean_blank($1);
}

View File

@ -28,6 +28,9 @@ use Time::Local;
use XML::Simple;
use POSIX qw(setsid strftime);
# For Reverse Geocoding
use LWP::Simple;
# Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5';
@ -229,7 +232,18 @@ sub process_xml_data ($$$$$) {
}
if (!defined($position_description) ) { #FIXME: Validate the data with a regexp
$position_description = ''; # Default value
# This code gets description (Reverse Geocoding) from a current GPS coordinates using Google maps API
# This requires a connection to internet and could be very slow and have a huge impact in performance.
# Other methods for reverse geocoding will be supplied in the future (openstreetmaps in a local server)
if ($pa_config->{'google_maps_description'}){
my $content = get ('http://maps.google.com/maps/geo?q='.$latitude.','.$longitude.'&output=csv&sensor=false');
my @address = split (/\"/,$content);
$position_description = $address[1];
} else {
$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);

View File

@ -199,6 +199,9 @@ sub pandora_get_os ($) {
elsif ($command =~ m/embedded/i){
return 14;
}
elsif ($command =~ m/android/i){
return 15;
}
elsif ($command =~ m/BSD/i){
return 4;
}

View File

@ -23,7 +23,7 @@ Prereq: %{_sbindir}/useradd
AutoReq: 0
Provides: %{name}-%{version}
Requires: coreutils
Requires: perl-DBI perl-DBD-mysql
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
Requires: perl-XML-Simple perl-XML-SAX
Requires: perl-NetAddr-IP net-snmp net-tools
Requires: nmap wmic sudo

View File

@ -21,7 +21,7 @@ BuildArchitectures: noarch
Requires(pre): /usr/sbin/useradd
AutoReq: 0
Provides: %{name}-%{version}
Requires: perl-DBI perl-DBD-mysql
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
Requires: perl-NetAddr-IP net-snmp net-tools
Requires: nmap wmic sudo perl-HTML-Tree perl-XML-SAX