Package org.metricshub.ipmi.client
Class SelEntry
java.lang.Object
org.metricshub.ipmi.client.SelEntry
One entry of the System Event Log, read by
IpmiClient.sel(). A system event (record type
SelRecordType.System) says which sensor reported what, when: sensorType(), sensorNumber(),
event() with its description(), direction() and timestamp(). An OEM
entry keeps its oemData() and, when timestamped, its manufacturerId() and timestamp; an entry
of a reserved record type has nothing but its id() (IPMI 2.0 section 32).-
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the entry: theeventof a system event in the wording ofipmiutil(Upper Critical Going High,Failure detected,Log area reset/cleared; ofipmitoolfor the few eventsipmiutildoes not name, such asInstallation started), with its event/reading type and offset when the specification does not define it, the OEM bytes of an OEM entry in hexadecimal, or the record type of a reserved entry.Returns whether a system event is the assertion of itsevent(a threshold crossed, a failure detected) or its deassertion (back within the threshold, the failure gone).booleanTwo entries are equal when they are the same record: same ID and same 16 bytes.event()Returns what happened, as theReadingTypeof the event offset for the sensor type and event/reading type:UpperCriticalGoingHigh,PowerSupplyFailureDetected,LogAreaReset...byte[]Returns the three event data bytes of a system event as the BMC sent them (IPMI 2.0 table 32-1): the event offset in the low nibble of the first byte, and what its high bits announce for the next two: for a threshold event, the raw reading that triggered it and the threshold, to convert with theFullSensorRecordof the sensor.Returns the event/reading type code of a system event (IPMI 2.0 table 42-1): 01h for a threshold event, 02h to 0Ch for a generic discrete one, 6Fh for a sensor-specific one, 70h to 7Fh for an OEM one.Returns the generator ID of a system event: the slave address (20h for the BMC itself) or system software ID of what logged the event in the low byte, its channel number and LUN in the high byte (IPMI 2.0 section 32.1).inthashCode()intid()Returns the record ID of the entry, unique in the log until it is cleared: the value to giveSelRequest.since(int)to read the entries added after this one.booleanTells whether a system event was reported by the given sensor: the sensor that owns the number of the event, for the owner that logged it.Returns the manufacturer ID (IANA enterprise number) of a timestamped OEM entry.byte[]oemData()Returns the OEM-defined bytes of an OEM entry: 6 for a timestamped one, 13 otherwise (IPMI 2.0 sections 32.2 and 32.3).Returns the age of an event logged before the SEL device had the time, as the seconds since its initialization (IPMI 2.0 section 37.1: the timestamps up to 20000000h are relative); empty whentimestamp()is a date, unspecified or absent.record()Returns the decoded record of the protocol core, for everything else.Returns the number of the sensor that reported a system event, unique for itsgenerator: theSensor.number()of the sensor in the SDR repository.Returns the type of the sensor that reported a system event (IPMI 2.0 table 42-3).Returns when the event was logged, for a system event or a timestamped OEM entry whose timestamp is a date: empty for an entry without timestamp, an unspecified timestamp (FFFFFFFFh), and an event logged before the BMC had the time (preInitSeconds()).toString()type()Returns the record type: a system event, an OEM entry with or without timestamp, or a reserved type.
-
Method Details
-
id
public int id()Returns the record ID of the entry, unique in the log until it is cleared: the value to giveSelRequest.since(int)to read the entries added after this one.- Returns:
- the record ID, 1 to 65534
-
type
Returns the record type: a system event, an OEM entry with or without timestamp, or a reserved type.- Returns:
- the record type
-
timestamp
Returns when the event was logged, for a system event or a timestamped OEM entry whose timestamp is a date: empty for an entry without timestamp, an unspecified timestamp (FFFFFFFFh), and an event logged before the BMC had the time (preInitSeconds()). The offset from UTC that a BMC keeping its SEL time as local time reports (SelEntryList.utcOffsetMinutes()) is applied.- Returns:
- the timestamp
-
preInitSeconds
Returns the age of an event logged before the SEL device had the time, as the seconds since its initialization (IPMI 2.0 section 37.1: the timestamps up to 20000000h are relative); empty whentimestamp()is a date, unspecified or absent.- Returns:
- the seconds since the initialization of the SEL device
-
sensorType
Returns the type of the sensor that reported a system event (IPMI 2.0 table 42-3).- Returns:
- the sensor type, empty for the other record types
-
sensorNumber
Returns the number of the sensor that reported a system event, unique for itsgenerator: theSensor.number()of the sensor in the SDR repository.- Returns:
- the sensor number, empty for the other record types
-
generatorId
Returns the generator ID of a system event: the slave address (20h for the BMC itself) or system software ID of what logged the event in the low byte, its channel number and LUN in the high byte (IPMI 2.0 section 32.1).- Returns:
- the generator ID, empty for the other record types
-
eventType
Returns the event/reading type code of a system event (IPMI 2.0 table 42-1): 01h for a threshold event, 02h to 0Ch for a generic discrete one, 6Fh for a sensor-specific one, 70h to 7Fh for an OEM one.- Returns:
- the event/reading type, empty for the other record types
-
event
Returns what happened, as theReadingTypeof the event offset for the sensor type and event/reading type:UpperCriticalGoingHigh,PowerSupplyFailureDetected,LogAreaReset...ReadingType.UnknownOEMEventfor an OEM sensor type or event/reading type,ReadingType.Unknownfor an offset the specification does not define.- Returns:
- the event, empty for the other record types
-
direction
Returns whether a system event is the assertion of itsevent(a threshold crossed, a failure detected) or its deassertion (back within the threshold, the failure gone).- Returns:
- the direction, empty for the other record types
-
description
Returns a description of the entry: theeventof a system event in the wording ofipmiutil(Upper Critical Going High,Failure detected,Log area reset/cleared; ofipmitoolfor the few eventsipmiutildoes not name, such asInstallation started), with its event/reading type and offset when the specification does not define it, the OEM bytes of an OEM entry in hexadecimal, or the record type of a reserved entry.- Returns:
- the description
-
eventData
public byte[] eventData()Returns the three event data bytes of a system event as the BMC sent them (IPMI 2.0 table 32-1): the event offset in the low nibble of the first byte, and what its high bits announce for the next two: for a threshold event, the raw reading that triggered it and the threshold, to convert with theFullSensorRecordof the sensor.- Returns:
- a copy of the event data, empty for the other record types
-
manufacturerId
Returns the manufacturer ID (IANA enterprise number) of a timestamped OEM entry.- Returns:
- the manufacturer ID, empty for the other record types
-
oemData
public byte[] oemData()Returns the OEM-defined bytes of an OEM entry: 6 for a timestamped one, 13 otherwise (IPMI 2.0 sections 32.2 and 32.3).- Returns:
- a copy of the OEM bytes, empty for the other record types
-
record
Returns the decoded record of the protocol core, for everything else.- Returns:
- the record
-
isFrom
Tells whether a system event was reported by the given sensor: the sensor that owns the number of the event, for the owner that logged it. Thegenerator IDis matched against the owner of the SDR record (its slave address or system software ID, whichever bit 0 says, and its LUN) and the sensor number againstSensor.number(), asipmitool sel elistdoes; the channel number is not compared, as BMCs do not log it consistently.- Parameters:
sensor- a sensor of the SDR repository- Returns:
- whether the event is from that sensor; false for the OEM and reserved entries
-
equals
Two entries are equal when they are the same record: same ID and same 16 bytes. An entry read again after the log was cleared and filled up to its ID again is another entry. -
hashCode
public int hashCode() -
toString
-