Monitor Health and Connectivity of IoT Devices | Exam AZ-220

Investigating Module Twin of Device's edgeAgent

Question

You have smart devices deployed around your IoT solution.

You need to monitor their operation health.

You experience that some of the devices have connectivity issues from time to time.

You know that the $edgeAgent contains health and connectivity data about the edge modules, therefore you start investigating the module twin of the device's edgeAgent:

{ "deviceId": "Windows004", "moduleId": "$edgeAgent", "etag": "AABBBBBAAAU=", "deviceEtag": "KzfgNjA5mDKz", "status": "enabled", "statusUpdateTime": "2020-01-01T00:00:00Z", "connectionState": "Disconnected", "lastActivityTime": "2020-01-01T00:00:00Z", "cloudToDeviceMessageCount": 0, "authenticationType": "sas", "x509Thumbprint": { "primaryThumbprint": null, "secondaryThumbprint": null }, "version": 14, "properties": { "desired": { "···" }, "reported": { "schemaVersion": "2.0", "version": { "···" }, "lastDesiredStatus": { "···" }, "runtime": { "···" }, "systemModules": { "edgeAgent": { "···" }, "edgeHub": { "···" } }, "lastDesiredVersion": 2, "modules": { "TemperatureSensor": { "···" } }, "$metadata": { "···" }, "$version": 22 } } } 
Does it help you investigate the problem?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

Correct Answer: B.

Option A is incorrect because while the edgeAgent is a good starting point to investigate the reason for connectivity issues in general, the given twin sample doesn't really help us.

You might think that the agent's “disconnected” state is the key but unfortunately, it is not.

You should check desired vs.

reported properties, and values like exitcode and lastExitTimeUtc etc.

to get closer to the solution.

Option B is CORRECT because while the “connectionState”: “Disconnected”, this is misleading because the connection state of the IoT Edge agent is always disconnected because this property refers to the device-to-cloud messages and the IoT Edge agent doesn't send messages to the cloud.

Therefore, the connection state of the edgeAgent itself has no clue for connectivity problems.

Reference:

Yes, investigating the module twin of the $edgeAgent can help in monitoring the operation health and diagnosing the connectivity issues of the IoT device.

The module twin provides information about the edge module's status, connection state, and activity time, which can help determine whether the module is working correctly or not. In the given module twin, the "connectionState" property shows that the module is currently disconnected.

In addition, the "reported" property in the module twin contains information about the desired and reported properties of the module, including its version, runtime, and system modules. The "modules" property in the "reported" section shows that the TemperatureSensor module is deployed on the edge device.

Therefore, by analyzing this module twin data, one can get an overview of the IoT device's operation health and connectivity status, and determine if there is any issue with the connectivity of the TemperatureSensor module or the edge device itself.

In summary, investigating the module twin of the $edgeAgent can provide valuable insights into the health and connectivity of an IoT device, making it easier to diagnose any issues and take corrective actions.