Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputs.opcua: schema improvements and fix static tag additions #8270

Closed
sjwang90 opened this issue Oct 14, 2020 · 2 comments · Fixed by #8389
Closed

inputs.opcua: schema improvements and fix static tag additions #8270

sjwang90 opened this issue Oct 14, 2020 · 2 comments · Fixed by #8389
Assignees
Labels
area/opcua bug unexpected problem or unintended behavior

Comments

@sjwang90
Copy link
Contributor

Current defects with existing inputs.opcua plugin

Broken Static tag additions

The current plugin config accepts them (standard Telegraf). In this plugin code the measurement is only given tags from the data acquired from OPC-UA. [opcua.tags] is broken and does not alert

  • Expected:
    [opcua.tags]need to be able to add static tags and Telegraf needs to error on incorrect configuration

Schema improvements

The config for a Node in the configuration takes a ’name’ but this is used as the value of the “name” field in the code and the name of the field that contains the value received from OPC-UA in the code.

  • Current schema:
    [tag {name="x”}, field{x=<value>}]
  • Expected:
    Default to a field named value with an optional name_override config to change it to something else.
@sjwang90 sjwang90 added bug unexpected problem or unintended behavior area/opcua influx labels Oct 14, 2020
@sjwang90
Copy link
Contributor Author

sjwang90 commented Nov 5, 2020

Current Config:

[[outputs.influxdb]]
    urls = ["http://xxxxx:8086"]
    database = "telegraf"
    timeout = "0s"
    username = "influx"
    password = "*****"
    retention_policy = ""
[outputs.influxdb.tagpass]
        source = ["telegraf"]

[[inputs.mem]]
[inputs.mem.tags]
    source = "telegraf"
[[inputs.net]]
[inputs.net.tags]
    source = "telegraf"
[[inputs.system]]
[inputs.system.tags]
    source = "telegraf"

[[inputs.opcua_client]]
name = "hostname1"
endpoint = "opc.tcp://xxxxx:12345"
timeout = 60
time_interval = "10s"
security_policy = "None"
security_mode = "None"
nodes = [
                {name="2001_A01", namespace="2", identifier_type="s", identifier="B123_U_XX01.ABCD.A01", data_type="float", description="hostname1 node 01 abcd 2001"},
		{name="2001_A02", namespace="2", identifier_type="s", identifier="B123_U_XX01.ABCD.A02", data_type="float", description="hostname1 node 02 abcd 2001"},
		{name="2001_A03", namespace="2", identifier_type="s", identifier="B123_U_XX01.ABCD.A03", data_type="float", description="hostname1 node 03 abcd 2001"},
....
		]

[[inputs.opcua_client]]
name = "hostname2"
endpoint = "opc.tcp://xxxxx:56789"
timeout = 60
time_interval = "10s"
security_policy = "None"
security_mode = "None"
nodes = [
                {name="2001_AB01", namespace="2", identifier_type="s", identifier="B123_U_XX01.AVG.AB01", data_type="float", description="hostname2 01 abcd 2001"},
		{name="2001_AB02", namespace="2", identifier_type="s", identifier="B123_U_XX01.AVG.AB02", data_type="float", description="hostname2 02 abcd 2001"},
		{name="2001_AB03", namespace="2", identifier_type="s", identifier="B123_U_XX01.AVG.AB03", data_type="float", description="hostname2 03 abcd 2001"},
....
]

Desired config:
Include static tag addition to route metrics to one database versus another.

[inputs.opcua.tags]
    source = "telegraf"

@reimda reimda linked a pull request Dec 4, 2020 that will close this issue
@reimda
Copy link
Contributor

reimda commented Dec 4, 2020

#8389 addresses both of these issues.

We ended up adding tags in a slightly different way than this issue proposes because we needed to add tags to a single opc ua node or a group of nodes. You can still use an inputs.opcua.tags section like before, but you can also add tags directly to a node or to a group of nodes.

We also changed the metric schema by removing the name field and allowing each node to change the metric's field name and each group to change the metric name.

See the plugin's README.md for more information.

@reimda reimda closed this as completed Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/opcua bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants