Class SelEntry

java.lang.Object
org.metricshub.ipmi.client.SelEntry

public final class SelEntry extends Object
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 Type
    Method
    Description
    Returns a description of the entry: the event of a system event in the wording of ipmiutil (Upper Critical Going High, Failure detected, Log area reset/cleared; of ipmitool for the few events ipmiutil does not name, such as Installation 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 its event (a threshold crossed, a failure detected) or its deassertion (back within the threshold, the failure gone).
    boolean
    equals(Object other)
    Two entries are equal when they are the same record: same ID and same 16 bytes.
    Returns what happened, as the ReadingType of 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 the FullSensorRecord of 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).
    int
     
    int
    id()
    Returns the record ID of the entry, unique in the log until it is cleared: the value to give SelRequest.since(int) to read the entries added after this one.
    boolean
    isFrom(Sensor sensor)
    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.
    Returns the manufacturer ID (IANA enterprise number) of a timestamped OEM entry.
    byte[]
    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 when timestamp() is a date, unspecified or absent.
    Returns the decoded record of the protocol core, for everything else.
    Returns the number of the sensor that reported a system event, unique for its generator: the Sensor.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()).
     
    Returns the record type: a system event, an OEM entry with or without timestamp, or a reserved type.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • id

      public int id()
      Returns the record ID of the entry, unique in the log until it is cleared: the value to give SelRequest.since(int) to read the entries added after this one.
      Returns:
      the record ID, 1 to 65534
    • type

      public SelRecordType type()
      Returns the record type: a system event, an OEM entry with or without timestamp, or a reserved type.
      Returns:
      the record type
    • timestamp

      public Optional<Instant> 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

      public OptionalLong 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 when timestamp() is a date, unspecified or absent.
      Returns:
      the seconds since the initialization of the SEL device
    • sensorType

      public Optional<SensorType> 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

      public OptionalInt sensorNumber()
      Returns the number of the sensor that reported a system event, unique for its generator: the Sensor.number() of the sensor in the SDR repository.
      Returns:
      the sensor number, empty for the other record types
    • generatorId

      public OptionalInt 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

      public OptionalInt 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

      public Optional<ReadingType> event()
      Returns what happened, as the ReadingType of the event offset for the sensor type and event/reading type: UpperCriticalGoingHigh, PowerSupplyFailureDetected, LogAreaReset... ReadingType.UnknownOEMEvent for an OEM sensor type or event/reading type, ReadingType.Unknown for an offset the specification does not define.
      Returns:
      the event, empty for the other record types
    • direction

      public Optional<EventDirection> direction()
      Returns whether a system event is the assertion of its event (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

      public String description()
      Returns a description of the entry: the event of a system event in the wording of ipmiutil (Upper Critical Going High, Failure detected, Log area reset/cleared; of ipmitool for the few events ipmiutil does not name, such as Installation 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 the FullSensorRecord of the sensor.
      Returns:
      a copy of the event data, empty for the other record types
    • manufacturerId

      public OptionalInt 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

      public SelRecord record()
      Returns the decoded record of the protocol core, for everything else.
      Returns:
      the record
    • isFrom

      public boolean isFrom(Sensor sensor)
      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. The generator ID is 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 against Sensor.number(), as ipmitool sel elist does; 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

      public boolean equals(Object other)
      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.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object