Pages

Thursday, January 25, 2018

[curl] OpenBMC Sensors

List Sensor Type
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/
{
  "data": [
    "/xyz/openbmc_project/sensors/power",
    "/xyz/openbmc_project/sensors/voltage",
    "/xyz/openbmc_project/sensors/temperature",
    "/xyz/openbmc_project/sensors/fan_tach"
  ],
  "message": "200 OK",
  "status": "ok"
}


List All Sensors Name
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/list

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/list
{
  "data": [
    "/xyz/openbmc_project/sensors/voltage/P1V1_CPU0",
    "/xyz/openbmc_project/sensors/temperature/ambient",
    "/xyz/openbmc_project/sensors/fan_tach/FAN_TACH0",
    "/xyz/openbmc_project/sensors/voltage/P5V",
    "/xyz/openbmc_project/sensors/power/IO_A_Power",
    "/xyz/openbmc_project/sensors/voltage/P12V_1"
  ],
  "message": "200 OK",
  "status": "ok"
}


Get All Sensors Reading
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/enumerate

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/enumerate
{
  "data": {
    "/xyz/openbmc_project/sensors/fan_tach/FAN_TACH0": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 1,
      "CriticalHigh": 25500,
      "CriticalLow": 0,
      "Scale": 0,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
      "Value": 0,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 1,
      "WarningHigh": 25400,
      "WarningLow": 100
    },
...
    "/xyz/openbmc_project/sensors/power/IO_A_Power": {
      "Scale": -6,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
      "Value": 111000000
    },
...
    "/xyz/openbmc_project/sensors/temperature/ambient": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 0,
      "CriticalHigh": 80000,
      "CriticalLow": 0,
      "Scale": -3,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
      "Value": 31500,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 0,
      "WarningHigh": 75000,
      "WarningLow": 10000
    },
...
    "/xyz/openbmc_project/sensors/voltage/P5V": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 0,
      "CriticalHigh": 5750,
      "CriticalLow": 4250,
      "Scale": -3,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
      "Value": 5330,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 0,
      "WarningHigh": 5500,
      "WarningLow": 4500
    }
  },
  "message": "200 OK",
  "status": "ok"
}


Get Sensors Reading by Sensor Type
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/<Sensor_Type>/enumerate
fan_tach
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/fan_tach/enumerate
power
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/power/enumerate
temperature
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/temperature/enumerate
voltage
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/voltage/enumerate

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/voltage/enumerate
{
  "data": {
    "/xyz/openbmc_project/sensors/voltage/P12V_1": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 0,
      "CriticalHigh": 13800,
      "CriticalLow": 10200,
      "Scale": -3,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
      "Value": 12312,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 0,
      "WarningHigh": 13200,
      "WarningLow": 10800
    },
    "/xyz/openbmc_project/sensors/voltage/P1V1_CPU0": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 0,
      "CriticalHigh": 1265,
      "CriticalLow": 935,
      "Scale": -3,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
      "Value": 1142,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 0,
      "WarningHigh": 1210,
      "WarningLow": 990
    },
    "/xyz/openbmc_project/sensors/voltage/P5V": {
      "CriticalAlarmHigh": 0,
      "CriticalAlarmLow": 0,
      "CriticalHigh": 5750,
      "CriticalLow": 4250,
      "Scale": -3,
      "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
      "Value": 5330,
      "WarningAlarmHigh": 0,
      "WarningAlarmLow": 0,
      "WarningHigh": 5500,
      "WarningLow": 4500
    }
  },
  "message": "200 OK",
  "status": "ok"
}


Get Sensor Reading by Name
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/<Sensor_Type>/<Sensor_Name>
NOTE: Command is case-sensitive

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/voltage/P5V
{
  "data": {
    "CriticalAlarmHigh": 0,
    "CriticalAlarmLow": 0,
    "CriticalHigh": 5750,
    "CriticalLow": 4250,
    "Scale": -3,
    "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
    "Value": 5330,
    "WarningAlarmHigh": 0,
    "WarningAlarmLow": 0,
    "WarningHigh": 5500,
    "WarningLow": 4500
  },
  "message": "200 OK",
  "status": "ok"
}


Get Sensor Value by Name
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/<Sensor_Type>/<Sensor_Name>/attr/Value

For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/sensors/voltage/P5V/attr/Value
{
  "data": 5330,
  "message": "200 OK",
  "status": "ok"
}




Last Updated: 23-02-2018

No comments:

Post a Comment