diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index e26550ad5a..45f6acd77a 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,15 @@ +2010-05-19 Ramon Novoa + + * lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm, + lib/PandoraFMS/Server.pm, lib/PandoraFMS/NetworkServer.pm, + lib/PandoraFMS/GIS.pm, lib/PandoraFMS/WMIServer.pm, + lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/ProducerConsumerServer.pm, + lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm, + lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm, + bin/pandora_server, util/pandora_db.pl, util/gpx2pandora_agent_data.pl, + util/pandora_manage.pl, util/pandora_dbstress.pl: Added the default library path + used by RPM and DEB packages. + 2010-05-19 Sancho Lerena * lib/PandoraFMS/DataServer.pm: XML data files coming from a disabled diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index fc79be261b..7e8064ab19 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -21,6 +21,9 @@ use strict; use warnings; use POSIX qw(strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + # Pandora Modules use PandoraFMS::DB; use PandoraFMS::Config; diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index b7e5f3d985..1a27a0eace 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -20,6 +20,10 @@ package PandoraFMS::Config; use warnings; use POSIX qw(strftime); use Time::Local; + +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; @@ -297,14 +301,19 @@ sub pandora_load_config { } # Check for file - if ( ! -e $archivo_cfg ) { + if ( ! -f $archivo_cfg ) { printf "\n [ERROR] Cannot open configuration file at $archivo_cfg. \n"; printf " Please specify a valid Pandora FMS configuration file in command line. \n"; print " Standard configuration file is at /etc/pandora/pandora_server.conf \n"; exit 1; } + # Collect items from config file and put in an array - open (CFG, "< $archivo_cfg"); + if (! open (CFG, "< $archivo_cfg")) { + print "[ERROR] Error opening configuration file $archivo_cfg: $!.\n"; + exit 1; + } + while (){ $buffer_line = $_; if ($buffer_line =~ /^[a-zA-Z]/){ # begins with letters diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 69677a5020..48f224fc8a 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -109,6 +109,9 @@ use HTML::Entities; use Time::Local; use POSIX qw(strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::DB; use PandoraFMS::Config; use PandoraFMS::Tools; diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 9c33b97c04..e0a3b4771d 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -28,6 +28,9 @@ use Time::Local; use XML::Simple; use POSIX qw(setsid strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/GIS.pm b/pandora_server/lib/PandoraFMS/GIS.pm index 16d94ded1a..9376b2402d 100644 --- a/pandora_server/lib/PandoraFMS/GIS.pm +++ b/pandora_server/lib/PandoraFMS/GIS.pm @@ -55,6 +55,9 @@ Exported Functions: use strict; use warnings; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::DB; use PandoraFMS::Tools; # TODO:Test if is instaled diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index eaa98c6b5f..2196f4ab18 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -27,6 +27,9 @@ use Thread::Semaphore; use IO::Socket::INET; use POSIX qw(strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index 301a132430..211ab32f4d 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -27,6 +27,9 @@ use Thread::Semaphore; use POSIX qw(strftime); use HTML::Entities; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/PredictionServer.pm b/pandora_server/lib/PandoraFMS/PredictionServer.pm index 0772bec18f..933d9ab55f 100644 --- a/pandora_server/lib/PandoraFMS/PredictionServer.pm +++ b/pandora_server/lib/PandoraFMS/PredictionServer.pm @@ -28,6 +28,9 @@ use IO::Socket::INET; use Net::Ping; use POSIX qw(strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/ProducerConsumerServer.pm b/pandora_server/lib/PandoraFMS/ProducerConsumerServer.pm index af537f609c..ac6623002b 100644 --- a/pandora_server/lib/PandoraFMS/ProducerConsumerServer.pm +++ b/pandora_server/lib/PandoraFMS/ProducerConsumerServer.pm @@ -24,6 +24,9 @@ use threads; use threads::shared; use Thread::Semaphore; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::DB; use PandoraFMS::Core; use PandoraFMS::Server; diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index 1fe64213fb..c6bf90e1b5 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -28,6 +28,9 @@ use IO::Socket::INET; use NetAddr::IP; use POSIX qw(strftime ceil); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/SNMPServer.pm b/pandora_server/lib/PandoraFMS/SNMPServer.pm index 6beb01db42..4681eec6c2 100644 --- a/pandora_server/lib/PandoraFMS/SNMPServer.pm +++ b/pandora_server/lib/PandoraFMS/SNMPServer.pm @@ -27,6 +27,9 @@ use Thread::Semaphore; use Time::Local; use XML::Simple; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/Server.pm b/pandora_server/lib/PandoraFMS/Server.pm index d20929ca1c..5093094e35 100644 --- a/pandora_server/lib/PandoraFMS/Server.pm +++ b/pandora_server/lib/PandoraFMS/Server.pm @@ -23,6 +23,9 @@ use warnings; use threads; use threads::shared; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index 06b847b3be..b48f183fbc 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -27,6 +27,9 @@ use Thread::Semaphore; use POSIX qw(strftime); use HTML::Entities; +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; use PandoraFMS::Core; diff --git a/pandora_server/util/gpx2pandora_agent_data.pl b/pandora_server/util/gpx2pandora_agent_data.pl index 2bc39431f6..bc2a18131e 100755 --- a/pandora_server/util/gpx2pandora_agent_data.pl +++ b/pandora_server/util/gpx2pandora_agent_data.pl @@ -8,11 +8,15 @@ use strict; use warnings; use XML::Simple; -use PandoraFMS::Tools; use Data::Dumper; use Sys::Hostname; use POSIX qw(strftime); +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + +use PandoraFMS::Tools; + use constant AGENT_VERSION => '3.1'; diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 19557b193a..29919da3cc 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -21,9 +21,13 @@ use strict; use Time::Local; # DateTime basic manipulation use DBI; # DB interface with MySQL +use POSIX qw(strftime); + +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; -use POSIX qw(strftime); # version: define current version my $version = "3.1 PS100310"; diff --git a/pandora_server/util/pandora_dbstress.pl b/pandora_server/util/pandora_dbstress.pl index 6f53f128ce..09355bc1fe 100755 --- a/pandora_server/util/pandora_dbstress.pl +++ b/pandora_server/util/pandora_dbstress.pl @@ -33,6 +33,9 @@ use strict; use DBI; # DB interface with MySQL use Math::Trig; # Math functions +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + # Pandora Modules use PandoraFMS::Config; use PandoraFMS::Tools; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index e2f356e6dd..7cd821385a 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -13,9 +13,13 @@ use strict; use Time::Local; # DateTime basic manipulation use DBI; # DB interface with MySQL +use POSIX qw(strftime); + +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + use PandoraFMS::Tools; use PandoraFMS::DB; -use POSIX qw(strftime); # version: define current version my $version = "3.1 PS100519";