diff --git a/centreon-plugins/os/linux/local/mode/discoverysnmp.pm b/centreon-plugins/os/linux/local/mode/discoverysnmp.pm index 0bececfe3..4cc487fda 100644 --- a/centreon-plugins/os/linux/local/mode/discoverysnmp.pm +++ b/centreon-plugins/os/linux/local/mode/discoverysnmp.pm @@ -166,10 +166,11 @@ sub run { $host{snmp_version} = $last_version; $host{snmp_community} = $last_community; $host{snmp_port} = $self->{option_results}->{snmp_port}; - $host{extra_oids} = {}; + $host{extra_oids} = []; foreach (keys %{$self->{extra_oids}}) { my $label = defined($self->{extra_oids}->{$_}) && $self->{extra_oids}->{$_} ne '' ? $self->{extra_oids}->{$_} : $_; - $host{extra_oids}->{$label} = defined($result->{$_}) ? $result->{$_} : 'unknown'; + my $value = defined($result->{$_}) ? $result->{$_} : 'unknown'; + push @{$host{extra_oids}}, { oid => $label, value => $value }; } push @disco_data, \%host; diff --git a/centreon-plugins/os/linux/local/mode/discoverysnmpv3.pm b/centreon-plugins/os/linux/local/mode/discoverysnmpv3.pm index 8eaaf8237..25c4ae8a5 100644 --- a/centreon-plugins/os/linux/local/mode/discoverysnmpv3.pm +++ b/centreon-plugins/os/linux/local/mode/discoverysnmpv3.pm @@ -200,10 +200,11 @@ sub run { $host{snmp_version} = '3'; $host{snmp_port} = $self->{option_results}->{snmp_port}; $host{snmpv3_extraopts} = $self->{snmpv3_combo}; - $host{extra_oids} = {}; + $host{extra_oids} = []; foreach (keys %{$self->{extra_oids}}) { my $label = defined($self->{extra_oids}->{$_}) && $self->{extra_oids}->{$_} ne '' ? $self->{extra_oids}->{$_} : $_; - $host{extra_oids}->{$label} = defined($snmp_result->{$_}) ? $snmp_result->{$_} : 'unknown'; + my $value = defined($snmp_result->{$_}) ? $snmp_result->{$_} : 'unknown'; + push @{$host{extra_oids}}, { oid => $label, value => $value }; } push @disco_data, \%host;