+ Refactor HP server directory (for ilo)
+ Correct local 'vx-disks'
This commit is contained in:
parent
4ea13ffaf9
commit
f3f3689c58
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::blade;
|
package hardware::server::hp::bladechassis::snmp::mode::components::blade;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::enclosure;
|
package hardware::server::hp::bladechassis::snmp::mode::components::enclosure;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::fan;
|
package hardware::server::hp::bladechassis::snmp::mode::components::fan;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::fuse;
|
package hardware::server::hp::bladechassis::snmp::mode::components::fuse;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::manager;
|
package hardware::server::hp::bladechassis::snmp::mode::components::manager;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::network;
|
package hardware::server::hp::bladechassis::snmp::mode::components::network;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::psu;
|
package hardware::server::hp::bladechassis::snmp::mode::components::psu;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::components::temperature;
|
package hardware::server::hp::bladechassis::snmp::mode::components::temperature;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,20 +33,20 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpbladechassis::mode::hardware;
|
package hardware::server::hp::bladechassis::snmp::mode::hardware;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use hardware::server::hpbladechassis::mode::components::enclosure;
|
use hardware::server::hp::bladechassis::snmp::mode::components::enclosure;
|
||||||
use hardware::server::hpbladechassis::mode::components::manager;
|
use hardware::server::hp::bladechassis::snmp::mode::components::manager;
|
||||||
use hardware::server::hpbladechassis::mode::components::fan;
|
use hardware::server::hp::bladechassis::snmp::mode::components::fan;
|
||||||
use hardware::server::hpbladechassis::mode::components::blade;
|
use hardware::server::hp::bladechassis::snmp::mode::components::blade;
|
||||||
use hardware::server::hpbladechassis::mode::components::network;
|
use hardware::server::hp::bladechassis::snmp::mode::components::network;
|
||||||
use hardware::server::hpbladechassis::mode::components::psu;
|
use hardware::server::hp::bladechassis::snmp::mode::components::psu;
|
||||||
use hardware::server::hpbladechassis::mode::components::temperature;
|
use hardware::server::hp::bladechassis::snmp::mode::components::temperature;
|
||||||
use hardware::server::hpbladechassis::mode::components::fuse;
|
use hardware::server::hp::bladechassis::snmp::mode::components::fuse;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
|
@ -71,14 +71,14 @@ sub check_options {
|
||||||
sub global {
|
sub global {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
hardware::server::hpbladechassis::mode::components::enclosure::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::enclosure::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::manager::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::manager::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::fan::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::fan::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::blade::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::blade::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::network::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::network::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::psu::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::psu::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::temperature::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::temperature::check($self);
|
||||||
hardware::server::hpbladechassis::mode::components::fuse::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::fuse::check($self);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
|
@ -89,21 +89,21 @@ 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 'enclosure') {
|
} elsif ($self->{option_results}->{component} eq 'enclosure') {
|
||||||
hardware::server::hpbladechassis::mode::components::enclosure::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::enclosure::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'manager') {
|
} elsif ($self->{option_results}->{component} eq 'manager') {
|
||||||
hardware::server::hpbladechassis::mode::components::manager::check($self, force => 1);
|
hardware::server::hp::bladechassis::snmp::mode::components::manager::check($self, force => 1);
|
||||||
} elsif ($self->{option_results}->{component} eq 'fan') {
|
} elsif ($self->{option_results}->{component} eq 'fan') {
|
||||||
hardware::server::hpbladechassis::mode::components::fan::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::fan::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'blade') {
|
} elsif ($self->{option_results}->{component} eq 'blade') {
|
||||||
hardware::server::hpbladechassis::mode::components::blade::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::blade::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'network') {
|
} elsif ($self->{option_results}->{component} eq 'network') {
|
||||||
hardware::server::hpbladechassis::mode::components::network::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::network::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'psu') {
|
} elsif ($self->{option_results}->{component} eq 'psu') {
|
||||||
hardware::server::hpbladechassis::mode::components::psu::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::psu::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'temperature') {
|
} elsif ($self->{option_results}->{component} eq 'temperature') {
|
||||||
hardware::server::hpbladechassis::mode::components::temperature::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::temperature::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'fuse') {
|
} elsif ($self->{option_results}->{component} eq 'fuse') {
|
||||||
hardware::server::hpbladechassis::mode::components::fuse::check($self);
|
hardware::server::hp::bladechassis::snmp::mode::components::fuse::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 hardware::server::hpbladechassis::plugin;
|
package hardware::server::hp::bladechassis::snmp::plugin;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
@ -47,7 +47,7 @@ sub new {
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
%{$self->{modes}} = (
|
%{$self->{modes}} = (
|
||||||
'hardware' => 'hardware::server::hpbladechassis::mode::hardware',
|
'hardware' => 'hardware::server::hp::bladechassis::snmp::mode::hardware',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::cpu;
|
package hardware::server::hp::proliant::snmp::mode::components::cpu;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::fan;
|
package hardware::server::hp::proliant::snmp::mode::components::fan;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::fca;
|
package hardware::server::hp::proliant::snmp::mode::components::fca;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::ida;
|
package hardware::server::hp::proliant::snmp::mode::components::ida;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::ide;
|
package hardware::server::hp::proliant::snmp::mode::components::ide;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::network;
|
package hardware::server::hp::proliant::snmp::mode::components::network;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::pc;
|
package hardware::server::hp::proliant::snmp::mode::components::pc;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::psu;
|
package hardware::server::hp::proliant::snmp::mode::components::psu;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::sas;
|
package hardware::server::hp::proliant::snmp::mode::components::sas;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::scsi;
|
package hardware::server::hp::proliant::snmp::mode::components::scsi;
|
||||||
# In 'CPQSCSI-MIB.mib'
|
# In 'CPQSCSI-MIB.mib'
|
||||||
|
|
||||||
use strict;
|
use strict;
|
|
@ -33,7 +33,7 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::components::temperature;
|
package hardware::server::hp::proliant::snmp::mode::components::temperature;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
|
@ -33,24 +33,24 @@
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package hardware::server::hpproliant::mode::hardware;
|
package hardware::server::hp::proliant::snmp::mode::hardware;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::mode);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::misc;
|
use centreon::plugins::misc;
|
||||||
use hardware::server::hpproliant::mode::components::cpu;
|
use hardware::server::hp::proliant::snmp::mode::components::cpu;
|
||||||
use hardware::server::hpproliant::mode::components::psu;
|
use hardware::server::hp::proliant::snmp::mode::components::psu;
|
||||||
use hardware::server::hpproliant::mode::components::pc;
|
use hardware::server::hp::proliant::snmp::mode::components::pc;
|
||||||
use hardware::server::hpproliant::mode::components::fan;
|
use hardware::server::hp::proliant::snmp::mode::components::fan;
|
||||||
use hardware::server::hpproliant::mode::components::temperature;
|
use hardware::server::hp::proliant::snmp::mode::components::temperature;
|
||||||
use hardware::server::hpproliant::mode::components::network;
|
use hardware::server::hp::proliant::snmp::mode::components::network;
|
||||||
use hardware::server::hpproliant::mode::components::ida;
|
use hardware::server::hp::proliant::snmp::mode::components::ida;
|
||||||
use hardware::server::hpproliant::mode::components::fca;
|
use hardware::server::hp::proliant::snmp::mode::components::fca;
|
||||||
use hardware::server::hpproliant::mode::components::ide;
|
use hardware::server::hp::proliant::snmp::mode::components::ide;
|
||||||
use hardware::server::hpproliant::mode::components::sas;
|
use hardware::server::hp::proliant::snmp::mode::components::sas;
|
||||||
use hardware::server::hpproliant::mode::components::scsi;
|
use hardware::server::hp::proliant::snmp::mode::components::scsi;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
|
@ -92,31 +92,31 @@ sub global {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->get_system_information();
|
$self->get_system_information();
|
||||||
hardware::server::hpproliant::mode::components::cpu::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::cpu::check($self);
|
||||||
hardware::server::hpproliant::mode::components::psu::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::psu::check($self);
|
||||||
hardware::server::hpproliant::mode::components::pc::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::pc::check($self);
|
||||||
hardware::server::hpproliant::mode::components::fan::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::fan::check($self);
|
||||||
hardware::server::hpproliant::mode::components::temperature::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::temperature::check($self);
|
||||||
hardware::server::hpproliant::mode::components::network::physical_nic($self);
|
hardware::server::hp::proliant::snmp::mode::components::network::physical_nic($self);
|
||||||
hardware::server::hpproliant::mode::components::network::logical_nic($self);
|
hardware::server::hp::proliant::snmp::mode::components::network::logical_nic($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::array_accelerator($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::array_accelerator($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::host_array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::host_array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::external_array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::external_array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::external_array_accelerator($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::external_array_accelerator($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::physical_drive($self);
|
||||||
|
|
||||||
my $total_components = 0;
|
my $total_components = 0;
|
||||||
my $display_by_component = '';
|
my $display_by_component = '';
|
||||||
|
@ -146,37 +146,37 @@ sub component {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
if ($self->{option_results}->{component} eq 'cpu') {
|
if ($self->{option_results}->{component} eq 'cpu') {
|
||||||
hardware::server::hpproliant::mode::components::cpu::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::cpu::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'psu') {
|
} elsif ($self->{option_results}->{component} eq 'psu') {
|
||||||
hardware::server::hpproliant::mode::components::psu::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::psu::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'pc') {
|
} elsif ($self->{option_results}->{component} eq 'pc') {
|
||||||
hardware::server::hpproliant::mode::components::pc::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::pc::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'fan') {
|
} elsif ($self->{option_results}->{component} eq 'fan') {
|
||||||
hardware::server::hpproliant::mode::components::fan::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::fan::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'temperature') {
|
} elsif ($self->{option_results}->{component} eq 'temperature') {
|
||||||
hardware::server::hpproliant::mode::components::temperature::check($self);
|
hardware::server::hp::proliant::snmp::mode::components::temperature::check($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'network') {
|
} elsif ($self->{option_results}->{component} eq 'network') {
|
||||||
hardware::server::hpproliant::mode::components::network::physical_nic($self);
|
hardware::server::hp::proliant::snmp::mode::components::network::physical_nic($self);
|
||||||
hardware::server::hpproliant::mode::components::network::logical_nic($self);
|
hardware::server::hp::proliant::snmp::mode::components::network::logical_nic($self);
|
||||||
} elsif ($self->{option_results}->{component} eq 'storage') {
|
} elsif ($self->{option_results}->{component} eq 'storage') {
|
||||||
hardware::server::hpproliant::mode::components::ida::array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::array_accelerator($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::array_accelerator($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ida::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ida::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::host_array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::host_array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::external_array_controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::external_array_controller($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::external_array_accelerator($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::external_array_accelerator($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::fca::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::fca::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::ide::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::ide::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::sas::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::sas::physical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::controller($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::controller($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::logical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::logical_drive($self);
|
||||||
hardware::server::hpproliant::mode::components::scsi::physical_drive($self);
|
hardware::server::hp::proliant::snmp::mode::components::scsi::physical_drive($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 hardware::server::hpproliant::plugin;
|
package hardware::server::hp::proliant::snmp::plugin;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
@ -47,7 +47,7 @@ sub new {
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
%{$self->{modes}} = (
|
%{$self->{modes}} = (
|
||||||
'hardware' => 'hardware::server::hpproliant::mode::hardware',
|
'hardware' => 'hardware::server::hp::proliant::snmp::mode::hardware',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $self;
|
return $self;
|
|
@ -59,12 +59,14 @@ sub new {
|
||||||
"command1:s" => { name => 'command1', default => 'vxdisk' },
|
"command1:s" => { name => 'command1', default => 'vxdisk' },
|
||||||
"command1-path:s" => { name => 'command1_path', default => '/usr/sbin' },
|
"command1-path:s" => { name => 'command1_path', default => '/usr/sbin' },
|
||||||
"command1-options:s" => { name => 'command1_options', default => 'list 2>&1' },
|
"command1-options:s" => { name => 'command1_options', default => 'list 2>&1' },
|
||||||
|
"skip-vxdisk" => { name => 'skip_vxdisk' },
|
||||||
"sudo2" => { name => 'sudo2' },
|
"sudo2" => { name => 'sudo2' },
|
||||||
"command2:s" => { name => 'command2', default => 'vxprint' },
|
"command2:s" => { name => 'command2', default => 'vxprint' },
|
||||||
"command2-path:s" => { name => 'command2_path', default => '/usr/sbin' },
|
"command2-path:s" => { name => 'command2_path', default => '/usr/sbin' },
|
||||||
"command2-options:s" => { name => 'command2_options', default => '-Ath 2>&1' },
|
"command2-options:s" => { name => 'command2_options', default => '-Ath 2>&1' },
|
||||||
"warning:s" => { name => 'warning', },
|
"skip-vxprint" => { name => 'skip_vxprint' },
|
||||||
"critical:s" => { name => 'critical', },
|
"warning:s" => { name => 'warning' },
|
||||||
|
"critical:s" => { name => 'critical' },
|
||||||
});
|
});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
@ -83,9 +85,9 @@ sub check_options {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
sub vdisk_execute {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $stdout = centreon::plugins::misc::execute(output => $self->{output},
|
my $stdout = centreon::plugins::misc::execute(output => $self->{output},
|
||||||
options => $self->{option_results},
|
options => $self->{option_results},
|
||||||
sudo => $self->{option_results}->{sudo1},
|
sudo => $self->{option_results}->{sudo1},
|
||||||
|
@ -95,43 +97,58 @@ sub run {
|
||||||
my $long_msg = $stdout;
|
my $long_msg = $stdout;
|
||||||
$long_msg =~ s/\|/~/mg;
|
$long_msg =~ s/\|/~/mg;
|
||||||
$self->{output}->output_add(long_msg => $long_msg);
|
$self->{output}->output_add(long_msg => $long_msg);
|
||||||
|
|
||||||
my $stdout2 = centreon::plugins::misc::execute(output => $self->{output},
|
|
||||||
options => $self->{option_results},
|
|
||||||
sudo => $self->{option_results}->{sudo2},
|
|
||||||
command => $self->{option_results}->{command2},
|
|
||||||
command_path => $self->{option_results}->{command2_path},
|
|
||||||
command_options => $self->{option_results}->{command2_options});
|
|
||||||
$long_msg = $stdout2;
|
|
||||||
$long_msg =~ s/\|/~/mg;
|
|
||||||
$self->{output}->output_add(long_msg => $long_msg);
|
|
||||||
|
|
||||||
my $num_errors = 0;
|
|
||||||
my $vxdisks_name = '';
|
|
||||||
foreach (split /\n/, $stdout) {
|
foreach (split /\n/, $stdout) {
|
||||||
if (/(failed)/i ) {
|
if (/(failed)/i ) {
|
||||||
my $status = $1;
|
my $status = $1;
|
||||||
next if (! /\S+\s+\S+\s+(\S+)\s+/);
|
next if (! /\S+\s+\S+\s+(\S+)\s+/);
|
||||||
$num_errors++;
|
$self->{num_errors}++;
|
||||||
$vxdisks_name .= ' [' . $1 . '/' . $status . ']';
|
$self->{vxdisks_name} .= ' [' . $1 . '/' . $status . ']';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vxprint_execute {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $vxprint_name = '';
|
my $stdout = centreon::plugins::misc::execute(output => $self->{output},
|
||||||
foreach (split /\n/, $stdout2) {
|
options => $self->{option_results},
|
||||||
|
sudo => $self->{option_results}->{sudo2},
|
||||||
|
command => $self->{option_results}->{command2},
|
||||||
|
command_path => $self->{option_results}->{command2_path},
|
||||||
|
command_options => $self->{option_results}->{command2_options});
|
||||||
|
my $long_msg = $stdout;
|
||||||
|
$long_msg =~ s/\|/~/mg;
|
||||||
|
$self->{output}->output_add(long_msg => $long_msg);
|
||||||
|
|
||||||
|
foreach (split /\n/, $stdout) {
|
||||||
if (/(NODEVICE|FAILING)/i ) {
|
if (/(NODEVICE|FAILING)/i ) {
|
||||||
my $status = $1;
|
my $status = $1;
|
||||||
next if (! /\S+\s+(\S+)\s+/);
|
next if (! /^\s*\S+\s+(\S+)\s+/);
|
||||||
$num_errors++;
|
$self->{num_errors}++;
|
||||||
$vxprint_name .= ' [' . $1 . '/' . $status . ']';
|
$self->{vxprint_name} .= ' [' . $1 . '/' . $status . ']';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my ($exit_code) = $self->{perfdata}->threshold_check(value => $num_errors,
|
sub run {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
$self->{num_errors} = 0;
|
||||||
|
$self->{vxdisks_name} = '';
|
||||||
|
$self->{vxprint_name} = '';
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{skip_vxdisk})) {
|
||||||
|
$self->vdisk_execute();
|
||||||
|
}
|
||||||
|
if (!defined($self->{option_results}->{skip_vxprint})) {
|
||||||
|
$self->vxprint_execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
my ($exit_code) = $self->{perfdata}->threshold_check(value => $self->{num_errors},
|
||||||
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
if ($num_errors > 0) {
|
if ($self->{num_errors} > 0) {
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
$self->{output}->output_add(severity => $exit_code,
|
||||||
short_msg => sprintf("Problems on some disks:" . $vxdisks_name . $vxdisks_name));
|
short_msg => sprintf("Problems on some disks:" . $self->{vxdisks_name} . $self->{vxprint_name}));
|
||||||
} else {
|
} else {
|
||||||
$self->{output}->output_add(severity => 'OK',
|
$self->{output}->output_add(severity => 'OK',
|
||||||
short_msg => "No problems on disks.");
|
short_msg => "No problems on disks.");
|
||||||
|
@ -217,6 +234,15 @@ Command path (Default: '/usr/sbin').
|
||||||
|
|
||||||
Command options (Default: '-Ath 2>&1').
|
Command options (Default: '-Ath 2>&1').
|
||||||
|
|
||||||
|
=item B<--skip-vxdisk>
|
||||||
|
|
||||||
|
Skip 'vxdisk' command (not executed).
|
||||||
|
|
||||||
|
=item B<--skip-vxprint>
|
||||||
|
|
||||||
|
Skip 'vxprint' command (not executed).
|
||||||
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
Loading…
Reference in New Issue