-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
OPC UA Events based plugin #8083
Comments
Hello, As for the manufacturer of the opc ua server, this is an interesting topic. I would like to note that in opc ua, events mean a special system (https://reference.opcfoundation.org/v104/Core/docs/Part3/4.6.1/), so I would suggest a different plugin name, such as opcua_subscription. |
I think that "subscription" mode should be a feature of the actual plugin. Every other configuration option like tags or items, nodes, types, will be the same in both plugins. I think it makes no sense to have duplicated plugins. On the other hand, having a plugin to get "OPC UA Events" like @dalekseev-monokot commented probably makes sense on it's own. |
Yes, I also agree with @gavioto , usually polling and subscription are implemented as a OPC UA client configuration layer. I also want to draw your attention to the fact that in addition to improved performance, the subscription mechanism solves two very important problems:
It seems to me that the plugin should be designed to solve these tasks as well. |
Any update on this? A newer version released with pub/sub method for OPC UA plugin? |
Adding this community query to the support for this feature: https://community.influxdata.com/t/telegraf-opc-ua-data-incoming-with-1ms-speed-but-influxdb-only-showing-10-sec-intervals/22836/4 |
I would very much prefer a subscription type model. Additionally I have problems with Red Lion DA 10 servers, since they do not seem to support registered reads (see #9551 ). Normal reading and subscriptions seem to work in the gopcua examples. See also gopcua/opcua#478 |
I have implemented a prototype to connect to a server using OPC UA subscriptions. Currently, I only implemented I believe this should not be a separate plugin, but simply an extension to the existing input plugin. For this reason I have refactored the existing input plugin to reuse as much code as possible. This seems to work very well so far. The refactor was quite extensive, as I needed the existing code to be much more modular than it was. The refactor also allows some of the code to be reused for an OPC UA output plugin. In my opinion, the refactor makes this much easier. @sjwang90 I am planning to create a pull request soon. Do you want me to make one pull request for the refactor and the subscription feature, or should I split this up in separate pull requests? |
@LarsStegman I agree with your idea of sticking to a single plugin. You could for example extend the |
You want to specify per node whether it should use a request, event or subscription. I do not entirely agree with that. My implementation is on a plugin instance level. All nodes specified in the config are either requested or subscribed to. If you want to subscribe to certain nodes and request others, you can instantiate multiple instances of the plugin: one for subscriptions and one for requests:
|
The implementation you describe would also be perfectly acceptable for my use case. |
@LarsStegman I look forward to your PR! |
@LarsStegman any update on this? |
Yes, the PR is ready to go, but I'm still waiting on the go ahead from the legal department. |
@LarsStegman Let me know if there's any legal logistics I can help with on the Influx side. |
Should we put a deadline on this? And start parallel development of the subscription feature if it is exceeded? Seems that we now are in a bit of a deadlock for such an in demand feature. |
@LarsStegman were you able to work through your legal department? As @sjwang90 mentioned we are happy to help out if you need anything from InlfuxData. @R290 - yeah let's see if we get a response. Otherwise, is this something you are interested in contributing? Otherwise I was going to add to the team's Q4 list to see where it might land in priorities. |
I'm still waiting on confirmation. I'll ask again this week. |
Shall we set the deadline date on something like the 1st of October? This is about 6 weeks from now and should be enough time to arrive at a conclusion w.r.t. the legal department? @powersj I should be able to integrate something in the existing plugin. The Go OPC-UA library is quite complete, so it is mostly high level. |
Sounds good to me. @LarsStegman does that work for you? If it does come down to it, I'm sure @R290 and myself would love your help testing something. |
I will hear back tomorrow. I will let you know what the results are. |
Good news: I have received permission. I will make the pull request somewhere next week. |
PR created 😄 |
Hey together and @LarsStegman
In this case i get no information about the incoming objects itself. I |
should do it |
I had quite some difficulty in configured the CONF file for the input plugin.
Don't know if this is helpful, but here is an example that is working for me.
Note that idenitifier_type is not the same as data_type. That just indicates what to expect in the identifier=""
Regards,
Frank
[[inputs.opcua_listener]]
name = "opc141"
endpoint = "opc.tcp://10.10.0.141:53530/OPCUA/SimulationServer"
connect_timeout = "10s"
request_timeout = "5s"
# subscription_interval = "300s"
# if the OPC server has security, it is supported, sample server is open
security_policy = "None"
security_mode = "None"
# auth_method = "UserName"
# username = ""
# password = ""
# namespace="3"
nodes = [
{name="value",namespace="3",identifier_type="i",identifier="1001",data_type="integer",tags=[["point","Counter"],["server","${HOSTID}"],["quality","good"]] },
{name="value",namespace="3",identifier_type="i",identifier="1003",data_type="float",tags=[["point","Sawtooth"],["server","${HOSTID}"],["quality","good"]] }
]
Frank Inselbuch
713-701-5421
***@***.***
From: Lars Stegman ***@***.***>
Date: Tuesday, November 1, 2022 at 10:57 AM
To: influxdata/telegraf ***@***.***>
Cc: Frank Inselbuch ***@***.***>, Manual ***@***.***>
Subject: Re: [influxdata/telegraf] OPC UA Events based plugin (#8083)
[[inputs.opcua_listener.nodes]] name = "my_field_name" namespace = "x" # you really need to known this identifier_type = "i" identifier = "2041"
should do it
—
Reply to this email directly, view it on GitHub<#8083 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFMVC6MRW7NZESIV3AQ57STWGE4XZANCNFSM4QYUNVFA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Hello inselbuch, |
It is great that Telegraf now has subscription based OPC-UA input. But looking at the latest Telegraf documentation, I don't see any way to set the DataChange parameters when monitoring a node. This is an important part of the OPC-UA subsciption model, and essential for managing logging in systems where you may have thousands of sensors spewing out data. |
That's right, this functionality is not implemented. It shouldn't be difficult to add it. Can you open a new issue describing the functionality? |
Hello, Unfortunately the lack of support for array variables still persists in the current version of both input.opcua and inputs.opcua_listener plugins. Here you can see some logs of the inputs.opcua_listener plugin, where the plugin correctly receives the datachange notification of a subscribed array variable - including the values, but doesn't output the values into the generated metric: Here the same result while using the inputs.opcua plugin. No array values are found in the generated metric for influxdb: A workaround for the time being would be to convert the array values to a string. This was mentioned by @nicolasj92 in the other issue here.
Any hints to the right place or the right direction are welcome. Thank you! |
Feature Request
Recently merged
inputs.opcua
plugin currently polls on a certain interval to gather metrics, it does not respond immediately to events. Therefore any event collected would be delayed based on the interval setting.opcua_events
plugin (likesnmp
vssnmp_trap
plugins)Use case:
OPC UA is subscription based, will be expected by a lot of users
The text was updated successfully, but these errors were encountered: