Device Health Check by supervisor API?

Is it possible to get the detailed device health report by using the balena supervisor API?

  1. curl "$BALENA_SUPERVISOR_ADDRESS/v1/healthy" - this returns only OK… Curious if I can get the detailed report like the above table?
  2. Does the openBalena support this feature?

Hey, this data is generated from the following scripts (https://github.com/balena-io/device-diagnostics/blob/master/scripts/checks.sh) on the device using the proxy to create an SSH tunnel. openBalena unfortunately doesn’t have the proxy so the functionality for requesting and retrieving this data isn’t possible however we can try to work out a solution.

What do you think about having a Supervisor endpoint that will trigger the check script on device to begin running and then another endpoint for fetching the results. The issue with is since it’s a healthcheck service if there’s any issues with the engine or Supervisor then it would be inaccessible. Alternatively you could SSH to the device and use the script yourself and parse the output.

Let me know what you think about the Supervisor API route or using the script yourself.

Also, let me know if you’re not using openBalena then we can try another route but I like making a feature that openBalena could use to (a solution sans proxy).

Hi, @20k-ultra
Thanks for your reply!

Yeah, we are using the openBalena server.

I think we can trigger the script myself on the device.

Cheers,
Shane.

Hmm, can we get the health check result inside a container?

It works perfectly on balenaOS, but doesn’t work inside the container though I have exported most of features in docker-compose.yml for that container.

So, seems like balena Supervisor API is the way to go?

Cheers,
Shane.

If you find yourself building something that you think could benefit other from, remember openBalena is open source and we can work on the feature together :slight_smile:

Let us know how it goes!

Interested in this very feature myself. Could you share how you pulled this off? Thanks!