Hi!
I want to monitor a production line using the OPC UA Listener.
The production line is controlled by one PLC, and has several stations. Each station provides some basic status information like if its running, cycle time, whatever.
So, I wrote this telegraf config:
[[inputs.opcua_listener]]
endpoint = "opc.tcp://ThePLC:4840"
[[inputs.opcua_listener.group]]
name = "OpcTelegraf"
namespace = "3"
identifier_type = "s"
default_tags = { Plc = "ThePLC" }
nodes = [
{identifier="Station1.Status", name="Status"},
{identifier="Station2.Status", name="Status"},
{identifier="Station3.Status", name="Status"}
]
and expect an output to influx like
opcua,id=ns\=3;s\=Station1 Status="Running",Quality="OK (0x0)" 1597....
opcua,id=ns\=3;s\=Station2 Status="Error",Quality="OK (0x0)" 1597....
opcua,id=ns\=3;s\=Station3 Status="Waiting",Quality="OK (0x0)" 1597....
However, telegraf throws an error:
Error running agent: could not initialize input inputs.opcua_listener: name “Status” is duplicated (metric name “OpcTelegraf”, tags “Plc=ThePLC”)
This is unexpected, and I don’t understand the reasoning behind. From an Influx point of view, same data from different sources should be stored in the same field name, while the source is written to a tag (and the source already IS written to tags). This would allow simple queries like SELECT “Status”… GROUP BY “id“.
Am I missing something? How can I use the same name?
