mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
+ Create a standard aruba
This commit is contained in:
parent
9c0c89ea2b
commit
43e8244fdf
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::components::fan;
|
package centreon::common::aruba::snmp::mode::components::fan;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::components::module;
|
package centreon::common::aruba::snmp::mode::components::module;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::components::psu;
|
package centreon::common::aruba::snmp::mode::components::psu;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::cpu;
|
package centreon::common::aruba::snmp::mode::cpu;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ sub run {
|
|||||||
my $descr = $result->{$oid_sysExtProcessorDescr . '.' . $instance};
|
my $descr = $result->{$oid_sysExtProcessorDescr . '.' . $instance};
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $load,
|
my $exit = $self->{perfdata}->threshold_check(value => $load,
|
||||||
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("CPU '%s': %.2f%% (1min)", $descr,
|
$self->{output}->output_add(long_msg => sprintf("CPU '%s': %.2f%% (1min)", $descr,
|
||||||
$load));
|
$load));
|
@ -33,16 +33,16 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::hardware;
|
package centreon::common::aruba::snmp::mode::hardware;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use network::aruba::common::mode::components::fan;
|
use centreon::common::aruba::snmp::mode::components::fan;
|
||||||
use network::aruba::common::mode::components::module;
|
use centreon::common::aruba::snmp::mode::components::module;
|
||||||
use network::aruba::common::mode::components::psu;
|
use centreon::common::aruba::snmp::mode::components::psu;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
@ -67,9 +67,9 @@ sub check_options {
|
|||||||
sub global {
|
sub global {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
network::aruba::common::mode::components::fan::check($self);
|
centreon::common::aruba::snmp::mode::components::fan::check($self);
|
||||||
network::aruba::common::mode::components::module::check($self);
|
centreon::common::aruba::snmp::mode::components::module::check($self);
|
||||||
network::aruba::common::mode::components::psu::check($self);
|
centreon::common::aruba::snmp::mode::components::psu::check($self);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
@ -80,11 +80,11 @@ sub run {
|
|||||||
if ($self->{option_results}->{component} eq 'all') {
|
if ($self->{option_results}->{component} eq 'all') {
|
||||||
$self->global();
|
$self->global();
|
||||||
} elsif ($self->{option_results}->{component} eq 'fan') {
|
} elsif ($self->{option_results}->{component} eq 'fan') {
|
||||||
network::aruba::common::mode::components::fan::check($self);
|
centreon::common::aruba::snmp::mode::components::fan::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'module') {
|
} elsif ($self->{option_results}->{component} eq 'module') {
|
||||||
network::aruba::common::mode::components::module::check($self);
|
centreon::common::aruba::snmp::mode::components::module::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'psu') {
|
} elsif ($self->{option_results}->{component} eq 'psu') {
|
||||||
network::aruba::common::mode::components::psu::check($self);
|
centreon::common::aruba::snmp::mode::components::psu::check($self);
|
||||||
} else {
|
} else {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::memory;
|
package centreon::common::aruba::snmp::mode::memory;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ sub run {
|
|||||||
my $prct_used = $memory_used * 100 / $total_size;
|
my $prct_used = $memory_used * 100 / $total_size;
|
||||||
my $prct_free = 100 - $prct_used;
|
my $prct_free = 100 - $prct_used;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size);
|
my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size);
|
||||||
my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $memory_used);
|
my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $memory_used);
|
||||||
my ($free_value, $free_unit) = $self->{perfdata}->change_bytes(value => $memory_free);
|
my ($free_value, $free_unit) = $self->{perfdata}->change_bytes(value => $memory_free);
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::common::mode::storage;
|
package centreon::common::aruba::snmp::mode::storage;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ sub run {
|
|||||||
my $prct_used = $total_used * 100 / $total_size;
|
my $prct_used = $total_used * 100 / $total_size;
|
||||||
my $prct_free = 100 - $prct_used;
|
my $prct_free = 100 - $prct_used;
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $total_size);
|
my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $total_size);
|
||||||
my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $total_used);
|
my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $total_used);
|
||||||
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $total_free);
|
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $total_free);
|
@ -33,7 +33,7 @@
|
|||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package network::aruba::7200::plugin;
|
package network::aruba::standard::snmp::plugin;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -47,13 +47,13 @@ sub new {
|
|||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
%{$self->{modes}} = (
|
%{$self->{modes}} = (
|
||||||
'cpu' => 'network::aruba::common::mode::cpu',
|
'cpu' => 'centreon::common::aruba::snmp::mode::cpu',
|
||||||
'hardware' => 'network::aruba::common::mode::hardware',
|
'hardware' => 'centreon::common::aruba::snmp::mode::hardware',
|
||||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||||
'packet-errors' => 'snmp_standard::mode::packeterrors',
|
'packet-errors' => 'snmp_standard::mode::packeterrors',
|
||||||
'traffic' => 'snmp_standard::mode::traffic',
|
'traffic' => 'snmp_standard::mode::traffic',
|
||||||
'memory' => 'network::aruba::common::mode::memory',
|
'memory' => 'centreon::common::aruba::snmp::mode::memory',
|
||||||
'storage' => 'network::aruba::common::mode::storage',
|
'storage' => 'centreon::common::aruba::snmp::mode::storage',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -65,6 +65,6 @@ __END__
|
|||||||
|
|
||||||
=head1 PLUGIN DESCRIPTION
|
=head1 PLUGIN DESCRIPTION
|
||||||
|
|
||||||
Check Aruba 7200 series in SNMP.
|
Check Aruba equipments in SNMP.
|
||||||
|
|
||||||
=cut
|
=cut
|
Loading…
x
Reference in New Issue
Block a user