I was wondering if there is an easy interface where my application can read any errors from the mender client.
My use case is the following: I have a device that is running headless and behind a firewall. After connecting the device to the network I want to know if it can connect to all required “internet services”. One of the required services is, of course, mender.
My application controls some LEDs for signaling that a connection to all or some “internet services” is not possible. I am currently working on integrating mender with these status LEDs. Is there any interface where I can check if mender has successfully connected to all it’s backend services (hosted mender)?
Alternatively, what would need to test independently to ensure that mender can connect to all its backend services? For example, is a simple get request to “https://hosted.mender.io” enough or are more ports/protocols required by mender aside from 443/https? (This method has, of course, the drawback that other client errors go unnoticed by my application) I could also use the mender API to check if my device has come online successfully, but I was wondering if there are some functions (like downloading an update) that require more open ports/different protocols that would go unnoticed by this kind of check.
My use case is the following: I have a device that is running headless and behind a firewall. After connecting the device to the network I want to know if it can connect to all required “internet services”. One of the required services is, of course, mender.
Is this after an update? Because the Mender client has a built-in sanity check before it marks an update as successful, and that is that it is able to connect to the server after an update.
Port 443/https should be enough for the communication.
Otherwise, the interface that is available is state-scripts, which could probably be used to detect what you are describing.
I would suspect that the Idle state is only reached once the Mender client has been able to communicate with the server. But I am not 100% sure on this, and would need confirmation from @kacf or @oleorhagen
This would be after the initial deployment (on first boot, after I or someone else installed the device) of the device. But in case of errors, especially connection problems it would be great to always be able to display the current state of the device. But If a “selftest” on port 443/https on hosted.mender.io works, that should be fine too. Will the mender client only connect to hosted.mender.io? (this is important for the firewall/proxy settings)
Because the Mender client has a built-in sanity check before it marks an update as successful, and that is that it is able to connect to the server after an update.
I would like to extend this, the Mender client must be able to communicate with the server (post the deployment status to the server) before it marks the update as successful. So it is more then a connectivity check.
Will the mender client only connect to hosted.mender.io? (this is important for the firewall/proxy settings)
Hm, in the case of Hosted Mender it will also connect to an S3 bucket from which it will download the artifact, can not remember the exact URL (probably s3.mender,io but unsure) but it is visible in the logs of the device which you can inspect.
It is only relevant after every update, it will of course try to connect to the server on each boot as well but no action is taken if it fails in this case.
Will the S3 URL stay the same for the foreseeable future?
I would suspect that the Idle state is only reached once the Mender client has been able to communicate with the server.
I haven’t explicitly checked, but I think it reaches the Idle state whenever it is Idle, even if it has not successfully contacted the server. This follows from the primary use case of the Sync state, which is to turn on wifi when it’s needed, and off again afterwards. Obviously this would need to work also when the server is not reachable.