Debian Codegraph @

src/storage/emc/celerra/local/mode/getreason.pm

raw
1 #
2 # Copyright 2024 Centreon (http://www.centreon.com/)
3 #
4 # Centreon is a full-fledged industry-strength solution that meets
5 # the needs in IT infrastructure and application monitoring for
6 # service performance.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #
12 # http://www.apache.org/licenses/LICENSE-2.0
13 #
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 #
20
21 package storage::emc::celerra::local::mode::getreason;
22
23 use base qw(centreon::plugins::templates::hardware);
24
25 use strict;
26 use warnings;
27
28 sub set_system {
29 my ($self, %options) = @_;
30
31 $self->{cb_hook2} = 'cmd_execute';
32
33 $self->{thresholds} = {
34 controlstation => [
35 ['Primary Control Station', 'OK'], # 10
36 ['Secondary Control Station', 'OK'], # 11
37 ['Control Station is ready, but is not running NAS service', 'CRITICAL'] # 6
38 ],
39 datamover => [
40 ['Reset (or unknown state)', 'WARNING'],
41 ['DOS boot phase, BIOS check, boot sequence', 'WARNING'],
42 ['SIB POST failures (that is, hardware failures)', 'CRITICAL'],
43 ['DART is loaded on Data Mover, DOS boot and execution of boot.bat, boot.cfg', 'WARNING'],
44 ['DART is ready on Data Mover, running, and MAC threads started', 'WARNING'],
45 ['DART is in contact with Control Station box monitor', 'OK'],
46 ['DART is in panic state', 'CRITICAL'],
47 ['DART reboot is pending or in halted state', 'WARNING'],
48 ['DART panicked and completed memory dump', 'CRITICAL'],
49 ['DM Misc problems', 'CRITICAL'], # code 14
50 ['Data Mover is flashing firmware. DART is flashing BIOS and/or POST firmware. Data Mover cannot be reset', 'CRITICAL'],
51 ['Data Mover Hardware fault detected', 'CRITICAL'],
52 ['DM Memory Test Failure. BIOS detected memory error', 'CRITICAL'],
53 ['DM POST Test Failure. General POST error', 'CRITICAL'],
54 ['DM POST NVRAM test failure. Invalid NVRAM content error', 'CRITICAL'],
55 ['DM POST invalid peer Data Mover type', 'CRITICAL'],
56 ['DM POST invalid Data Mover part number', 'CRITICAL'],
57 ['DM POST Fibre Channel test failure. Error in blade Fibre connection', 'CRITICAL'],
58 ['DM POST network test failure. Error in Ethernet controller', 'CRITICAL'],
59 ['DM T2NET Error. Unable to get blade reason code due to management switch problems', 'CRITICAL']
60 ]
61 };
62
63 $self->{components_path} = 'storage::emc::celerra::local::mode::components';
64 $self->{components_module} = ['controlstation', 'datamover'];
65 }
66
67 sub cmd_execute {
68 my ($self, %options) = @_;
69
70 ($self->{stdout}, my $exit_code) = $options{custom}->execute_command(
71 command => 'getreason',
72 command_path => '/nas/sbin',
73 command_options => '2>&1',
74 no_quit => 1
75 );
76
77 if ($exit_code != 0 && $exit_code != 255) {
78 $self->{output}->add_option_msg(short_msg => "Command error: $self->{stdout}");
79 $self->{output}->option_exit();
80 }
81 }
82
83 sub new {
84 my ($class, %options) = @_;
85 my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
86 bless $self, $class;
87
88 $options{options}->add_options(arguments => {
89 });
90
91 return $self;
92 }
93
94 1;
95
96 __END__
97
98 =head1 MODE
99
100 Check control stations and data movers status.
101
102 Command used: /nas/sbin/getreason 2>&1
103
104 =over 8
105
106 =item B<--component>
107
108 Which component to check (default: '.*').
109 Can be: 'controlstation', 'datamover'.
110
111 =item B<--filter>
112
113 Exclude the items given as a comma-separated list (example: --filter=datamover).
114 You can also exclude items from specific instances: --filter=datamover,slot_2
115
116 =item B<--no-component>
117
118 Define the expected status if no components are found (default: critical).
119
120 =item B<--threshold-overload>
121
122 Use this option to override the status returned by the plugin when the status label matches a regular expression (syntax: section,[instance,]status,regexp).
123 Example: --threshold-overload='datamover,CRITICAL,^(?!(normal)$)'
124
125 =back
126
127 =cut
128