Debian Codegraph @

src/centreon/common/bluearc/snmp/mode/interfaces.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 centreon::common::bluearc::snmp::mode::interfaces;
22
23 use base qw(snmp_standard::mode::interfaces);
24
25 use strict;
26 use warnings;
27
28 sub default_oid_filter_name {
29 my ($self, %options) = @_;
30
31 return 'ifdesc';
32 }
33
34 sub default_oid_display_name {
35 my ($self, %options) = @_;
36
37 return 'ifdesc';
38 }
39
40 sub new {
41 my ($class, %options) = @_;
42 my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
43 bless $self, $class;
44
45 return $self;
46 }
47
48 1;
49
50 __END__
51
52 =head1 MODE
53
54 Check interfaces.
55
56 =over 8
57
58 =item B<--add-global>
59
60 Check global port statistics (by default if no --add-* option is set).
61
62 =item B<--add-status>
63
64 Check interface status.
65
66 =item B<--add-duplex-status>
67
68 Check duplex status (with --warning-status and --critical-status).
69
70 =item B<--add-traffic>
71
72 Check interface traffic.
73
74 =item B<--add-errors>
75
76 Check interface errors.
77
78 =item B<--add-cast>
79
80 Check interface cast.
81
82 =item B<--add-speed>
83
84 Check interface speed.
85
86 =item B<--add-volume>
87
88 Check interface data volume between two checks (not supposed to be graphed, useful for BI reporting).
89
90 =item B<--check-metrics>
91
92 If the expression is true, metrics are checked (default: '%{opstatus} eq "up"').
93
94 =item B<--warning-status>
95
96 Define the conditions to match for the status to be WARNING.
97 You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}
98
99 =item B<--critical-status>
100
101 Define the conditions to match for the status to be CRITICAL (default: '%{admstatus} eq "up" and %{opstatus} ne "up"').
102 You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}
103
104 =item B<--warning-*> B<--critical-*>
105
106 Thresholds.
107 Can be: 'total-port', 'total-admin-up', 'total-admin-down', 'total-oper-up', 'total-oper-down',
108 'in-traffic', 'out-traffic', 'in-error', 'in-discard', 'out-error', 'out-discard',
109 'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast',
110 'speed' (b/s).
111
112 =item B<--units-traffic>
113
114 Units of thresholds for the traffic (default: 'percent_delta') ('percent_delta', 'bps', 'counter').
115
116 =item B<--units-errors>
117
118 Units of thresholds for errors/discards (default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter').
119
120 =item B<--units-cast>
121
122 Units of thresholds for communication types (default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter').
123
124 =item B<--nagvis-perfdata>
125
126 Display traffic perfdata to be compatible with nagvis widget.
127
128 =item B<--interface>
129
130 Set the interface (number expected) example: 1,2,... (empty means 'check all interfaces').
131
132 =item B<--name>
133
134 Allows you to define the interface (in option --interface) by name instead of OID index. The name matching mode supports regular expressions.
135
136 =item B<--speed>
137
138 Set interface speed for incoming/outgoing traffic (in Mb).
139
140 =item B<--speed-in>
141
142 Set interface speed for incoming traffic (in Mb).
143
144 =item B<--speed-out>
145
146 Set interface speed for outgoing traffic (in Mb).
147
148 =item B<--map-speed-dsl>
149
150 Get interface speed configuration for interface type 'adsl' and 'vdsl2'.
151
152 Syntax: --map-speed-dsl=interface-src-name,interface-dsl-name
153
154 E.g: --map-speed-dsl=Et0.835,Et0-vdsl2
155
156 =item B<--force-counters64>
157
158 Force to use 64 bits counters only. Can be used to improve performance.
159
160 =item B<--force-counters32>
161
162 Force to use 32 bits counters (even in snmp v2c and v3). Should be used when 64 bits counters are buggy.
163
164 =item B<--reload-cache-time>
165
166 Time in minutes before reloading cache file (default: 180).
167
168 =item B<--oid-filter>
169
170 Define the OID to be used to filter interfaces (default: ifDesc) (values: ifDesc, ifAlias, ifName, IpAddr).
171
172 =item B<--oid-display>
173
174 Define the OID that will be used to name the interfaces (default: ifDesc) (values: ifDesc, ifAlias, ifName, IpAddr).
175
176 =item B<--oid-extra-display>
177
178 Add an OID to display.
179
180 =item B<--display-transform-src> B<--display-transform-dst>
181
182 Modify the interface name displayed by using a regular expression.
183
184 Example: adding --display-transform-src='eth' --display-transform-dst='ens' will replace all occurrences of 'eth' with 'ens'
185
186 =item B<--show-cache>
187
188 Display cache interface data.
189
190 =back
191
192 =cut