mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +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 warnings;
|
@ -33,7 +33,7 @@
|
||||
#
|
||||
####################################################################################
|
||||
|
||||
package network::aruba::common::mode::components::module;
|
||||
package centreon::common::aruba::snmp::mode::components::module;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
@ -33,7 +33,7 @@
|
||||
#
|
||||
####################################################################################
|
||||
|
||||
package network::aruba::common::mode::components::psu;
|
||||
package centreon::common::aruba::snmp::mode::components::psu;
|
||||
|
||||
use strict;
|
||||
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);
|
||||
|
||||
@ -60,12 +60,12 @@ sub check_options {
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ sub run {
|
||||
my $descr = $result->{$oid_sysExtProcessorDescr . '.' . $instance};
|
||||
|
||||
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,
|
||||
$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 strict;
|
||||
use warnings;
|
||||
|
||||
use network::aruba::common::mode::components::fan;
|
||||
use network::aruba::common::mode::components::module;
|
||||
use network::aruba::common::mode::components::psu;
|
||||
use centreon::common::aruba::snmp::mode::components::fan;
|
||||
use centreon::common::aruba::snmp::mode::components::module;
|
||||
use centreon::common::aruba::snmp::mode::components::psu;
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
@ -67,9 +67,9 @@ sub check_options {
|
||||
sub global {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
network::aruba::common::mode::components::fan::check($self);
|
||||
network::aruba::common::mode::components::module::check($self);
|
||||
network::aruba::common::mode::components::psu::check($self);
|
||||
centreon::common::aruba::snmp::mode::components::fan::check($self);
|
||||
centreon::common::aruba::snmp::mode::components::module::check($self);
|
||||
centreon::common::aruba::snmp::mode::components::psu::check($self);
|
||||
}
|
||||
|
||||
sub run {
|
||||
@ -80,11 +80,11 @@ sub run {
|
||||
if ($self->{option_results}->{component} eq 'all') {
|
||||
$self->global();
|
||||
} 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') {
|
||||
network::aruba::common::mode::components::module::check($self);
|
||||
centreon::common::aruba::snmp::mode::components::module::check($self);
|
||||
} 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 {
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'.");
|
||||
$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);
|
||||
|
||||
@ -60,12 +60,12 @@ sub check_options {
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ sub run {
|
||||
my $prct_used = $memory_used * 100 / $total_size;
|
||||
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 ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $memory_used);
|
||||
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);
|
||||
|
||||
@ -118,7 +118,7 @@ sub run {
|
||||
my $prct_used = $total_used * 100 / $total_size;
|
||||
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_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);
|
@ -33,7 +33,7 @@
|
||||
#
|
||||
####################################################################################
|
||||
|
||||
package network::aruba::7200::plugin;
|
||||
package network::aruba::standard::snmp::plugin;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@ -47,13 +47,13 @@ sub new {
|
||||
|
||||
$self->{version} = '1.0';
|
||||
%{$self->{modes}} = (
|
||||
'cpu' => 'network::aruba::common::mode::cpu',
|
||||
'hardware' => 'network::aruba::common::mode::hardware',
|
||||
'cpu' => 'centreon::common::aruba::snmp::mode::cpu',
|
||||
'hardware' => 'centreon::common::aruba::snmp::mode::hardware',
|
||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||
'packet-errors' => 'snmp_standard::mode::packeterrors',
|
||||
'traffic' => 'snmp_standard::mode::traffic',
|
||||
'memory' => 'network::aruba::common::mode::memory',
|
||||
'storage' => 'network::aruba::common::mode::storage',
|
||||
'memory' => 'centreon::common::aruba::snmp::mode::memory',
|
||||
'storage' => 'centreon::common::aruba::snmp::mode::storage',
|
||||
);
|
||||
|
||||
return $self;
|
||||
@ -65,6 +65,6 @@ __END__
|
||||
|
||||
=head1 PLUGIN DESCRIPTION
|
||||
|
||||
Check Aruba 7200 series in SNMP.
|
||||
Check Aruba equipments in SNMP.
|
||||
|
||||
=cut
|
Loading…
x
Reference in New Issue
Block a user