Debian Codegraph @

src/network/adva/fsp150/snmp/mode/components/resources.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 network::adva::fsp150::snmp::mode::components::resources;
22
23 use strict;
24 use warnings;
25 use Exporter;
26
27 our $map_admin_state;
28 our $map_oper_state;
29 our $bits_secondary_state;
30 our $map_card_type;
31 our $oids;
32
33 our @ISA = qw(Exporter);
34 our @EXPORT_OK = qw(
35 $map_admin_state $map_oper_state $bits_secondary_state $map_card_type
36 $oids get_secondary_states
37 );
38
39 $oids = {
40 neName => '.1.3.6.1.4.1.2544.1.12.3.1.1.1.2',
41 shelfEntityIndex => '.1.3.6.1.4.1.2544.1.12.3.1.2.1.2',
42 entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7'
43 };
44
45 $map_admin_state = {
46 1 => 'in-service', 2 => 'management',
47 3 => 'maintenance', 4 => 'disabled',
48 5 => 'unassigned', 6 => 'monitored'
49 };
50 $map_oper_state = {
51 1 => 'normal', 2 => 'outage'
52 };
53 $bits_secondary_state = {
54 0 => 'not-applicable', 1 => 'active',
55 2 => 'automaticinservice', 3 => 'facilityfailure',
56 4 => 'fault', 5 => 'loopback', 6 => 'maintenance',
57 7 => 'mismatchedeqpt', 8 => 'standbyhot',
58 9 => 'supportingentityoutage', 10 => 'unassigned',
59 11 => 'unequipped', 12 => 'disabled',
60 13 => 'forcedoffline', 14 => 'initializing',
61 15 => 'prtcl', 16 => 'blckd', 17 => 'mon-tx',
62 18 => 'mir-rx', 19 => 'cema', 20 => 'lkdo',
63 21 => 'nomber'
64 };
65 $map_card_type = {
66 1 => 'none', 2 => 'psu', 3 => 'fan', 4 => 'nemi',
67 5 => 'scu', 6 => 'eth-10-100-1000-ntu', 7 => 'eth-cpmr',
68 8 => 'eth-ge-101', 9 => 'eth-ge-206', 10 => 'eth-ge-201',
69 11 => 'eth-ge-201se', 12 => 'eth-10-100-1000-nte',
70 13 => 'scu-t', 14 => 'eth-ge-206f', 15 => 'eth-xg-1x',
71 16 => 'swf-140g', 17 => 'stu', 18 => 'eth-ge-10s',
72 19 => 'ami', 20 => 'sti', 21 => 'eth-ge-112',
73 22 => 'eth-ge-114', 23 => 'eth-ge-206v',
74 24 => 'eth-ge-4e-cc', 25 => 'eth-ge-4s-cc',
75 26 => 'eth-xg-210', 27 => 'eth-xg-1x-cc',
76 28 => 'eth-xg-1s-cc', 29 => 'stm1-4-et',
77 30 => 'pwe3-ocnstm', 31 => 'pwe3-e1t1', 32 => 'eth-xg-1x-h',
78 33 => 'eth-ge-10s-h', 34 => 'eth-t1804', 35 => 'eth-t3204',
79 36 => 'eth-ge-syncprobe', 37 => 'eth-ge-8s-cc',
80 38 => 'eth-ge-114h', 39 => 'eth-ge-114ph',
81 40 => 'eth-fe-36e', 41 => 'eth-ge-114sh',
82 42 => 'eth-ge-114s', 43 => 'sti-h', 44 => 'stu-h',
83 45 => 'eth-ge-8e-cc', 46 => 'eth-sh1pcs', 47 => 'eth-osa5411',
84 48 => 'ethGe112Pro', 49 => 'ethGe112ProM',
85 50 => 'ethGe114Pro', 51 => 'ethGe114ProC',
86 52 => 'ethGe114ProSH', 53 => 'ethGe114ProCSH',
87 54 => 'ethGe114ProHE', 55 => 'ethGe112ProH',
88 56 => 'eth-xg-210c', 57 => 'eth-ge-8sc-cc',
89 58 => 'eth-osa5420', 59 => 'eth-osa5421',
90 60 => 'bits-x16', 61 => 'eth-ge-114g',
91 62 => 'ethGe114ProVmH', 63 => 'ethGe114ProVmCH',
92 64 => 'ethGe114ProVmCSH', 65 => 'serverCard',
93 66 => 'eth-ptpv2-osa', 67 => 'gnss-osa',
94 68 => 'thc-osa', 69 => 'sgc-osa', 70 => 'pps-x16',
95 71 => 'clk-x16', 72 => 'todAndPps-x16', 73 => 'eth-ge-101pro',
96 74 => 'ethgo102proS',75 => 'ethgo102proSP',
97 76 => 'ethcx101pro30A', 77 => 'ethcx102pro30A',
98 78 => 'osa-ge-4s', 79 => 'eth-xg-116pro',
99 80 => 'eth-xg-120pro', 81 => 'ethGe112ProVm',
100 82 => 'eth-osa5401', 83 => 'eth-osa5405',
101 84 => 'eth-csm', 85 => 'aux-osa', 86 => 'bits-x16-enhanced',
102 87 => 'osa-ge-4s-protected', 88 => 'eth-ge-102pro-h',
103 89 => 'eth-ge-102pro-efmh', 90 => 'eth-xg-116pro-h',
104 91 => 'ethgo102proSM', 92 => 'eth-xg-118pro-sh',
105 93 => 'eth-xg-118proac-sh', 94 => 'ethGe114ProVmSH',
106 95 => 'ethGe104', 96 => 'eth-xg-120pro-sh'
107 };
108
109 sub get_secondary_states {
110 my (%options) = @_;
111
112 my @bits_str = split //, unpack('B*', $options{state});
113 my $results = [];
114 foreach (keys %$bits_secondary_state) {
115 if ($bits_str[$_]) {
116 push @$results, $bits_secondary_state->{$_};
117 }
118 }
119
120 return $results;
121 }
122
123 1;