Completely removed nmap network scans.
This commit is contained in:
parent
358c192e5e
commit
7d40ea754f
|
@ -1102,14 +1102,6 @@ $DBH = db_connect ('mysql', $CONF{'dbname'}, $CONF{'dbhost'}, $CONF{'dbport'}, $
|
||||||
# 0%
|
# 0%
|
||||||
update_recon_task($DBH, $TASK_ID, 1);
|
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.
|
# Find routers.
|
||||||
message("[1/6] Searching for routers...");
|
message("[1/6] Searching for routers...");
|
||||||
if (defined($ROUTER) && $ROUTER ne '') {
|
if (defined($ROUTER) && $ROUTER ne '') {
|
||||||
|
@ -1125,14 +1117,21 @@ if (defined($ROUTER) && $ROUTER ne '') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my @scanned_hosts = $np->all_hosts();
|
my $np = new PandoraFMS::NmapParser;
|
||||||
|
if ($#SUBNETS >= 0) {
|
||||||
|
$np->parsescan($CONF{'nmap'}, '-nsL', @SUBNETS);
|
||||||
|
|
||||||
|
my @scanned_hosts = $np->get_ips();
|
||||||
foreach my $host (@scanned_hosts) {
|
foreach my $host (@scanned_hosts) {
|
||||||
next unless defined($host->addr()) and defined($host->status()) and ($host->status() eq 'up');
|
|
||||||
|
|
||||||
# Make sure the host is up (nmap gives false positives!).
|
# Skip network and broadcast addresses.
|
||||||
next if (pandora_ping(\%CONF, $host->addr(), 1, 1) == 0);
|
next if ($host =~ m/(\.0$)|(\.255$)/);
|
||||||
|
|
||||||
arp_cache_discovery($host->addr());
|
# 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);
|
update_recon_task($DBH, $TASK_ID, 30);
|
||||||
|
|
Loading…
Reference in New Issue