From 8c4b52cf7b0024026de3c6a830f121d0515c2746 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Fri, 31 Jan 2014 10:36:44 +0100 Subject: [PATCH] Fix #5153 --- storage/dell/TL2000/mode/globalstatus.pm | 99 ++++++++++++++++++++++++ storage/dell/TL2000/plugin.pm | 66 ++++++++++++++++ storage/ibm/TS3100/mode/globalstatus.pm | 99 ++++++++++++++++++++++++ storage/ibm/TS3100/plugin.pm | 66 ++++++++++++++++ storage/ibm/TS3200/mode/globalstatus.pm | 99 ++++++++++++++++++++++++ storage/ibm/TS3200/plugin.pm | 66 ++++++++++++++++ 6 files changed, 495 insertions(+) create mode 100644 storage/dell/TL2000/mode/globalstatus.pm create mode 100644 storage/dell/TL2000/plugin.pm create mode 100644 storage/ibm/TS3100/mode/globalstatus.pm create mode 100644 storage/ibm/TS3100/plugin.pm create mode 100644 storage/ibm/TS3200/mode/globalstatus.pm create mode 100644 storage/ibm/TS3200/plugin.pm diff --git a/storage/dell/TL2000/mode/globalstatus.pm b/storage/dell/TL2000/mode/globalstatus.pm new file mode 100644 index 000000000..7b39ba55e --- /dev/null +++ b/storage/dell/TL2000/mode/globalstatus.pm @@ -0,0 +1,99 @@ +################################################################################ +# Copyright 2005-2014 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::dell::TL2000::mode::globalstatus; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %states = ( + 1 => ['other', 'WARNING'], + 2 => ['unknown', 'UNKNOWN'], + 3 => ['ok', 'OK'], + 4 => ['non critical', 'WARNING'], + 5 => ['critical', 'CRITICAL'], + 6 => ['nonRecoverable', 'WARNING'], +); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_TL2000StatusGlobalStatus = '.1.3.6.1.4.1.674.10893.2.102.2.1.0'; + my $result = $self->{snmp}->get_leef(oids => [$oid_TL2000StatusGlobalStatus], nothing_quit => 1); + + $self->{output}->output_add(severity => ${$states{$result->{$oid_TL2000StatusGlobalStatus}}}[1], + short_msg => sprintf("Overall global status is '%s'.", + ${$states{$result->{$oid_TL2000StatusGlobalStatus}}}[0])); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check the overall status of the appliance. + +=over 8 + +=back + +=cut + \ No newline at end of file diff --git a/storage/dell/TL2000/plugin.pm b/storage/dell/TL2000/plugin.pm new file mode 100644 index 000000000..17b2d5e9f --- /dev/null +++ b/storage/dell/TL2000/plugin.pm @@ -0,0 +1,66 @@ +################################################################################ +# Copyright 2005-2013 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::dell::TL2000::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_snmp); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'global-status' => 'storage::dell::TL2000::mode::globalstatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Dell TL2000 in SNMP. +Cannot get possible values of some OIDs (even from dell support): +libraryState, driveState, driveClean. + +=cut diff --git a/storage/ibm/TS3100/mode/globalstatus.pm b/storage/ibm/TS3100/mode/globalstatus.pm new file mode 100644 index 000000000..19e77619d --- /dev/null +++ b/storage/ibm/TS3100/mode/globalstatus.pm @@ -0,0 +1,99 @@ +################################################################################ +# Copyright 2005-2014 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::ibm::TS3100::mode::globalstatus; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %states = ( + 1 => ['other', 'WARNING'], + 2 => ['unknown', 'UNKNOWN'], + 3 => ['ok', 'OK'], + 4 => ['non critical', 'WARNING'], + 5 => ['critical', 'CRITICAL'], + 6 => ['nonRecoverable', 'WARNING'], +); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_ibm3100StatusGlobalStatus = '.1.3.6.1.4.1.2.6.210.2.1.0'; + my $result = $self->{snmp}->get_leef(oids => [$oid_ibm3100StatusGlobalStatus], nothing_quit => 1); + + $self->{output}->output_add(severity => ${$states{$result->{$oid_ibm3100StatusGlobalStatus}}}[1], + short_msg => sprintf("Overall global status is '%s'.", + ${$states{$result->{$oid_ibm3100StatusGlobalStatus}}}[0])); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check the overall status of the appliance. + +=over 8 + +=back + +=cut + \ No newline at end of file diff --git a/storage/ibm/TS3100/plugin.pm b/storage/ibm/TS3100/plugin.pm new file mode 100644 index 000000000..228c60c81 --- /dev/null +++ b/storage/ibm/TS3100/plugin.pm @@ -0,0 +1,66 @@ +################################################################################ +# Copyright 2005-2013 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::ibm::TS3100::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_snmp); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'global-status' => 'storage::ibm::TS3100::mode::globalstatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check IBM TS3100 in SNMP. +Cannot get possible values of some OIDs: +libraryState, driveState, driveClean. + +=cut diff --git a/storage/ibm/TS3200/mode/globalstatus.pm b/storage/ibm/TS3200/mode/globalstatus.pm new file mode 100644 index 000000000..cb9904050 --- /dev/null +++ b/storage/ibm/TS3200/mode/globalstatus.pm @@ -0,0 +1,99 @@ +################################################################################ +# Copyright 2005-2014 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::ibm::TS3200::mode::globalstatus; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +my %states = ( + 1 => ['other', 'WARNING'], + 2 => ['unknown', 'UNKNOWN'], + 3 => ['ok', 'OK'], + 4 => ['non critical', 'WARNING'], + 5 => ['critical', 'CRITICAL'], + 6 => ['nonRecoverable', 'WARNING'], +); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{version} = '1.0'; + $options{options}->add_options(arguments => + { + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub run { + my ($self, %options) = @_; + # $options{snmp} = snmp object + $self->{snmp} = $options{snmp}; + + my $oid_ibm3200StatusGlobalStatus = '.1.3.6.1.4.1.2.6.211.2.1.0'; + my $result = $self->{snmp}->get_leef(oids => [$oid_ibm3200StatusGlobalStatus], nothing_quit => 1); + + $self->{output}->output_add(severity => ${$states{$result->{$oid_ibm3200StatusGlobalStatus}}}[1], + short_msg => sprintf("Overall global status is '%s'.", + ${$states{$result->{$oid_ibm3200StatusGlobalStatus}}}[0])); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check the overall status of the appliance. + +=over 8 + +=back + +=cut + \ No newline at end of file diff --git a/storage/ibm/TS3200/plugin.pm b/storage/ibm/TS3200/plugin.pm new file mode 100644 index 000000000..d979af3a8 --- /dev/null +++ b/storage/ibm/TS3200/plugin.pm @@ -0,0 +1,66 @@ +################################################################################ +# Copyright 2005-2013 MERETHIS +# Centreon is developped by : Julien Mathis and Romain Le Merlus under +# GPL Licence 2.0. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation ; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see . +# +# Linking this program statically or dynamically with other modules is making a +# combined work based on this program. Thus, the terms and conditions of the GNU +# General Public License cover the whole combination. +# +# As a special exception, the copyright holders of this program give MERETHIS +# permission to link this program with independent modules to produce an executable, +# regardless of the license terms of these independent modules, and to copy and +# distribute the resulting executable under terms of MERETHIS choice, provided that +# MERETHIS also meet, for each linked independent module, the terms and conditions +# of the license of that module. An independent module is a module which is not +# derived from this program. If you modify this program, you may extend this +# exception to your version of the program, but you are not obliged to do so. If you +# do not wish to do so, delete this exception statement from your version. +# +# For more information : contact@centreon.com +# Authors : Quentin Garnier +# +#################################################################################### + +package storage::ibm::TS3200::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_snmp); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + # $options->{options} = options object + + $self->{version} = '1.0'; + %{$self->{modes}} = ( + 'global-status' => 'storage::ibm::TS3200::mode::globalstatus', + ); + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check IBM TS3200 in SNMP. +Cannot get possible values of some OIDs: +libraryState, driveState, driveClean. + +=cut