From 716394e55d03bd81200003414014d351378197ef Mon Sep 17 00:00:00 2001 From: Mya Date: Thu, 20 Oct 2022 17:24:17 +0200 Subject: [PATCH] fix(inputs.modbus): add slave id to failing connection (#12038) --- plugins/inputs/modbus/modbus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/modbus/modbus.go b/plugins/inputs/modbus/modbus.go index 7aeb25b47..a92477810 100644 --- a/plugins/inputs/modbus/modbus.go +++ b/plugins/inputs/modbus/modbus.go @@ -158,7 +158,7 @@ func (m *Modbus) Gather(acc telegraf.Accumulator) error { return fmt.Errorf("disconnecting failed: %w", err) } if err := m.connect(); err != nil { - return fmt.Errorf("connecting failed: %w", err) + return fmt.Errorf("slave %d: connecting failed: %w", slaveID, err) } } continue