mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Improvements in log details v10
This commit is contained in:
parent
6bbb9d5d9b
commit
bd6b57e8c3
@ -409,8 +409,8 @@ sub exec_recon_script ($$$) {
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Guess the OS using xprobe2 or nmap.
|
# Guess the OS using xprobe2 or nmap.
|
||||||
################################################################################
|
################################################################################
|
||||||
sub PandoraFMS::Recon::Base::guess_os($$) {
|
sub PandoraFMS::Recon::Base::guess_os($$;$) {
|
||||||
my ($self, $device) = @_;
|
my ($self, $device, $string_flag) = @_;
|
||||||
|
|
||||||
return $self->{'os_id'}{$device} if defined($self->{'os_id'}{$device});
|
return $self->{'os_id'}{$device} if defined($self->{'os_id'}{$device});
|
||||||
|
|
||||||
@ -432,7 +432,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) {
|
|||||||
my $return = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL`;
|
my $return = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL`;
|
||||||
if ($? == 0) {
|
if ($? == 0) {
|
||||||
if($return =~ /Running OS:(.*)/) {
|
if($return =~ /Running OS:(.*)/) {
|
||||||
return pandora_get_os($self->{'dbh'}, $1);
|
my $str_os = $1;
|
||||||
|
return $str_os if is_enabled($string_flag);
|
||||||
|
return pandora_get_os($self->{'dbh'}, $str_os);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -443,7 +445,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) {
|
|||||||
return OS_OTHER if ($? != 0);
|
return OS_OTHER if ($? != 0);
|
||||||
|
|
||||||
if ($return =~ /Aggressive OS guesses:\s*(.*)/) {
|
if ($return =~ /Aggressive OS guesses:\s*(.*)/) {
|
||||||
return pandora_get_os($self->{'dbh'}, $1);
|
my $str_os = $1;
|
||||||
|
return $str_os if is_enabled($string_flag);
|
||||||
|
return pandora_get_os($self->{'dbh'}, $str_os);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2324,7 +2324,7 @@ sub rcmd_credentials_calculation {
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $id_os = $self->call('guess_os', $target);
|
my $id_os = $self->call('guess_os', $target, 1);
|
||||||
$rcmd->set_host($target);
|
$rcmd->set_host($target);
|
||||||
$rcmd->set_os($id_os);
|
$rcmd->set_os($id_os);
|
||||||
|
|
||||||
@ -2376,6 +2376,8 @@ sub rcmd_credentials_calculation {
|
|||||||
$self->{'summary'}->{'RCMD'} += 1;
|
$self->{'summary'}->{'RCMD'} += 1;
|
||||||
$self->call('message', "RCMD available for $target", 10);
|
$self->call('message', "RCMD available for $target", 10);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
$self->call('message', "Last error ($target|$id_os|$result) was [".$rcmd->get_last_error()."]", 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user