Completely removed nmap network scans.
(cherry picked from commit 7d40ea754f
)
This commit is contained in:
parent
022734f637
commit
d9764c0f6a
|
@ -1102,14 +1102,6 @@ $DBH = db_connect ('mysql', $CONF{'dbname'}, $CONF{'dbhost'}, $CONF{'dbport'}, $
|
|||
# 0%
|
||||
update_recon_task($DBH, $TASK_ID, 1);
|
||||
|
||||
# Populate ARP caches.
|
||||
message("Populating ARP caches...");
|
||||
my $nmap_args = '-nsP --send-ip --max-retries '.$CONF{'icmp_checks'}.' --host-timeout '.$CONF{'networktimeout'}.'s -T'.$CONF{'recon_timing_template'};
|
||||
my $np = new PandoraFMS::NmapParser;
|
||||
if ($#SUBNETS >= 0) {
|
||||
$np->parsescan($CONF{'nmap'}, $nmap_args, @SUBNETS);
|
||||
}
|
||||
|
||||
# Find routers.
|
||||
message("[1/6] Searching for routers...");
|
||||
if (defined($ROUTER) && $ROUTER ne '') {
|
||||
|
@ -1125,14 +1117,21 @@ if (defined($ROUTER) && $ROUTER ne '') {
|
|||
}
|
||||
}
|
||||
else {
|
||||
my @scanned_hosts = $np->all_hosts();
|
||||
foreach my $host (@scanned_hosts) {
|
||||
next unless defined($host->addr()) and defined($host->status()) and ($host->status() eq 'up');
|
||||
my $np = new PandoraFMS::NmapParser;
|
||||
if ($#SUBNETS >= 0) {
|
||||
$np->parsescan($CONF{'nmap'}, '-nsL', @SUBNETS);
|
||||
|
||||
# Make sure the host is up (nmap gives false positives!).
|
||||
next if (pandora_ping(\%CONF, $host->addr(), 1, 1) == 0);
|
||||
my @scanned_hosts = $np->get_ips();
|
||||
foreach my $host (@scanned_hosts) {
|
||||
|
||||
arp_cache_discovery($host->addr());
|
||||
# Skip network and broadcast addresses.
|
||||
next if ($host =~ m/(\.0$)|(\.255$)/);
|
||||
|
||||
# Check if the host is up.
|
||||
next if (pandora_ping(\%CONF, $host, 1, 1) == 0);
|
||||
|
||||
arp_cache_discovery($host);
|
||||
}
|
||||
}
|
||||
}
|
||||
update_recon_task($DBH, $TASK_ID, 30);
|
||||
|
|
Loading…
Reference in New Issue