Closed maxime-jolliet-airseas closed 5 months ago
Hi,
Happy to see a PR with this config option exposed. I believe you would want to look at plugins/common/opcua/client.go
and expose a SessionTimeout
variable called session_timeout
in the TOML config.
Then in plugins/common/opcua/opcua_util.go
, in the generateClientOpts
function, set the timeout option.
Finally, update the sample.conf and README.md with the new option you have added.
Use Case
Telegraf uses default session configuration parameters from gopcua, as defined here : https://github.com/gopcua/opcua/blob/main/config.go#L40
Namely, the session timeout is set to 20 minutes. I connect to PLC that have only a few PCUA session slots available (typically, 5 to 10). Often, I max out the session slots (I do not know why), and end up with a "BadTooManySessionError" - and have to wait for the 20 minutes timout to expire.
Expected behavior
I'd like to add a parameter to Telegraf OPCUA plugins configuration "session_timeout".
Actual behavior
I am not aware of any workaround, sadly.
Additional info
I don't know Go, but I can try to start a PR, if that's OK.