From f9f49ec57473ce13d582e1ea05de0bf9b0f43fe7 Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 22 Jun 2007 14:35:00 +0000 Subject: [PATCH] 2007-06-22 Sancho Lerena * bin/pandora_recon.pl: This sould be final modifications for recon. Fixed a bug reported by Enrique Verdes in the development list. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@535 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/bin/pandora_recon.pl | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 41c56e61aa..341360a62b 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2007-06-22 Sancho Lerena + + * bin/pandora_recon.pl: This sould be final modifications for recon. + Fixed a bug reported by Enrique Verdes in the development list. + 2007-06-19 Sancho Lerena * bin/PandoraFMS/DB.pm: Added support to timeframe alerts. diff --git a/pandora_server/bin/pandora_recon.pl b/pandora_server/bin/pandora_recon.pl index 335e21176d..63b2a29a8c 100755 --- a/pandora_server/bin/pandora_recon.pl +++ b/pandora_server/bin/pandora_recon.pl @@ -68,8 +68,8 @@ if ( $pa_config{"daemon"} eq "1" ) { # Runs main program (have a infinite loop inside) threads->new( \&pandora_recon_subsystem, \%pa_config); -sleep(1); +sleep(1); while ( 1 ){ pandora_serverkeepaliver ($pa_config, 3, $dbh); threads->yield; @@ -115,8 +115,7 @@ sub pandora_recon_subsystem { logger($pa_config,"Recon Server: Executing task [$task_name]",8); # EXEC TASK and mark as "in progress" != -1 pandora_update_reconstatus ($pa_config, $dbh, $id_task, 0); - threads->new( \&pandora_exec_task, $pa_config, $id_task); - # pandora_exec_task ($pa_config, $id_task); + pandora_exec_task ($pa_config, $id_task); } } $exec_sql->finish(); @@ -224,7 +223,10 @@ sub pandora_exec_task { sub scan_icmp { my $dest = $_[0]; my $l_timeout = $_[1]; - $result = ping(hostname => $dest, timeout => $l_timeout, size => 32, count => 1); + my $result = ping(hostname => $dest, timeout => $l_timeout, size => 32, count => 1); + if (!defined($result)){ + return 0; + } if ($result) { return 1; } else {