Skip to content

Commit

Permalink
Fix remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsStegman committed Sep 13, 2022
1 parent 1c00277 commit 9714607
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 0 additions & 1 deletion internal/opcua/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ func pemBlockForKey(priv interface{}) (*pem.Block, error) {
}
}

//revive:disable-next-line
func (o *OpcUAClient) generateClientOpts(endpoints []*ua.EndpointDescription) ([]opcua.Option, error) {
opts := []opcua.Option{}
appuri := "urn:telegraf:gopcua:Client"
Expand Down
22 changes: 16 additions & 6 deletions plugins/inputs/opcua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Plugin minimum tested version: 1.16
## OPC UA Endpoint URL
# endpoint = "opc.tcp://localhost:4840"
#
## The service set to use to retrieve/receive the values from the OPC UA server
## The service set to use to retrieve/receive the values from the
## OPC UA server. One of "request" or "subscribe"
# connection_service = "request"
# connection_service = "subscribe"
#
## Maximum time allowed to establish a connect to the endpoint.
# connect_timeout = "10s"
Expand All @@ -27,11 +27,9 @@ Plugin minimum tested version: 1.16
# request_timeout = "5s"
#
## The interval at which the server should at least update its monitored items
## https://reference.opcfoundation.org/v104/Core/docs/Part4/5.13.1/
## Only used when connection_service = "subscribe"
# subscription_interval = "100ms"
#
#
## Security policy, one of "None", "Basic128Rsa15", "Basic256",
## "Basic256Sha256", or "auto"
# security_policy = "auto"
Expand Down Expand Up @@ -124,7 +122,6 @@ This node configuration produces a metric like this:

```text
opcua,id=n\=3;s\=Temperature temp=79.0,quality="OK (0x0)" 1597820490000000000
```

## Group Configuration
Expand Down Expand Up @@ -162,14 +159,27 @@ This example group configuration has two groups with two nodes each:
]
```

## Connection Service

This plugin supports the Request and the Subscription service
to retrieve data from the OPC server. The difference between
these two services are described in the [OPC Foundation
Part 4 Chapter 5](
https://reference.opcfoundation.org/v104/Core/docs/Part4/#5)

The subscription service allows clients to set the set uses
maximum interval at which they want to receive updates.
This interval can be set through the `subscription_interval`
setting.

## Metrics

The metrics collected by this input plugin will depend on the
configured `nodes` and `group`.

## Example Output

```shell
```text
group1_metric_name,group1_tag=val1,id=ns\=3;i\=1001,node1_tag=val2 name=0,Quality="OK (0x0)" 1606893246000000000
group1_metric_name,group1_tag=val1,id=ns\=3;i\=1002,node1_tag=val3 name=-1.389117,Quality="OK (0x0)" 1606893246000000000
group2_metric_name,group2_tag=val3,id=ns\=3;i\=1003,node2_tag=val4 Quality="OK (0x0)",saw=-1.6 1606893246000000000
Expand Down
1 change: 0 additions & 1 deletion plugins/inputs/opcua/read_client_test.go

This file was deleted.

6 changes: 2 additions & 4 deletions plugins/inputs/opcua/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
## OPC UA Endpoint URL
# endpoint = "opc.tcp://localhost:4840"
#
## The service set to use to retrieve/receive the values from the OPC UA server
## The service set to use to retrieve/receive the values from the
## OPC UA server. One of "request" or "subscribe"
# connection_service = "request"
# connection_service = "subscribe"
#
## Maximum time allowed to establish a connect to the endpoint.
# connect_timeout = "10s"
Expand All @@ -17,11 +17,9 @@
# request_timeout = "5s"
#
## The interval at which the server should at least update its monitored items
## https://reference.opcfoundation.org/v104/Core/docs/Part4/5.13.1/
## Only used when connection_service = "subscribe"
# subscription_interval = "100ms"
#
#
## Security policy, one of "None", "Basic128Rsa15", "Basic256",
## "Basic256Sha256", or "auto"
# security_policy = "auto"
Expand Down

0 comments on commit 9714607

Please sign in to comment.