parent
9210c5edb5
commit
f41d04710e
|
@ -45,7 +45,7 @@ my $maps_counters = {
|
||||||
'0_usage' => { class => 'centreon::plugins::values', obj => undef,
|
'0_usage' => { class => 'centreon::plugins::values', obj => undef,
|
||||||
set => {
|
set => {
|
||||||
key_values => [
|
key_values => [
|
||||||
{ name => 'display' }, { name => 'free' }, { name => 'used' },
|
{ name => 'display' }, { name => 'total' }, { name => 'used' },
|
||||||
],
|
],
|
||||||
closure_custom_calc => \&custom_usage_calc,
|
closure_custom_calc => \&custom_usage_calc,
|
||||||
closure_custom_output => \&custom_usage_output,
|
closure_custom_output => \&custom_usage_output,
|
||||||
|
@ -110,7 +110,7 @@ sub new {
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"filter-name" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
|
@ -153,7 +153,7 @@ sub run {
|
||||||
|
|
||||||
if ($multiple == 1) {
|
if ($multiple == 1) {
|
||||||
$self->{output}->output_add(severity => 'OK',
|
$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}}) {
|
foreach my $id (sort keys %{$self->{disk_selected}}) {
|
||||||
|
@ -210,7 +210,7 @@ my $mapping = {
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
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';
|
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,
|
$self->{results} = $self->{snmp}->get_table(oid => $oid_rbnSRStorageEntry,
|
||||||
nothing_quit => 1);
|
nothing_quit => 1);
|
||||||
|
@ -228,11 +228,11 @@ sub manage_selection {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{memory_selected}->{$instance} = { display => $result->{rbnSRStorageDescr},
|
$self->{disk_selected}->{$instance} = { display => $result->{rbnSRStorageDescr},
|
||||||
used => $result->{rbnSRStorageUtilization}, total => $result->{rbnSRStorageSize}};
|
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}->add_option_msg(short_msg => "No entry found.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ sub new {
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"filter-name" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
|
@ -225,7 +225,7 @@ sub manage_selection {
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{memory_selected}->{$instance} = { display => $result->{rbnMemoryModule},
|
$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) {
|
if (scalar(keys %{$self->{memory_selected}}) <= 0) {
|
||||||
|
|
Loading…
Reference in New Issue