Mender 2.0 - How to get the update progress from standalone mender?

Hi,

I understood that, the mender have logs and we can pipe/grep the logs to get the required data.
But, this is not something recommended to use in our project :zipper_mouth_face:

Hence, I would like to know, how to get the update progress from mender client in standalone mode? Whether I can get the progress via a state script? Should I edit the mender client source to get the progress directly to a file (or some global variable which can pass the progress data to C application)?

Apart from progress, we also need to get the update/fail/rollback status via better API calls which do not have these logs grepping and parsing method.

Please let me know how to achieve this :confused:

Hence, I would like to know, how to get the update progress from mender client in standalone mode?

There is currently no IPC mechanism to get the progress of download state and you can not get this information using state-scripts.

So you would need to change the code, to provide an interface to this information, e.g exposing an HTTP server, or implement D-bus, raw unix sockets or files and there are probably other options as well.

Apart from progress, we also need to get the update/fail/rollback status via better API calls which do not have these logs grepping and parsing method.

It seems that this can be done “outside” of Mender, or using state-scripts to some expect and only for the 2.0 version.

There is one example using d-bus here,

1 Like

@mirzak, May I know how you use the d-bus example with mender? Are you passing the state information from Mender client to Qt GUI? I didn’t get the complete picture by just seeing the scripts so asked :slight_smile:

Actually @texierp, has created these scripts so he can best answer that :slight_smile:

Are you passing the state information from Mender client to Qt GUI?

But I think this is a correct understanding, but these can be easily modified to pass the information to non Qt apps as well as long they can interface with D-bus.

2 Likes

@ajithpv, Yes you’re right, The main idea is to be able to manage the full update process via a simple graphical interface with Qt (QML) for instance (retry later, validation and so on). You can find a very basic implementation (without the GUI), for sure, I’ll try to publish the rest of the project (a little cleaning before :wink:).

As Mirza said, with D-Bus you can work with an another framework. For a generic approach (C/C++), it is possible to use sd-bus also.

1 Like