Is there a way for a client device to monitor the status and progress of an update?

E.g.

update available
update download started
progress 10%
progress 20%
etc.

(I have seen Mender logging to syslog so I imagine I could parse that and get whether an update is available at least, but is there a way to log or to get the download progress?)

Hi @andrew_wilcox,

You can capture the states and feed them to an third party application using state scripts.

There is no interface to capture the progess (%) and this is only printed when doing an update in standalone mode and is not printed when doing an OTA update.

Now on to to the philosophy behind this :slight_smile:

Doing A/B style updates, which are also refereed to as “seamless updates” means that you can download the update image in the background without interfering with the currently functionality of the application. For this reason it might not be of interesting to even show anything to the user until it is has downloaded and is ready to be installed (essentially a reboot, because download of the update images means that it is streamed to the inactive partition).

That is why we have not really focused on providing this type of information as this is one of the strengths of A/B update style of updates, that you are able to hide a lot of the progress from the user.

We do have tasks for this though, e.g

https://tracker.mender.io/browse/MEN-1617

But hard to prioritize this over everything else that is more interesting, and we would welcome patches in this area.

@andrew_wilcox, If you are using the standalone mode, then easiest way is to pipe the output to a text file for parsing purpose. This can be achieved using the -log-file option with mender in standalone mode.
If -debug option used along with mender, then you will get a lot of information from which you can identify the progress. But, this is not something recommended and consider it as a workaround :slight_smile:

You can capture the states and feed them to an third party application using state scripts.

@mirzak, Is there any sample state script available for doing this activity? Can we modify the mender client (just a thought) to put the status (say in-progress, error, completed etc) into a text file? Third party application can read this text file and get the status :slight_smile:

@mirzak, Is there any sample state script available for doing this activity? Can we modify the mender client (just a thought) to put the status (say in-progress, error, completed etc) into a text file? Third party application can read this text file and get the status :slight_smile:

You can use state-scripts to put the current state in a file, and there is no need to modify the client for this. Note that writing state to file might cause “overruns” as some states are quickly passed trough so would recommend some other communication interface.

I know of this example by @texierp utilizing dbus.

1 Like