Package org.metricshub.ipmi.client
Class Sensor
java.lang.Object
org.metricshub.ipmi.client.Sensor
A sensor of the BMC, with its SDR record and its reading. A threshold sensor (a temperature, a voltage, a fan
speed) has a
reading() converted with the formula of its record and status() against its
thresholds; a discrete sensor (a presence, a power supply state) has its asserted states(). A sensor whose
reading the BMC did not give says why in problem().-
Method Summary
Modifier and TypeMethodDescriptionentity()Returns the entity the sensor monitors.intReturns the instance of the entity the sensor monitors: 1 for the first processor, 2 for the second one.Returns the lower critical threshold, in theunit()of the sensor.Returns the lower non-critical threshold, in theunit()of the sensor.Returns the lower non-recoverable threshold, in theunit()of the sensor.name()Returns the name of the sensor, from the ID string of its record.intnumber()Returns the sensor number, unique for the owner of the sensor.problem()Returns why the sensor has no reading and no states.Returns the reading byte as the BMC sent it, before any conversion.Returns the asserted states of the sensor as the protocol core decodes them.reading()Returns the reading of a threshold sensor, in itsunit(), converted with the formula and the linearization of its record.Returns the reply of the BMC to Get Sensor Reading, as the protocol core decodes it.record()Returns the SDR record of the sensor, as the protocol core decodes it: aFullSensorRecordfor a threshold sensor, aCompactSensorRecordfor a discrete one.states()Returns the asserted states of a discrete sensor, in the wording ofipmiutil("Present", "Device Absent", "Power Supply Failure detected"...; ofipmitoolfor the few statesipmiutildoes not name), each once.status()Returns the status of the sensor: for a threshold sensor, the worst threshold the reading is at or beyond; for a discrete sensor,SensorStatus.OKwhen it answers.toString()type()Returns what the sensor measures or monitors.unit()Returns the unit of the reading and of the thresholds.Returns the upper critical threshold, in theunit()of the sensor.Returns the upper non-critical threshold, in theunit()of the sensor.Returns the upper non-recoverable threshold, in theunit()of the sensor.
-
Method Details
-
name
Returns the name of the sensor, from the ID string of its record.- Returns:
- the name
-
number
public int number()Returns the sensor number, unique for the owner of the sensor.- Returns:
- the sensor number, 0 to 255
-
type
Returns what the sensor measures or monitors.- Returns:
- the sensor type
-
entity
Returns the entity the sensor monitors.- Returns:
- the entity
-
entityInstance
public int entityInstance()Returns the instance of the entity the sensor monitors: 1 for the first processor, 2 for the second one.- Returns:
- the entity instance, 0 to 255
-
unit
Returns the unit of the reading and of the thresholds.- Returns:
- the base unit
-
reading
Returns the reading of a threshold sensor, in itsunit(), converted with the formula and the linearization of its record.- Returns:
- the reading, or empty when the sensor has none: a discrete sensor, an unavailable reading
(
problem()), or a record without analog reading
-
rawReading
Returns the reading byte as the BMC sent it, before any conversion.- Returns:
- the raw reading, 0 to 255, or empty when the reading is unavailable (
problem())
-
status
Returns the status of the sensor: for a threshold sensor, the worst threshold the reading is at or beyond; for a discrete sensor,SensorStatus.OKwhen it answers.- Returns:
- the status,
SensorStatus.UNAVAILABLEwhen the reading is unavailable (problem())
-
states
Returns the asserted states of a discrete sensor, in the wording ofipmiutil("Present", "Device Absent", "Power Supply Failure detected"...; ofipmitoolfor the few statesipmiutildoes not name), each once. The states of a threshold sensor are the thresholds its reading is at or beyond. For an OEM event/reading type, the single state is the hexadecimal state bytes.- Returns:
- the states, empty when none is asserted, when the reading is unavailable, or when the library does
not describe the asserted states (
rawStates()still lists them)
-
rawStates
Returns the asserted states of the sensor as the protocol core decodes them.- Returns:
- the states, empty when none is asserted or when the reading is unavailable
-
lowerNonCritical
Returns the lower non-critical threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it (a threshold of 0 is a threshold)
-
lowerCritical
Returns the lower critical threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it
-
lowerNonRecoverable
Returns the lower non-recoverable threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it
-
upperNonCritical
Returns the upper non-critical threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it
-
upperCritical
Returns the upper critical threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it
-
upperNonRecoverable
Returns the upper non-recoverable threshold, in theunit()of the sensor.- Returns:
- the threshold, or empty when the sensor does not define it
-
problem
Returns why the sensor has no reading and no states.- Returns:
- the problem: the BMC refused the reading (with its completion code), the reading is not valid yet, or scanning is disabled; empty when the sensor has a reading
-
record
Returns the SDR record of the sensor, as the protocol core decodes it: aFullSensorRecordfor a threshold sensor, aCompactSensorRecordfor a discrete one.- Returns:
- the record
-
readingData
Returns the reply of the BMC to Get Sensor Reading, as the protocol core decodes it.- Returns:
- the reply, or empty when the BMC refused the reading
-
toString
-