discovery os detection

This commit is contained in:
fbsanchez 2019-10-10 17:28:02 +02:00
parent f1ec7d2339
commit 97f246ae60
1 changed files with 6 additions and 4 deletions

View File

@ -360,8 +360,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) {
if (-x $self->{'pa_config'}->{'xprobe2'}) {
my $return = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL`;
if ($? == 0) {
my ($output) = $a =~ /Running OS:(.*)/;
return pandora_get_os($self->{'dbh'}, $output);
if($return =~ /Running OS:(.*)/) {
return pandora_get_os($self->{'dbh'}, $1);
}
}
}
@ -370,8 +371,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) {
my $return = `"$self->{pa_config}->{nmap}" -F -O $device 2>$DEVNULL`;
return OS_OTHER if ($? != 0);
my ($output) = $return =~ /Aggressive OS guesses:\s*(.*)/;
return pandora_get_os($self->{'dbh'}, $output);
if ($return =~ /Aggressive OS guesses:\s*(.*)/) {
return pandora_get_os($self->{'dbh'}, $1);
}
}
return OS_OTHER;