From 259a371b3b5c71ce2e0a1cf348166f89e1f5ef0f Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Thu, 3 Oct 2019 12:27:06 +0200 Subject: [PATCH] manage non-accurate oses guess --- centreon-plugins/os/linux/local/mode/discoverynmap.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/os/linux/local/mode/discoverynmap.pm b/centreon-plugins/os/linux/local/mode/discoverynmap.pm index c4f980ce1..c3161d6d6 100644 --- a/centreon-plugins/os/linux/local/mode/discoverynmap.pm +++ b/centreon-plugins/os/linux/local/mode/discoverynmap.pm @@ -129,14 +129,15 @@ sub run { my $results = $self->decode_xml_response( response => $stdout, - ForceArray => ['host', 'port', 'address', 'hostname'] + ForceArray => ['host', 'port', 'address', 'hostname', 'osmatch'] ); foreach my $entry (@{$results->{host}}) { my %host; $host{status} = $entry->{status}->{state}; - $host{os} = $entry->{os}->{osmatch}->{name}; - $host{type} = $self->define_type(desc => $entry->{os}->{osmatch}->{name}); + $host{os} = $entry->{os}->{osmatch}[0]->{name}; + $host{os_accuracy} = $entry->{os}->{osmatch}[0]->{accuracy}; + $host{type} = $self->define_type(desc => $host{os}); $host{ip} = undef; $host{addresses} = undef; $host{hostname} = undef;