2007-06-07 Sancho Lerena <slerena@artica.es>

* bin/pandora_recon.pl: Now uses ping() from PingExternal.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@491 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-06-07 10:55:18 +00:00
parent 5d90137215
commit 30371366d5
2 changed files with 10 additions and 12 deletions

View File

@ -19,6 +19,8 @@
user (it uses PING from system).
* bin/PandoraFMS: Now contains all .PM files for PandoraFMS.
* bin/pandora_recon.pl: Now uses ping() from PingExternal.
2007-06-05 Sancho Lerena <slerena@gmail.com>

View File

@ -21,11 +21,10 @@
use strict;
use warnings;
use Date::Manip; # Needed to manipulate DateTime formats
# of input, output and compare
use Time::Local; # DateTime basic manipulation
use Net::Ping; # ICMP
use NetAddr::IP; # To manage IP Addresses
use Date::Manip; # Needed to manipulate DateTime formats
# of input, output and compare
use Time::Local; # DateTime basic manipulation
use NetAddr::IP; # To manage IP Addresses
use POSIX; # to use ceil() function
use Socket; # to resolve address
use threads;
@ -34,6 +33,7 @@ use threads;
use PandoraFMS::Config;
use PandoraFMS::Tools;
use PandoraFMS::DB;
use PandoraFMS::PingExternal;
# FLUSH in each IO (only for debug, very slooow)
# ENABLED in DEBUGMODE
@ -222,17 +222,13 @@ sub pandora_exec_task {
##############################################################################
sub scan_icmp {
my $p;
my $dest = $_[0];
my $l_timeout = $_[1];
$p = Net::Ping->new("icmp",$l_timeout);
if ($p->ping($dest)) {
$p->close();
$result = ping(hostname => $dest, timeout => $l_timeout, size => 32, count => 1);
if ($result) {
return 1;
} else {
$p->close();
return 0;
return 0;
}
}