Debian Codegraph @

src/os/solaris/local/mode/lomv120.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 os::solaris::local::mode::lomv120;
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} = 'command_execute';
32
33 $self->{thresholds} = {
34 default => [
35 ['^(?!(OK)$)' => 'CRITICAL']
36 ]
37 };
38
39 $self->{components_exec_load} = 0;
40
41 $self->{components_path} = 'os::solaris::local::mode::lomv120components';
42 $self->{components_module} = ['fan', 'psu', 'voltage', 'sf'];
43 }
44
45 sub command_execute {
46 my ($self, %options) = @_;
47
48 ($self->{stdout}) = $options{custom}->execute_command(
49 command => 'lom',
50 command_options => '-fpv 2>&1',
51 command_path => '/usr/sbin',
52 no_quit => 1
53 );
54 }
55
56 sub new {
57 my ($class, %options) = @_;
58 my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
59 bless $self, $class;
60
61 $options{options}->add_options(arguments => {});
62
63 return $self;
64 }
65
66 1;
67
68 __END__
69
70 =head1 MODE
71
72 Check hardware status for 'v120'.
73
74 Command used: '/usr/sbin/lom -fpv 2>&1'
75
76 =over 8
77
78 =item B<--component>
79
80 Which component to check (default: '.*').
81 Can be: 'fan', 'psu', 'voltage', 'sf'.
82
83 =item B<--filter>
84
85 Exclude the items given as a comma-separated list (example: --filter=fan).
86 You can also exclude items from specific instances: --filter=fan,1
87
88 =item B<--no-component>
89
90 Define the expected status if no components are found (default: critical).
91
92
93 =item B<--threshold-overload>
94
95 Use this option to override the status returned by the plugin when the status label matches a regular expression (syntax: section,status,regexp).
96 Example: --threshold-overload='psu,WARNING,^(?!(ok)$)'
97
98 =back
99
100 =cut