I am trying to monitor Cisco UCS IMC Redfish API using PRTG REST Custom Sensor. The data I want to monitor is the IMC firmware version and its udpate status. From testing, I can get return in JSON format as below
{ "@odata.id": "/redfish/v1/TaskService/Tasks/BmcFwUpdate", "Name": "Task BmcFwUpdate", "@odata.context": "/redfish/v1/$metadata#TaskService/Tasks/Members/$entity", "TaskStatus": "OK", "@odata.type": "#Task.v1_3_0.Task", "Id": "BmcFwUpdate", "TaskState": "Completed", "Oem": { "Cisco": { "FWVersion": "4.0(1d)", "UpdateStatus": "Success (100%)" } }, "Description": "Cisco IMC backup firmware version" }
I setup a template file in %PRTG Install folder%\Custom Sensors\REST folder as below.
{ "prtg": { "description" : { "comment": "Get Cisco UCS IMC firmware version and update status" }, "result": [{ "channel": "FWVersion", "ValueLookup": "prtg.standardlookups.cisco.ucs.fwstatus", "Value": $.Oem.Cisco.FWVersion }, { "channel": "UpdateStatus", "ValueLookup": "prtg.standardlookups.cisco.ucs.fwstatus", "value": $.Oem.Cisco.UpdateStatus } ] } }
After setup the sensor, I got error "Could not create channel FWVersion: expected number but got 4.0(1d) (string)". So it appears the sensor did manage to access the API get the correct data, but as "value" only takes in int and float, the channel creation failed. From PRTG doco https://www.paessler.com/manuals/prtg/custom_sensors I cannot find alternative field to use instead of "value". I tried with "text", but the sensor returns "parsing error". Can anyone help?
Add comment