Read the target device’s IP, credentials, hostname, and metadata, or ping it.
Returns the IP address of the device object.
Signature
Returns
Example
// returns '192.168.1.1' for a device with this local IP address
Returns the MAC address of the device object.
Signature
Returns
Example
// returns '00:11:22:33:44:AA' for a device
Runs an MTR measurement of the network path to the device’s IP address.
MTR combines traceroute and ping: it discovers each hop on the path to
the device and, for every hop, reports packet loss, round-trip time and
jitter.
Signature
D.device.mtr([options], callback)
Parameters
options · `object` · optional
- The options for the MTR measurement.
options.cycles · `number` · optional, default `10`
- The number of measurement cycles (probes sent to each hop). Integer 1–100.
options.max_hops · `number` · optional
- The maximum number of hops to probe (TTL ceiling). Integer 1–255.
options.first_hop · `number` · optional
- The first hop (TTL) to start probing from. Integer 1–255.
options.interval · `number` · optional
- The minimum duration of each probe round, in seconds. 0.1–60.
options.packet_size · `number` · optional, default `84`
- The size of each probe packet, in bytes. Integer 28–1500.
options.protocol · `string` · optional, default `ICMP`
- The probe protocol: `ICMP`, `UDP` or `TCP`.
options.port · `number` · optional
- The target port for `UDP`/`TCP` probes. Integer 1–65535.
options.tos · `number` · optional
- The IP Type-of-Service / DSCP byte. Integer 0–255.
callback · `function`
- The callback function to handle the MTR result.
callback.result · `object` | `null` · optional
- The result of the measurement, or `null` if an error occurred. Contains the following fields:
callback.result.target · `string`
- The IP address that was traced (the device's IP).
callback.result.protocol · `string`
- The probe protocol used.
callback.result.cycles · `number`
- The number of cycles run.
callback.result.packet_size · `number`
- The probe packet size, in bytes.
callback.result.hop_count · `number`
- The number of hops on the path.
callback.result.elapsed_ms · `number` | `null`
- The total measurement time, in milliseconds.
callback.result.hops · `Array.