1
package HP::Proliant::Component::EventSubsystem::SNMP;
2
our @ISA = qw(HP::Proliant::Component::EventSubsystem
3
HP::Proliant::Component::SNMP);
6
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 };
13
runtime => $params{runtime},
14
rawdata => $params{rawdata},
18
extendedinfo => undef,
21
$self->overall_init(%params);
29
my $snmpwalk = $params{rawdata};
31
my $cpqHeEventLogSupported = '1.3.6.1.4.1.232.6.2.11.1.0';
32
my $cpqHeEventLogSupportedValue = {
38
my $cpqHeEventLogCondition = '1.3.6.1.4.1.232.6.2.11.2.0';
39
my $cpqHeEventLogConditionValue = {
45
$self->{eventsupp} = SNMP::Utils::get_object_value(
46
$snmpwalk, $cpqHeEventLogSupported,
47
$cpqHeEventLogSupportedValue);
48
$self->{eventstatus} = SNMP::Utils::get_object_value(
49
$snmpwalk, $cpqHeEventLogCondition,
50
$cpqHeEventLogConditionValue);
51
$self->{eventsupp} |= lc $self->{eventsupp};
52
$self->{eventstatus} |= lc $self->{eventstatus};
58
my $snmpwalk = $self->{rawdata};
60
cpqHeEventLogEntry => "1.3.6.1.4.1.232.6.2.11.3.1",
61
cpqHeEventLogEntryNumber => "1.3.6.1.4.1.232.6.2.11.3.1.1",
62
cpqHeEventLogEntrySeverity => "1.3.6.1.4.1.232.6.2.11.3.1.2",
63
cpqHeEventLogEntryClass => "1.3.6.1.4.1.232.6.2.11.3.1.3",
64
cpqHeEventLogEntryCode => "1.3.6.1.4.1.232.6.2.11.3.1.4",
65
cpqHeEventLogEntryCount => "1.3.6.1.4.1.232.6.2.11.3.1.5",
66
cpqHeEventLogInitialTime => "1.3.6.1.4.1.232.6.2.11.3.1.6",
67
cpqHeEventLogUpdateTime => "1.3.6.1.4.1.232.6.2.11.3.1.7",
68
cpqHeEventLogErrorDesc => "1.3.6.1.4.1.232.6.2.11.3.1.8",
70
cpqHeEventLogEntryClassValue => {
71
# 2 Fan Failure (Fan 1, Location I/O Board)
72
# Internal Storage System Overheating (Slot 0, Zone 1, Location Storage, Temperature Unknown)
73
# System Fans Not Redundant (Location I/O Board)
74
# MY MUSTARD: only critical events should lead to an alert, if at all. The caution events mean "loss of redundancy".
75
# We monitor temperatures and fan status anyway.
77
# 3 Corrected Memory Error threshold exceeded (System Memory, Memory Module 1)
78
# Uncorrectable Memory Error detected by ROM-based memory validation (Board 1, Memory Module 4)
79
# MY MUSTARD: threshold exceeded is caution. Uncorrectable errors are critical. Both should be detected anyway.
81
# 4 Accelerator Cache Memory Parity Error (Socket 1)
83
# 5 Processor Correctable error threshold exceeded (Board 0, Processor 2)
85
# 6 Unrecoverable Intermodule Bus error (Error code 0x00000000)
87
# 8 PCI Bus Error (Slot 0, Bus 0, Device 0, Function 0)
89
# 10 1720-S.M.A.R.T. Hard Drive Detects Imminent Failure
90
# POST Error: 201-Memory Error Multi-bit error occurred during memory initialization, Board 1, Bank B. Bank containing DIMM(s) has been disabled..
91
# POST Error: 201-Memory Error Single-bit error occured during memory initialization, Board 1, DIMM 1. Bank containing DIMM(s) has been disabled..
92
# POST Error: 207-Memory Configuration Warning - memory boards should be installed sequentially.
93
# POST Error: 210-Memory Board Failure on board 4.
94
# POST Error: 210-Memory Board Power Fault on board 3.
95
# POST Error: 207-Memory initialization error on Memory Board 5 DIMM 7. The operating system may not have access to all of the memory installed in the system..
96
# POST Error: 207-Invalid Memory Configuration-Mismatched DIMMs within DIMM Bank Memory in Bank A Not Utilized..
97
10 => "POST Messages",
98
11 => "Power Subsystem",
100
# 14 Automatic Operating System Shutdown Initiated Due to Overheat Condition
101
# Automatic Operating System Shutdown Initiated Due to Fan Failure
102
# Blue Screen Trap (BugCheck, STOP: 0x00000050 (0x9CB2C5B4, 0x00000001, 0x00000004, 0x00000000))
103
# Operating System failure (BugCheck, STOP: 0x000000AB (0x00000005, 0x00000488, 0x00000000, 0x00000002))
105
# 15 Unknown Event (Class 15, Code 255)
107
# 17 Network Adapter Link Down (Slot 0, Port 4)
108
# Network Adapters Redundancy Reduced (Slot 0, Port 1)
109
17 => "Network Adapter",
110
# 19 Drive Array Device Failure (Slot 0, Bus 2, Bay 4)
111
# Internal SAS Enclosure Device Failure (Bay 1, Box 1, Port 2I, Slot 1)
113
# 20 An Unrecoverable System Error (NMI) has occurred
114
# Unrecoverable System Error has occurred (Error code 0x01AE0E2F, 0x00000000)
115
20 => "Unrecoverable System Error",
116
# 32 ROM flashed (New version: 01/09/2008)
117
32 => "System Revision",
118
# 33 IML Cleared (Administrator)
119
# IML cleared through HP ProLiant Health Agent (cmahealthd)
120
# Insight Diagnostics Note: Physisches Festplattenlaufwerk 5, Controller Steckplatz 0-Diagnosis: Fehlgeschlagen
121
33 => "Maintenance Note",
122
# 34 New Chassis Connected (Enclosure Address 27AC)
123
# Loss Of Chassis Connectivity (Enclosure Serial Number 8004******)
124
# Server Blade Enclosure Server Blade Inserted (Slot 16, Enclosure Address 0000)
127
cpqHeEventLogEntrySeverityValue => {
128
2 => "informational",
129
3 => "infoWithAlert",
137
# INDEX { cpqHeEventLogEntryNumber }
138
foreach ($self->get_entries($oids, 'cpqHeEventLogEntry')) {
139
if ($_->{cpqHeEventLogInitialTime} =~ /^(([0-9a-fA-F]{2})( [0-9a-fA-F]{2})*)\s*$/) {
140
$_->{cpqHeEventLogInitialTime} =~ s/ //;
141
my ($year, $month, $day, $hour, $min) = map { hex($_) } split(/\s+/, $_->{cpqHeEventLogInitialTime});
143
$_->{cpqHeEventLogInitialTime} = 0;
146
$_->{cpqHeEventLogInitialTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
149
$_->{cpqHeEventLogInitialTime} = 0;
152
} elsif ($_->{cpqHeEventLogInitialTime} =~ /^0x([0-9a-fA-F]{4})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/) {
153
my ($year, $month, $day, $hour, $min) = map { hex($_) } ($1, $2, $3, $4, $5);
155
$_->{cpqHeEventLogInitialTime} = 0;
158
$_->{cpqHeEventLogInitialTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
161
$_->{cpqHeEventLogInitialTime} = 0;
164
} elsif ($_->{cpqHeEventLogInitialTime} =~ /^\0\0\0\0\0\0/) {
165
$_->{cpqHeEventLogInitialTime} = 0;
167
if ($_->{cpqHeEventLogUpdateTime} =~ /^(([0-9a-fA-F]{2})( [0-9a-fA-F]{2})*)\s*$/) {
168
$_->{cpqHeEventLogUpdateTime} =~ s/ //;
169
my ($year, $month, $day, $hour, $min) = map { hex($_) } split(/\s+/, $_->{cpqHeEventLogUpdateTime});
171
$_->{cpqHeEventLogUpdateTime} = 0;
174
$_->{cpqHeEventLogUpdateTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
177
$_->{cpqHeEventLogUpdateTime} = 0;
180
} elsif ($_->{cpqHeEventLogUpdateTime} =~ /^0x([0-9a-fA-F]{4})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/) {
181
my ($year, $month, $day, $hour, $min) = map { hex($_) } ($1, $2, $3, $4, $5);
183
$_->{cpqHeEventLogUpdateTime} = 0;
186
$_->{cpqHeEventLogUpdateTime} = timelocal(0, $min, $hour, $day, $month - 1, $year);
189
$_->{cpqHeEventLogUpdateTime} = 0;
192
} elsif ($_->{cpqHeEventLogUpdateTime} =~ /^\0\0\0\0\0\0/) {
193
$_->{cpqHeEventLogUpdateTime} = 0;
195
if ($_->{cpqHeEventLogErrorDesc} =~ /^(([0-9a-fA-F]{2})(\s+[0-9a-fA-F]{2})*)\s*$/) {
196
$_->{cpqHeEventLogErrorDesc} = join "", map { chr($_) } map { if (hex($_) > 127) { 20; } else { hex($_) } } split(/\s+/, $_->{cpqHeEventLogErrorDesc});
198
push(@{$self->{events}},
199
HP::Proliant::Component::EventSubsystem::Event->new(%{$_}));
206
$self->blacklist('oe', '');
207
if ($self->{eventsupp} && $self->{eventsupp} eq "supported") {
208
if ($self->{eventstatus} eq "ok") {
210
$self->add_info('eventlog system is ok');
213
$self->add_info(sprintf "eventlog system is %s", $self->{eventstatus});
217
$self->add_info('no event status found');