* Fixed minor issues for finish Pandora 1.2 Beta 2.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@103 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2006-07-06 17:14:19 +00:00
parent a924cdb2b6
commit d58c51c7d4
3 changed files with 30 additions and 26 deletions

View File

@ -17,16 +17,14 @@
#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;
use DBI(); # DB interface with MySQL
my $dbh = DBI->connect("DBI:mysql:pandora:localhost:3306","pandora","pandora",{ RaiseError => 1 });
#$dbh = DBI->connect("DBI:mysql:pandora:localhost:3306","pandora","pandora",{ RaiseError => 1 });
while (1){
# dbd_open_test();
dbd_select_test($dbh);
dbd_open_test();
#dbd_select_test($dbh);
}
sub dbd_select_test {
@ -34,9 +32,15 @@ sub dbd_select_test {
my $query = "select * from tagente";
my $result = $dbh->prepare($query);
$result ->execute;
$result = "";
$query = "";
$dbh = "";
undef $dbh;
undef $query;
undef $result;
}
sub dbd_open_test {
my $dbh = DBI->connect("DBI:mysql:pandora:localhost:3306","pandora","pandora",{ RaiseError => 1 });
$dbh = DBI->connect("DBI:mysql:pandora:localhost:3306","pandora","pandora",{ RaiseError => 1 });
$dbh->disconnect;
}
}

View File

@ -3,19 +3,19 @@
# Pandora Data Server
##################################################################################
# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
# Copyright (c) 2005-2006 Artica Soluciones Tecnol<EFBFBD>icas S.L
# Copyright (c) 2005-2006 Artica Soluciones Tecnologicas 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.
# 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
@ -95,7 +95,7 @@ sub pandora_dataserver {
threads->yield;
$file_data = "$pa_config->{'incomingdir'}/$onefile";
next if $onefile =~ /^\.\.?$/; # Skip . and .. directory
if ( $onefile =~ /([\-\:\;\.\,\_\s\a\*\=\(\)\/a-zA-Z0-9]*).data/ ) { # First filter any file that doesnt like ".data"
if ( $onefile =~ /([\-\:\;\.\,\_\s\a\*\=\(\)a-zA-Z0-9]*).data\z/ ) { # First filter any file that doesnt like ".data"
$agent_filename = $1;
$file_md5 = "$pa_config->{'incomingdir'}/$agent_filename.checksum";
if (( -e $file_md5 ) or ($pa_config->{'pandora_check'} == 0)){ # If check is disabled, ignore if file_md5 exists
@ -118,15 +118,15 @@ sub pandora_dataserver {
eval { # XML Processing error catching procedure. Critical due XML was no validated
logger ($pa_config, "Ready to parse $file_data",4);
$config = XMLin($file_data, forcearray=>'module');
procesa_datos($pa_config, $config, $dbh);
};
if ($@) {
logger ($pa_config, "[ERROR] Error processing XML contents in $file_data",0);
copy ($file_data,$file_data."_BAD");
copy ($file_data,$file_data."_BADXML");
if (($pa_config->{'pandora_check'} == 1) && ( -e $file_md5 )) {
copy ($file_md5,$file_md5."_BAD");
copy ($file_md5,$file_md5."_BADCHECKUM");
}
}
procesa_datos($pa_config, $config, $dbh);
undef $config;
# If _everything_ its ok..
# delete files

View File

@ -23,7 +23,7 @@ dbuser pandora
# daemon: Runs in daemon mode (background) if 1, if 0 runs in foreground
# this could be setup on command line with -D option
# NEW in pandora 1.2, default is 0
# daemon 0
# daemon 1
# dbpass: Database password
dbpass pandora
@ -36,7 +36,7 @@ dbhost localhost
verbosity 10
# Server Threshold: defines number of seconds of main loop (in sec)
server_threshold 30
server_threshold 10
# Alert threshold
alert_threshold 60
@ -45,7 +45,7 @@ alert_threshold 60
master 1
# Check datafiles using a MD5 hash, 1 to check (default), 0 to ignore .checksum
checksum 1
checksum 0
# Activate Pandora SNMP console (depending on snmptrapd)
# only available on Pandora Network server