Debian Codegraph @

src/network/moxa/switch/snmp/mode/interfaces.pm

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