2007-12-04 Sancho Lerena <slerena@gmail.com>

*  lib/PandoraFMS/Config.pm, bin/pandora_network: This little portion of
        code should fix problem detected in some very extrange module "blackout" 
        effect reported by Corona. Need check and testing before get as final.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@680 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-12-04 01:19:46 +00:00
parent 626e056c28
commit 7f60b3921f
3 changed files with 25 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2007-12-04 Sancho Lerena <slerena@gmail.com>
* lib/PandoraFMS/Config.pm, bin/pandora_network: This little portion of
code should fix problem detected in some very extrange module "blackout"
effect reported by Corona. Need check and testing before get as final.
2007-11-20 Manuel Arostegui <marostegui@artica.es>
* pandora_snmpconsole,pandora_server,pandora_recon,pandora_network: Fixed

View File

@ -143,13 +143,23 @@ sub pandora_network_consumer ($$) {
lock %current_task_hash;
$current_task_hash{$data_id_agent_module}=1;
}
# Call network execution process
exec_network_module ( $pa_config, $data_id_agent_module, $dbh);
# Executing network task with unmanaged error trapping
eval {
# Call network execution process
exec_network_module ( $pa_config, $data_id_agent_module, $dbh);
};
if ($@){
logger ($pa_config, "[ERROR] Network Task for module $data_id_agent_module causes a system exception", 0);
logger ($pa_config, "ERROR Code: $@", 1);
}
# Remove from queue. If catch an error, probably data is
# not been processed, but has been freed from task queue
{
lock %current_task_hash;
delete($current_task_hash{$data_id_agent_module});
}
$counter = 0;
} else {
$counter ++;
@ -262,7 +272,7 @@ sub pandora_ping_icmp {
# Make more than a single ping (as defined in icmp_checks
for ($temp =0; $temp < $pa_config->{'icmp_checks'}; $temp++){
# Some hosts don't accept ICMP with too small payload. Use 16 Bytes
# Some hosts don't accept ICMP with too small payload. Use 16 Bytes min
{
lock $icmp_lock;
$p = Net::Ping->new("icmp", $l_timeout, 32);
@ -415,7 +425,7 @@ sub pandora_query_snmp (%$$$$) {
Community => $snmp_community,
Version => 1);
if ( (!defined($SESSION)) && ($snmp_target != "") && ($snmp_community != "") && ($snmp_oid != "")) {
logger($pa_config, "SNMP ERROR SESSION for Target $snmp_target ", 4);
logger($pa_config, "SNMP ERROR SESSION for Target $snmp_target ", 2);
$_[4] = "1";
} else {
# Perl uses different OID syntax than SNMPWALK or PHP's SNMP
@ -500,7 +510,7 @@ sub exec_network_module {
$exec_sql->finish();
} else {
$exec_sql->finish();
logger (\%pa_config,"[ERROR] Processing data for invalid module",0);
logger (\%pa_config,"[ERROR] Processing data for invalid module", 0);
return 0;
}

View File

@ -34,8 +34,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.3beta3";
my $pandora_build="PS071008";
my $pandora_version = "1.3.1";
my $pandora_build="PS071203";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -136,7 +136,7 @@ sub pandora_loadconfig {
$pa_config->{"servername"}=~ s/\s//g; # Replace ' ' chars
$pa_config->{"networkserver"}=0;
$pa_config->{"dataserver"}=0;
$pa_config->{"icmp_checks"}=1;
$pa_config->{"icmp_checks"}=1; # Introduced on 1.3.1
$pa_config->{"reconserver"}=0;
$pa_config->{"servermode"}="";
$pa_config->{'snmp_logfile'}="/var/log/pandora/pandora_snmptrap.log";