System and/or container uptime

Hi all,

I was wondering if there was anyway via CLI or API to query the uptime of the system itself and/or the individual containers running on the system.

I can’t see anywhere in the API reference of CLI tool reference that indicates how to do this.

I can of course SSH and get this info however was wondering if there is another way.



if you want to use the API the only way I can see how to get that kind of info is using the created_at fields on the Device and Service resources. Although that won’t be more than an estimate at best and far off the actual numbers in the worst case since it won’t take downtime into account at all.

Another option (and more accurate!) is to run a container on your devices that queries and exposes the uptime somehow

Hello, I believe you mean querying the uptime of the backend components, not your application running on the device. If so, then no, there’s no way to do that. Administering the backend is a separate concern that doesn’t fit with the CLI’s purpose and exposing this info is typically specific to the deployment. It should be trivial to write up a script that SSH’d into your server and queries uptime and logs either from inside the component containers or docker.

Cheers. I can home cook something to give me uptime. It’s just a nice indicator that a remote system hasn’t had any power issues/un-commanded reboots.