From f41d04710e090245b4f663ecb6b40e0cf2ff5527 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Wed, 18 Mar 2015 14:04:41 +1100 Subject: [PATCH] Fix #6207 Redback ok --- network/redback/snmp/mode/disk.pm | 14 +++++++------- network/redback/snmp/mode/memory.pm | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/network/redback/snmp/mode/disk.pm b/network/redback/snmp/mode/disk.pm index d9873b167..bfeb9df61 100644 --- a/network/redback/snmp/mode/disk.pm +++ b/network/redback/snmp/mode/disk.pm @@ -45,7 +45,7 @@ my $maps_counters = { '0_usage' => { class => 'centreon::plugins::values', obj => undef, set => { key_values => [ - { name => 'display' }, { name => 'free' }, { name => 'used' }, + { name => 'display' }, { name => 'total' }, { name => 'used' }, ], closure_custom_calc => \&custom_usage_calc, closure_custom_output => \&custom_usage_output, @@ -110,7 +110,7 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "filter-name" => { name => 'filter_name' }, + "filter-name:s" => { name => 'filter_name' }, }); foreach (keys %{$maps_counters}) { @@ -153,7 +153,7 @@ sub run { if ($multiple == 1) { $self->{output}->output_add(severity => 'OK', - short_msg => 'All memory usages are ok'); + short_msg => 'All disk usages are ok'); } foreach my $id (sort keys %{$self->{disk_selected}}) { @@ -210,7 +210,7 @@ my $mapping = { sub manage_selection { my ($self, %options) = @_; - $self->{memory_selected} = {}; + $self->{disk_selected} = {}; my $oid_rbnSRStorageEntry = '.1.3.6.1.4.1.2352.2.24.1.2.1.1'; $self->{results} = $self->{snmp}->get_table(oid => $oid_rbnSRStorageEntry, nothing_quit => 1); @@ -228,11 +228,11 @@ sub manage_selection { next; } - $self->{memory_selected}->{$instance} = { display => $result->{rbnSRStorageDescr}, - used => $result->{rbnSRStorageUtilization}, total => $result->{rbnSRStorageSize}}; + $self->{disk_selected}->{$instance} = { display => $result->{rbnSRStorageDescr}, + used => $result->{rbnSRStorageUtilization}, total => $result->{rbnSRStorageSize} * 1024}; } - if (scalar(keys %{$self->{memory_selected}}) <= 0) { + if (scalar(keys %{$self->{disk_selected}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No entry found."); $self->{output}->option_exit(); } diff --git a/network/redback/snmp/mode/memory.pm b/network/redback/snmp/mode/memory.pm index 8ef8da31c..ecba66c34 100644 --- a/network/redback/snmp/mode/memory.pm +++ b/network/redback/snmp/mode/memory.pm @@ -110,7 +110,7 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - "filter-name" => { name => 'filter_name' }, + "filter-name:s" => { name => 'filter_name' }, }); foreach (keys %{$maps_counters}) { @@ -225,7 +225,7 @@ sub manage_selection { } $self->{memory_selected}->{$instance} = { display => $result->{rbnMemoryModule}, - free => $result->{rbnMemoryFreeKBytes}, used => $result->{rbnMemoryKBytesInUse}}; + free => $result->{rbnMemoryFreeKBytes} * 1024, used => $result->{rbnMemoryKBytesInUse} * 1024}; } if (scalar(keys %{$self->{memory_selected}}) <= 0) {