Skip to content

modbus_tcp collector

modbus_tcp collector performs Modbus TCP requests to collect performance data.

Configuration

ParameterTypeDefaultDescription
idStringCollector's ID. Must be unique per agent instance. Will be returned along with the metrics.
typeStringMust be modbus_tcp
serviceStringEqual to idService id for output metrics
intervalIntegerRepetition interval in seconds
labelsArray of StringsList of additional labels. Will be returned along with metrics
addressStringIP address of Modbus TCP server
portIntegerPort of Modbus TCP server
registerIntegerStarting register of modbus request, zero-based
register_typeStringholdingModbus request type. Either holding, input or coil
formatStringExpected response format. See Response format for details
timeout_msInteger5000Request timeout, ms.
slaveInteger255Optional slave id, see note below.

Check address notation

Take note the starting register address is zero-based, while vendors can document the registers starting from 1. Refer to the vendor documentation and subtract 1 when necessary.

On Slave ID

Modbus TCP specification insists on using slave id of 255 for TCP connections. Meanwhile shome implmenetations await broadcast id (0). Modbust TCP-to-RTU proxies also may expect explicit slave id to process the request.

Collected Metrics

MetricMetric TypePlatformDescription
tsAllISO 8601 Timestamp
collectorAllCollector Id
labelsAllList of labels
valueAllMeasured value

Compilation Features

Enable modbus_tcp feature during compiling the agent (Enabled by default).