diff --git a/pandora_server/bin/pandora_DBI_test.pl b/pandora_server/bin/pandora_DBI_test.pl index b3edebddeb..e904afef3d 100644 --- a/pandora_server/bin/pandora_DBI_test.pl +++ b/pandora_server/bin/pandora_DBI_test.pl @@ -1,4 +1,22 @@ #!/usr/bin/perl +################################################################################## +# DBI Memory Leak Tester +################################################################################## +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +################################################################################## use strict; use warnings; diff --git a/pandora_server/bin/pandora_SNMP_test.pl b/pandora_server/bin/pandora_SNMP_test.pl index c289b19736..8f3b839cc7 100644 --- a/pandora_server/bin/pandora_SNMP_test.pl +++ b/pandora_server/bin/pandora_SNMP_test.pl @@ -1,4 +1,22 @@ #!/usr/bin/perl +################################################################################## +# SNMP Test tool +################################################################################## +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +################################################################################## #use Net::SNMP; # For query2 testing use SNMP '5.0.2.pre1' || die("Cannot load module\n"); diff --git a/pandora_server/bin/pandora_config.pm b/pandora_server/bin/pandora_config.pm index 67fd811fed..0b2456a820 100755 --- a/pandora_server/bin/pandora_config.pm +++ b/pandora_server/bin/pandora_config.pm @@ -1,4 +1,23 @@ package pandora_config; +################################################################################## +# Pandora Config package +################################################################################## +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +################################################################################## + use warnings; use Time::Local; @@ -17,8 +36,8 @@ our @EXPORT = qw( pandora_help_screen # There is no global vars, all variables (setup) passed as hash reference # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "1.2beta2"; -my $pandora_build="PS060606"; +my $pandora_version = "1.2 Beta2"; +my $pandora_build="PS60629"; # Setup hash my %pa_config; @@ -30,9 +49,6 @@ my %pa_config; ############################################################################## sub help_screen { - printf "Permission is granted to copy, distribute and/or modify this document \n"; - printf "under the terms of the GNU Free Documentation License, Version 2.0 \n"; - printf "or any later version published by the Free Software Foundation at www.gnu.org \n\n"; printf "\n\nSyntax: \n pandora_xxxxxxx.pl [ options ] \n\n"; printf "Following options are optional : \n"; printf " -v : Verbose mode activated, give more information in logfile \n"; @@ -51,7 +67,8 @@ sub help_screen { sub pandora_init { my $pa_config = $_[0]; my $init_string = $_[1]; - printf "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-2006 \n"; + printf "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-2006 ArticaST\n"; + printf "This program is Free Software, licensed under the terms of GPL License v2 or later.\n"; printf "You can download latest versions and documentation at http://pandora.sourceforge.net. \n\n"; # Check we are running Linux diff --git a/pandora_server/bin/pandora_db.pm b/pandora_server/bin/pandora_db.pm index 3208204bbd..e14206e438 100644 --- a/pandora_server/bin/pandora_db.pm +++ b/pandora_server/bin/pandora_db.pm @@ -1,4 +1,22 @@ package pandora_db; +################################################################################## +# Pandora Database Package +################################################################################## +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +################################################################################## use warnings; use Time::Local; @@ -939,10 +957,8 @@ sub pandora_event (%$$$$) { $evento = $dbh->quote($evento); $timestamp = $dbh->quote($timestamp); my $query = "insert into tevento (id_agente, id_grupo, evento, timestamp, estado) VALUES ($id_agente,$id_grupo,$evento,$timestamp,0)"; - logger ($pa_config,"EVENT Insertion: $query",2); - print "$query"; - $dbh->do($query); - + logger ($pa_config,"EVENT Insertion: $query",5); + $dbh->do($query); } ################################################################################# diff --git a/pandora_server/bin/pandora_dbstress.pl b/pandora_server/bin/pandora_dbstress.pl index 747f9d16d0..9a1acbb7e9 100755 --- a/pandora_server/bin/pandora_dbstress.pl +++ b/pandora_server/bin/pandora_dbstress.pl @@ -3,9 +3,19 @@ # Pandora DB Stress tool ################################################################################## # Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com -# Permission is granted to copy, distribute and/or modify this document -# under the terms of the GNU Free Documentation License, Version 2.0 -# or any later version published by the Free Software Foundation at www.gnu.org +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################## # Includes list diff --git a/pandora_server/bin/pandora_network.pl b/pandora_server/bin/pandora_network.pl index e1412b4efd..057d47f614 100755 --- a/pandora_server/bin/pandora_network.pl +++ b/pandora_server/bin/pandora_network.pl @@ -3,9 +3,19 @@ # Pandora Network Server ################################################################################## # Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com -# Permission is granted to copy, distribute and/or modify this document -# under the terms of the GNU Free Documentation License, Version 2.0 -# or any later version published by the Free Software Foundation at www.gnu.org +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################## # Includes list @@ -231,8 +241,7 @@ sub pandora_query_snmp { my $SESSION = new SNMP::Session (DestHost => $snmp_target, Community => $snmp_community, Version => 1); - - if (!defined($SESSION)) { + if ((!defined($SESSION))&& ($snmp_community != "") && ($snmp_oid != "")) { logger($pa_config, "SNMP ERROR SESSION", 4); $_[4]="1"; } else { @@ -316,7 +325,12 @@ sub exec_network_module { # SNMP Modules (Proc, inc, data, string) # ------------ } elsif (($id_tipo_modulo == 15) || ($id_tipo_modulo == 18) || ($id_tipo_modulo == 16) || ($id_tipo_modulo == 17)) { # SNMP module - $temp2 = pandora_query_snmp ($pa_config, $mysnmp_oid, $mysnmp_community, $ip_target, $error, $dbh); + if ($mysnmp_oid ne ""){ + $temp2 = pandora_query_snmp ($pa_config, $mysnmp_oid, $mysnmp_community, $ip_target, $error, $dbh); + } else { + $error = 1 + } + # SUB pandora_query_snmp (pa_config, oid, community, target, error, dbh) if ($error == 0) { # A correct SNMP Query $module_result = 0; diff --git a/pandora_server/bin/pandora_server.pl b/pandora_server/bin/pandora_server.pl index a1276d7932..e842d1a9b5 100755 --- a/pandora_server/bin/pandora_server.pl +++ b/pandora_server/bin/pandora_server.pl @@ -1,18 +1,27 @@ #!/usr/bin/perl ################################################################################## -# Pandora Server +# Pandora Data Server ################################################################################## -# Copyright (c) 2004-2005 Sancho Lerena, slerena@gmail.com -# Permission is granted to copy, distribute and/or modify this document -# under the terms of the GNU Free Documentation License, Version 2.0 -# or any later version published by the Free Software Foundation at www.gnu.org +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################## # Includes list use strict; use warnings; - use XML::Simple; # Useful XML functions use Digest::MD5; # MD5 generation use Time::Local; # DateTime basic manipulation @@ -22,7 +31,6 @@ use File::Copy; # Needed to manipulate files use threads; use threads::shared; - # Librerias / Modulos de pandora use pandora_config; use pandora_tools; @@ -105,7 +113,7 @@ sub pandora_dataserver { my $config; # Hash Reference, used to store XML data # But first we needed to verify integrity of data file if ($pa_config->{'pandora_check'} == 1){ - logger ($pa_config, "Integrity of Datafile using MD5 is verified: $file_data",2); + logger ($pa_config, "Integrity of Datafile using MD5 is verified: $file_data",3); } eval { # XML Processing error catching procedure. Critical due XML was no validated logger ($pa_config, "Ready to parse $file_data",4); @@ -119,7 +127,6 @@ sub pandora_dataserver { copy ($file_md5,$file_md5."_BAD"); } } - undef $config; # If _everything_ its ok.. # delete files @@ -134,7 +141,6 @@ sub pandora_dataserver { if ( -e $file_md5 ) { unlink ($file_md5); } - } } # No existe fichero de checksum, ignoramos el archivo } diff --git a/pandora_server/bin/pandora_snmpconsole.pl b/pandora_server/bin/pandora_snmpconsole.pl index 60f8c01bfc..f5df8d9377 100755 --- a/pandora_server/bin/pandora_snmpconsole.pl +++ b/pandora_server/bin/pandora_snmpconsole.pl @@ -3,9 +3,19 @@ # Pandora Server. SNMP Console ################################################################################## # Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com -# Permission is granted to copy, distribute and/or modify this document -# under the terms of the GNU Free Documentation License, Version 2.0 -# or any later version published by the Free Software Foundation at www.gnu.org +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################## # Includes list diff --git a/pandora_server/bin/pandora_tools.pm b/pandora_server/bin/pandora_tools.pm index ed1c1f2f50..583eca9dc5 100644 --- a/pandora_server/bin/pandora_tools.pm +++ b/pandora_server/bin/pandora_tools.pm @@ -1,4 +1,22 @@ package pandora_tools; +################################################################################## +# Pandora Tools Package +################################################################################## +# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com +# Copyright (c) 2005-2006 Artica Soluciones Tecnológicas S.L +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +################################################################################## use warnings; use Time::Local;