* 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:
parent
a924cdb2b6
commit
d58c51c7d4
|
@ -17,16 +17,14 @@
|
||||||
#along with this program; if not, write to the Free Software
|
#along with this program; if not, write to the Free Software
|
||||||
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##################################################################################
|
##################################################################################
|
||||||
#use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
use DBI(); # DB interface with MySQL
|
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){
|
while (1){
|
||||||
# dbd_open_test();
|
dbd_open_test();
|
||||||
dbd_select_test($dbh);
|
#dbd_select_test($dbh);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub dbd_select_test {
|
sub dbd_select_test {
|
||||||
|
@ -34,9 +32,15 @@ sub dbd_select_test {
|
||||||
my $query = "select * from tagente";
|
my $query = "select * from tagente";
|
||||||
my $result = $dbh->prepare($query);
|
my $result = $dbh->prepare($query);
|
||||||
$result ->execute;
|
$result ->execute;
|
||||||
|
$result = "";
|
||||||
|
$query = "";
|
||||||
|
$dbh = "";
|
||||||
|
undef $dbh;
|
||||||
|
undef $query;
|
||||||
|
undef $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub dbd_open_test {
|
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;
|
$dbh->disconnect;
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
# Pandora Data Server
|
# Pandora Data Server
|
||||||
##################################################################################
|
##################################################################################
|
||||||
# Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
# 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
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -95,7 +95,7 @@ sub pandora_dataserver {
|
||||||
threads->yield;
|
threads->yield;
|
||||||
$file_data = "$pa_config->{'incomingdir'}/$onefile";
|
$file_data = "$pa_config->{'incomingdir'}/$onefile";
|
||||||
next if $onefile =~ /^\.\.?$/; # Skip . and .. directory
|
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;
|
$agent_filename = $1;
|
||||||
$file_md5 = "$pa_config->{'incomingdir'}/$agent_filename.checksum";
|
$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
|
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
|
eval { # XML Processing error catching procedure. Critical due XML was no validated
|
||||||
logger ($pa_config, "Ready to parse $file_data",4);
|
logger ($pa_config, "Ready to parse $file_data",4);
|
||||||
$config = XMLin($file_data, forcearray=>'module');
|
$config = XMLin($file_data, forcearray=>'module');
|
||||||
procesa_datos($pa_config, $config, $dbh);
|
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
logger ($pa_config, "[ERROR] Error processing XML contents in $file_data",0);
|
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 )) {
|
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;
|
undef $config;
|
||||||
# If _everything_ its ok..
|
# If _everything_ its ok..
|
||||||
# delete files
|
# delete files
|
||||||
|
|
|
@ -23,7 +23,7 @@ dbuser pandora
|
||||||
# daemon: Runs in daemon mode (background) if 1, if 0 runs in foreground
|
# daemon: Runs in daemon mode (background) if 1, if 0 runs in foreground
|
||||||
# this could be setup on command line with -D option
|
# this could be setup on command line with -D option
|
||||||
# NEW in pandora 1.2, default is 0
|
# NEW in pandora 1.2, default is 0
|
||||||
# daemon 0
|
# daemon 1
|
||||||
|
|
||||||
# dbpass: Database password
|
# dbpass: Database password
|
||||||
dbpass pandora
|
dbpass pandora
|
||||||
|
@ -36,7 +36,7 @@ dbhost localhost
|
||||||
verbosity 10
|
verbosity 10
|
||||||
|
|
||||||
# Server Threshold: defines number of seconds of main loop (in sec)
|
# Server Threshold: defines number of seconds of main loop (in sec)
|
||||||
server_threshold 30
|
server_threshold 10
|
||||||
|
|
||||||
# Alert threshold
|
# Alert threshold
|
||||||
alert_threshold 60
|
alert_threshold 60
|
||||||
|
@ -45,7 +45,7 @@ alert_threshold 60
|
||||||
master 1
|
master 1
|
||||||
|
|
||||||
# Check datafiles using a MD5 hash, 1 to check (default), 0 to ignore .checksum
|
# 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)
|
# Activate Pandora SNMP console (depending on snmptrapd)
|
||||||
# only available on Pandora Network server
|
# only available on Pandora Network server
|
||||||
|
|
Loading…
Reference in New Issue