| 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 hardware::server::cisco::ucs::snmp::mode::components::resources; |
| 22 |
|
| 23 |
use strict; |
| 24 |
use warnings; |
| 25 |
use Exporter; |
| 26 |
|
| 27 |
our $thresholds; |
| 28 |
our %mapping_presence; |
| 29 |
our %mapping_operability; |
| 30 |
our %mapping_overall_status; |
| 31 |
our %mapping_drive_status; |
| 32 |
|
| 33 |
our @ISA = qw(Exporter); |
| 34 |
our @EXPORT_OK = qw($thresholds %mapping_presence %mapping_operability %mapping_overall_status %mapping_drive_status); |
| 35 |
|
| 36 |
%mapping_drive_status = ( |
| 37 |
0 => 'unknown', |
| 38 |
1 => 'online', |
| 39 |
2 => 'unconfiguredGood', |
| 40 |
3 => 'globalHotSpare', |
| 41 |
4 => 'dedicatedHotSpare', |
| 42 |
5 => 'jbod', |
| 43 |
6 => 'offline', |
| 44 |
7 => 'rebuilding', |
| 45 |
8 => 'copyback', |
| 46 |
9 => 'failed', |
| 47 |
10 => 'unconfiguredBad', |
| 48 |
11 => 'predictiveFailure', |
| 49 |
12 => 'disabledForRemoval', |
| 50 |
13 => 'foreignConfiguration' |
| 51 |
); |
| 52 |
%mapping_presence = ( |
| 53 |
0 => 'unknown', |
| 54 |
1 => 'empty', |
| 55 |
10 => 'equipped', |
| 56 |
11 => 'missing', |
| 57 |
12 => 'mismatch', |
| 58 |
13 => 'equippedNotPrimary', |
| 59 |
20 => 'equippedIdentityUnestablishable', |
| 60 |
21 => 'mismatchIdentityUnestablishable', |
| 61 |
30 => 'inaccessible', |
| 62 |
40 => 'unauthorized', |
| 63 |
100 => 'notSupported' |
| 64 |
); |
| 65 |
%mapping_operability = ( |
| 66 |
0 => 'unknown', |
| 67 |
1 => 'operable', |
| 68 |
2 => 'inoperable', |
| 69 |
3 => 'degraded', |
| 70 |
4 => 'poweredOff', |
| 71 |
5 => 'powerProblem', |
| 72 |
6 => 'removed', |
| 73 |
7 => 'voltageProblem', |
| 74 |
8 => 'thermalProblem', |
| 75 |
9 => 'performanceProblem', |
| 76 |
10 => 'accessibilityProblem', |
| 77 |
11 => 'identityUnestablishable', |
| 78 |
12 => 'biosPostTimeout', |
| 79 |
13 => 'disabled', |
| 80 |
51 => 'fabricConnProblem', |
| 81 |
52 => 'fabricUnsupportedConn', |
| 82 |
81 => 'config', |
| 83 |
82 => 'equipmentProblem', |
| 84 |
83 => 'decomissioning', |
| 85 |
84 => 'chassisLimitExceeded', |
| 86 |
100 => 'notSupported', |
| 87 |
101 => 'discovery', |
| 88 |
102 => 'discoveryFailed', |
| 89 |
104 => 'postFailure', |
| 90 |
105 => 'upgradeProblem', |
| 91 |
106 => 'peerCommProblem', |
| 92 |
107 => 'autoUpgrade', |
| 93 |
108 => 'linkActivateBlocked' |
| 94 |
); |
| 95 |
%mapping_overall_status = ( |
| 96 |
0 => 'indeterminate', |
| 97 |
1 => 'unassociated', |
| 98 |
10 => 'ok', |
| 99 |
11 => 'discovery', |
| 100 |
12 => 'config', |
| 101 |
13 => 'unconfig', |
| 102 |
14 => 'power-off', |
| 103 |
15 => 'restart', |
| 104 |
20 => 'maintenance', |
| 105 |
21 => 'test', |
| 106 |
29 => 'compute-mismatch', |
| 107 |
30 => 'compute-failed', |
| 108 |
31 => 'degraded', |
| 109 |
32 => 'discovery-failed', |
| 110 |
33 => 'config-failure', |
| 111 |
34 => 'unconfig-failed', |
| 112 |
35 => 'test-failed', |
| 113 |
36 => 'maintenance-failed', |
| 114 |
40 => 'removed', |
| 115 |
41 => 'disabled', |
| 116 |
50 => 'inaccessible', |
| 117 |
60 => 'thermal-problem', |
| 118 |
61 => 'power-problem', |
| 119 |
62 => 'voltage-problem', |
| 120 |
63 => 'inoperable', |
| 121 |
101 => 'decommissioning', |
| 122 |
201 => 'bios-restore', |
| 123 |
202 => 'cmos-reset', |
| 124 |
203 => 'diagnostics', |
| 125 |
204 => 'diagnostic-failed' |
| 126 |
); |
| 127 |
|
| 128 |
$thresholds = { |
| 129 |
'default.drivestatus' => [ |
| 130 |
['unknown', 'UNKNOWN'], |
| 131 |
['online', 'OK'], |
| 132 |
['unconfiguredGood', 'OK'], |
| 133 |
['globalHotSpare', 'OK'], |
| 134 |
['dedicatedHotSpare', 'OK'], |
| 135 |
['jbod', 'OK'], |
| 136 |
['offline', 'OK'], |
| 137 |
['rebuilding', 'WARNING'], |
| 138 |
['copyback', 'OK'], |
| 139 |
['failed', 'CRITICAL'], |
| 140 |
['unconfiguredBad', 'CRITICAL'], |
| 141 |
['predictiveFailure', 'WARNING'], |
| 142 |
['disabledForRemoval', 'OK'], |
| 143 |
['foreignConfiguration', 'OK'], |
| 144 |
], |
| 145 |
'default.presence' => [ |
| 146 |
['unknown', 'UNKNOWN'], |
| 147 |
['empty', 'OK'], |
| 148 |
['equipped', 'OK'], |
| 149 |
['missing', 'WARNING'], |
| 150 |
['mismatch', 'WARNING'], |
| 151 |
['equippedNotPrimary', 'OK'], |
| 152 |
['equippedIdentityUnestablishable', 'WARNING'], |
| 153 |
['mismatchIdentityUnestablishable', 'WARNING'], |
| 154 |
['inaccessible', 'UNKNOWN'], |
| 155 |
['unauthorized', 'UNKNOWN'], |
| 156 |
['notSupported', 'WARNING'] |
| 157 |
], |
| 158 |
'default.operability' => [ |
| 159 |
['unknown', 'UNKNOWN'], |
| 160 |
['operable', 'OK'], |
| 161 |
['inoperable', 'CRITICAL'], |
| 162 |
['degraded', 'WARNING'], |
| 163 |
['poweredOff', 'WARNING'], |
| 164 |
['powerProblem', 'CRITICAL'], |
| 165 |
['removed', 'WARNING'], |
| 166 |
['voltageProblem', 'CRITICAL'], |
| 167 |
['thermalProblem', 'CRITICAL'], |
| 168 |
['performanceProblem', 'CRITICAL'], |
| 169 |
['accessibilityProblem', 'WARNING'], |
| 170 |
['identityUnestablishable', 'WARNING'], |
| 171 |
['biosPostTimeout', 'WARNING'], |
| 172 |
['disabled', 'OK'], |
| 173 |
['fabricConnProblem', 'WARNING'], |
| 174 |
['fabricUnsupportedConn', 'WARNING'], |
| 175 |
['config', 'OK'], |
| 176 |
['equipmentProblem', 'CRITICAL'], |
| 177 |
['decomissioning', 'WARNING'], |
| 178 |
['chassisLimitExceeded', 'WARNING'], |
| 179 |
['notSupported', 'WARNING'], |
| 180 |
['discovery', 'OK'], |
| 181 |
['discoveryFailed', 'WARNING'], |
| 182 |
['postFailure', 'WARNING'], |
| 183 |
['upgradeProblem', 'WARNING'], |
| 184 |
['peerCommProblem', 'WARNING'], |
| 185 |
['autoUpgrade', 'OK'] |
| 186 |
], |
| 187 |
'default.overall_status' => [ |
| 188 |
['indeterminate', 'UNKNOWN'], |
| 189 |
['unassociated', 'OK'], |
| 190 |
['ok', 'OK'], |
| 191 |
['discovery', 'OK'], |
| 192 |
['config', 'OK'], |
| 193 |
['unconfig', 'OK'], |
| 194 |
['power-off', 'WARNING'], |
| 195 |
['restart', 'WARNING'], |
| 196 |
['maintenance', 'OK'], |
| 197 |
['test', 'OK'], |
| 198 |
['compute-mismatch', 'WARNING'], |
| 199 |
['compute-failed', 'WARNING'], |
| 200 |
['degraded', 'WARNING'], |
| 201 |
['discovery-failed', 'WARNING'], |
| 202 |
['config-failure', 'WARNING'], |
| 203 |
['unconfig-failed', 'WARNING'], |
| 204 |
['test-failed', 'WARNING'], |
| 205 |
['maintenance-failed', 'WARNING'], |
| 206 |
['removed', 'WARNING'], |
| 207 |
['disabled', 'OK'], |
| 208 |
['inaccessible', 'WARNING'], |
| 209 |
['thermal-problem', 'CRITICAL'], |
| 210 |
['power-problem', 'CRITICAL'], |
| 211 |
['voltage-problem', 'CRITICAL'], |
| 212 |
['inoperable', 'CRITICAL'], |
| 213 |
['decommissioning', 'WARNING'], |
| 214 |
['bios-restore', 'WARNING'], |
| 215 |
['cmos-reset', 'WARNING'], |
| 216 |
['diagnostics', 'OK'], |
| 217 |
['diagnostic-failed', 'WARNING'] |
| 218 |
] |
| 219 |
}; |
| 220 |
|
| 221 |
1; |