
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
iothub-diagnostics
Advanced tools
This tool is provided to help diagnose issues with a device connecting to Azure IoT Hubs.
Note: This tool requires Node.js version 4.x or higher for all features to work.
To install the latest version of the iothub-diagnostics tool run the following command in your command line environment:
npm install -g iothub-diagnostics
iothub-diagnostics [hub connection string]
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
-d, --device use the specified device id (Symmetric Key authentication
only)
-g, --consumerGroup consumer group to use on the Event-hubs compatible
endpoint
To run the tool, from your command prompt execute the following command on windows:
> iothub-diagnostics HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>
or on Linux (it's the same command, but there are quotes around the connection string because ; marks the end of a a command in bash:
$ iothub-diagnostics "HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>"
Note: See Set up IoT Hub for information about how to retrieve your IoT hub connection string.
The tool will run, and will provide high level information about success and failure to the command prompt. Specifically it will:
--device option it will look for an existing device with this device id in the registry:
iothub-diagnostics uses the $Default consumer group. you can use the --consumerGroup option to give it another consumer group if necessary.--device option. If the device identity exists, it must use symmetric keys. If it does not it will be created. If the --deviceId option is not used, a temporary test device identity is created and deleted after the tests.--help option contains directions on how to use iothub-diagnosticsThis is what the output of a successful run will look like:
C:\forks>iothub-diagnostics %IOTHUB_CONNECTION_STRING%
2018-09-02T05:36:49.137Z - info: *******************************************
2018-09-02T05:36:49.145Z - info: * Executing the Microsoft IOT Trace tool. *
2018-09-02T05:36:49.147Z - info: *******************************************
2018-09-02T05:36:49.149Z - info:
2018-09-02T05:36:49.151Z - info: --- Executing network tests ---
2018-09-02T05:36:49.210Z - info:
2018-09-02T05:36:49.213Z - info: Starting DNS resolution for host 'www.microsoft.com'...
2018-09-02T05:36:49.234Z - info: --> Successfully resolved DNS to 23.45.229.117.
2018-09-02T05:36:49.236Z - info:
2018-09-02T05:36:49.238Z - info: Pinging IPV4 address '23.45.229.117'...
2018-09-02T05:36:49.293Z - info: --> Successfully pinged 23.45.229.117
2018-09-02T05:36:49.297Z - info:
2018-09-02T05:36:49.300Z - info: Sending https request to 'https://www.microsoft.com/'
2018-09-02T05:36:49.426Z - info: --> Completed https request
2018-09-02T05:36:49.430Z - info:
2018-09-02T05:36:49.432Z - info: --- Executing IOT Hub tests ---
2018-09-02T05:36:56.366Z - info:
2018-09-02T05:36:56.370Z - info: Starting AMQP Test...
2018-09-02T05:37:01.575Z - info: --> Successfully ran AMQP test.
2018-09-02T05:37:01.582Z - info:
2018-09-02T05:37:01.594Z - info: Starting AMQP/WS Test...
2018-09-02T05:37:07.000Z - info: --> Successfully ran AMQP/WS test.
2018-09-02T05:37:07.021Z - info:
2018-09-02T05:37:07.023Z - info: Starting HTTPS Test...
2018-09-02T05:37:11.915Z - info: --> Successfully ran HTTPS test.
2018-09-02T05:37:11.958Z - info:
2018-09-02T05:37:11.961Z - info: Starting MQTT Test...
2018-09-02T05:37:16.141Z - info: --> Successfully ran MQTT test.
2018-09-02T05:37:16.152Z - info:
2018-09-02T05:37:16.158Z - info: Starting MQTT/WS Test...
2018-09-02T05:37:26.441Z - info: --> Successfully ran MQTT/WS test.
SyntaxError: Use of const in strict mode. - Upgrade your version of node.js to at least 4.x.Unable to parse the connection string. ArgumentError: ... - There was a problem parsing your connection string, verify that the value is correct the message should give informaiton about what is wrong with the supplied value.FAQs
Azure IoT Hub connectivity diagnostic tool
We found that iothub-diagnostics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.