[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"
}
{
"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"
}
{
"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"
}
{
"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
|
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/fan_tach/enumerate
|
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/power/enumerate
|
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/sensors/temperature/enumerate
|
|
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"
}
{
"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>
|
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"
}
{
"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"
}
{
"data": 5330,
"message": "200 OK",
"status": "ok"
}
Reference
[1] "OpenBMC" https://github.com/openbmc/
[2] "OpenBMC REST cheat sheet" https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md
[3] "Host Management with OpenBMC" https://github.com/openbmc/docs/blob/master/host-management.md
[4] "OpenBMC REST API" https://github.com/openbmc/docs/blob/master/rest-api.md
[1] "OpenBMC" https://github.com/openbmc/
[2] "OpenBMC REST cheat sheet" https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md
[3] "Host Management with OpenBMC" https://github.com/openbmc/docs/blob/master/host-management.md
[4] "OpenBMC REST API" https://github.com/openbmc/docs/blob/master/rest-api.md
Last Updated: 23-02-2018
No comments:
Post a Comment