mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
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:
parent
2452a7e164
commit
3fb26b5fa7
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
* bin/PandoraFMS: Now contains all .PM files for PandoraFMS.
|
* 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>
|
2007-06-05 Sancho Lerena <slerena@gmail.com>
|
||||||
|
|
||||||
|
@ -21,11 +21,10 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Date::Manip; # Needed to manipulate DateTime formats
|
use Date::Manip; # Needed to manipulate DateTime formats
|
||||||
# of input, output and compare
|
# of input, output and compare
|
||||||
use Time::Local; # DateTime basic manipulation
|
use Time::Local; # DateTime basic manipulation
|
||||||
use Net::Ping; # ICMP
|
use NetAddr::IP; # To manage IP Addresses
|
||||||
use NetAddr::IP; # To manage IP Addresses
|
|
||||||
use POSIX; # to use ceil() function
|
use POSIX; # to use ceil() function
|
||||||
use Socket; # to resolve address
|
use Socket; # to resolve address
|
||||||
use threads;
|
use threads;
|
||||||
@ -34,6 +33,7 @@ use threads;
|
|||||||
use PandoraFMS::Config;
|
use PandoraFMS::Config;
|
||||||
use PandoraFMS::Tools;
|
use PandoraFMS::Tools;
|
||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
use PandoraFMS::PingExternal;
|
||||||
|
|
||||||
# FLUSH in each IO (only for debug, very slooow)
|
# FLUSH in each IO (only for debug, very slooow)
|
||||||
# ENABLED in DEBUGMODE
|
# ENABLED in DEBUGMODE
|
||||||
@ -222,17 +222,13 @@ sub pandora_exec_task {
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
sub scan_icmp {
|
sub scan_icmp {
|
||||||
my $p;
|
|
||||||
my $dest = $_[0];
|
my $dest = $_[0];
|
||||||
my $l_timeout = $_[1];
|
my $l_timeout = $_[1];
|
||||||
|
$result = ping(hostname => $dest, timeout => $l_timeout, size => 32, count => 1);
|
||||||
$p = Net::Ping->new("icmp",$l_timeout);
|
if ($result) {
|
||||||
if ($p->ping($dest)) {
|
|
||||||
$p->close();
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$p->close();
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user