I have a monitoring device on one of my computers that I want to pull data from and show it in HA. It’s basically a rest call thru a webservice. So basically I can call it like:
curl -s -k -u admin:<password> https://192.168.0.1:9999/api/v1/queries/check_drivesize/commands/execute?drive=c:
The results are:
{"command":"check_drivesize","lines":[{"message":"OK All 1 drive(s) are ok","perf":{"c: used":{"critical":199.99687156639993,"maximum":222.21874618530273,"minimum":0.00000000000000000,"unit":"GB","value":68.534137725830078,"warning":177.77499694749713},"c: used %":{"critical":90.000000000000000,"maximum":100.00000000000000,"minimum":0.00000000000000000,"unit":"%","value":31.000000000000000,"warning":80.000000000000000}}}],"result":0}
In theory then to break it out:
{
"command":"check_drivesize",
"lines":[
{
"message":"OK All 1 drive(s) are ok",
"perf":{
"c: used":{
"critical":199.99687156639993,
"maximum":222.21874618530273,
"minimum":0.00000000000000000,
"unit":"GB",
"value":67.551097869873047,
"warning":177.77499694749713
},
"c: used %":{
"critical":90.000000000000000,
"maximum":100.00000000000000,
"minimum":0.00000000000000000,
"unit":"%",
"value":30.000000000000000,
"warning":80.000000000000000
}
}
}
],
"result":0
}
So thinking two things I’d want to do if I could figure it out:
-
Create a Gauge that shows how full or empty the drive is based on maximum, minimum and thinking that 68.434 is current used. Also be nice to have the color of the gauge change based on the defined critical values or percentages. Any help with doing this? Thinking if I can understand how to pull the data into HA for this I will be able to figure out all the rest I want to pull in.
-
Get the 0 value at the end. That in theory should be the “OK” that everything is cool with this drive.
Thanks.
JR