Clean blanks and HTML entities from recon tasks.
This commit is contained in:
parent
4fb6a26365
commit
fcb75ec1aa
|
@ -858,6 +858,10 @@ sub snmp_responds($$) {
|
||||||
return 1 if (defined($self->get_community($device)));
|
return 1 if (defined($self->get_community($device)));
|
||||||
|
|
||||||
foreach my $community (@{$self->{'communities'}}) {
|
foreach my $community (@{$self->{'communities'}}) {
|
||||||
|
|
||||||
|
# Clean blanks.
|
||||||
|
$community =~ s/\s+//g;
|
||||||
|
|
||||||
`snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v1 -On -Oe -c $community $device .0 2>/dev/null`;
|
`snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v1 -On -Oe -c $community $device .0 2>/dev/null`;
|
||||||
if ($? == 0) {
|
if ($? == 0) {
|
||||||
$self->set_community($device, $community);
|
$self->set_community($device, $community);
|
||||||
|
@ -1036,6 +1040,10 @@ sub scan($) {
|
||||||
$self->call('message', "[1/7] Scanning the network...", 3);
|
$self->call('message', "[1/7] Scanning the network...", 3);
|
||||||
my @subnets = @{$self->get_subnets()};
|
my @subnets = @{$self->get_subnets()};
|
||||||
foreach my $subnet (@subnets) {
|
foreach my $subnet (@subnets) {
|
||||||
|
|
||||||
|
# Clean blanks.
|
||||||
|
$subnet =~ s/\s+//g;
|
||||||
|
|
||||||
my $net_addr = new NetAddr::IP ($subnet);
|
my $net_addr = new NetAddr::IP ($subnet);
|
||||||
if (!defined($net_addr)) {
|
if (!defined($net_addr)) {
|
||||||
$self->call('message', "Invalid network: $subnet", 3);
|
$self->call('message', "Invalid network: $subnet", 3);
|
||||||
|
|
|
@ -153,8 +153,8 @@ sub data_consumer ($$) {
|
||||||
my $nmap_args = '-nsP -PE --max-retries '.$pa_config->{'icmp_checks'}.' --host-timeout '.$pa_config->{'networktimeout'}.'s -T'.$pa_config->{'recon_timing_template'};
|
my $nmap_args = '-nsP -PE --max-retries '.$pa_config->{'icmp_checks'}.' --host-timeout '.$pa_config->{'networktimeout'}.'s -T'.$pa_config->{'recon_timing_template'};
|
||||||
my $np = new PandoraFMS::NmapParser;
|
my $np = new PandoraFMS::NmapParser;
|
||||||
eval {
|
eval {
|
||||||
my @subnets = split(/,/, $task->{'subnet'});
|
my @subnets = split(/,/, safe_output($task->{'subnet'}));
|
||||||
my @communities = split(/,/, $task->{'snmp_community'});
|
my @communities = split(/,/, safe_output($task->{'snmp_community'}));
|
||||||
|
|
||||||
my $recon = new PandoraFMS::Recon::Base(
|
my $recon = new PandoraFMS::Recon::Base(
|
||||||
communities => \@communities,
|
communities => \@communities,
|
||||||
|
|
Loading…
Reference in New Issue