influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.58k stars 5.56k forks source link

error in Client Connection after reboot #14703

Closed ChenitoAf closed 8 months ago

ChenitoAf commented 8 months ago

Relevant telegraf.conf

# Configuration for telegraf agent
[agent]
  ## Default data collection interval for all inputs
  interval = "10s"
  ## Rounds collection interval to 'interval'
  ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  round_interval = true

  ## Telegraf will send metrics to outputs in batches of at most
  ## metric_batch_size metrics.
  ## This controls the size of writes that Telegraf sends to output plugins.
  metric_batch_size = 1000

  ## Maximum number of unwritten metrics per output.  Increasing this value
  ## allows for longer periods of output downtime without dropping metrics at the
  ## cost of higher maximum memory usage.
  metric_buffer_limit = 10000

  ## Collection jitter is used to jitter the collection by a random amount.
  ## Each plugin will sleep for a random time within jitter before collecting.
  ## This can be used to avoid many plugins querying things like sysfs at the
  ## same time, which can have a measurable effect on the system.
  collection_jitter = "0s"

  ## Default flushing interval for all outputs. Maximum flush_interval will be
  ## flush_interval + flush_jitter
  flush_interval = "10s"
  ## Jitter the flush interval by a random amount. This is primarily to avoid
  ## large write spikes for users running a large number of telegraf instances.
  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  flush_jitter = "0s"

  ## By default or when set to "0s", precision will be set to the same
  ## timestamp order as the collection interval, with the maximum being 1s.
  ##   ie, when interval = "10s", precision will be "1s"
  ##       when interval = "250ms", precision will be "1ms"
  ## Precision will NOT be used for service inputs. It is up to each individual
  ## service input to set the timestamp at the appropriate precision.
  ## Valid time units are "ns", "us" (or "µs"), "ms", "s".
  precision = ""

  ## Log at debug level.
  debug = true
  ## Log only error level messages.
  quiet = false

  ## Log target controls the destination for logs and can be one of "file",
  ## "stderr" or, on Windows, "eventlog".  When set to "file", the output file
  ## is determined by the "logfile" setting.
  logtarget = "file"

  ## Name of the file to be logged to when using the "file" logtarget.  If set to
  ## the empty string then logs are written to stderr.
  logfile = "C:/Users/YourUserName/Documents/telegraf.log"

  ## The logfile will be rotated after the time interval specified.  When set
  ## to 0 no time based rotation is performed.  Logs are rotated only when
  ## written to, if there is no log activity rotation may be delayed.
  logfile_rotation_interval = "12h"

  ## The logfile will be rotated when it becomes larger than the specified
  ## size.  When set to 0 no size based rotation is performed.
  # logfile_rotation_max_size = "10MB"

  ## Maximum number of rotated archives to keep, any older logs are deleted.
  ## If set to -1, no archives are removed.
  logfile_rotation_max_archives = 10

  ## Pick a timezone to use when logging or type 'local' for local time.
  ## Example: America/Chicago
  # log_with_timezone = ""

  ## Override default hostname, if empty use os.Hostname()
  hostname = ""
  ## If set to true, do no set the "host" tag in the telegraf agent.
  omit_hostname = false
[[outputs.influxdb_v2]]
  ## The URLs of the InfluxDB cluster nodes.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  ##   ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
  urls = ["http://localhost:8086/"]

  ## Token for authentication.
  token = "xxxxxxxxxxxxxxxxx"

  ## Organization is the name of the organization you wish to write to; must exist.
  organization = "Office"

  ## Destination bucket to write into.
  bucket = "Teletest"

  ## The value of this tag will be used to determine the bucket.  If this
  ## tag is not set the 'bucket' option is used as the default.
  # bucket_tag = ""

  ## If true, the bucket tag will not be added to the metric.
  # exclude_bucket_tag = false

  ## Timeout for HTTP messages.
  # timeout = "5s"

  ## Additional HTTP headers
  # http_headers = {"X-Special-Header" = "Special-Value"}

  ## HTTP Proxy override, if unset values the standard proxy environment
  ## variables are consulted to determine which proxy, if any, should be used.
  # http_proxy = "http://corporate.proxy:3128"

  ## HTTP User-Agent
  # user_agent = "telegraf"

  ## Content-Encoding for write request body, can be set to "gzip" to
  ## compress body or "identity" to apply no encoding.
  # content_encoding = "gzip"

  ## Enable or disable uint support for writing uints influxdb 2.0.
  # influx_uint_support = false

  ## Optional TLS Config for use on HTTP connections.
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false
# Retrieve data from OPCUA devices  
[[inputs.opcua]]
  interval = "5s"
  ## Metric name
  name = "opcua"
  #
  ## OPC UA Endpoint URL
  endpoint = "opc.tcp://localhost:4840"
  #
  ## Maximum time allowed to establish a connect to the endpoint.
  # connect_timeout = "10s"
  #
  ## Maximum time allowed for a request over the estabilished connection.
  # request_timeout = "5s"
  #
  ## Security policy, one of "None", "Basic128Rsa15", "Basic256",
  ## "Basic256Sha256", or "auto"
  security_policy = "None"
  #
  ## Security mode, one of "None", "Sign", "SignAndEncrypt", or "auto"
  security_mode = "None"
  #
  ## Path to cert.pem. Required when security mode or policy isn't "None".
  ## If cert path is not supplied, self-signed cert and key will be generated.
  # certificate = ""
  #
  ## Path to private key.pem. Required when security mode or policy isn't "None".
  ## If key path is not supplied, self-signed cert and key will be generated.
  # private_key = ""
  #
  ## Authentication Method, one of "Certificate", "UserName", or "Anonymous".  To
  ## authenticate using a specific ID, select 'Certificate' or 'UserName'
  auth_method = "Anonymous"
  #
  ## Username. Required for auth_method = "UserName"
  # username = ""
  #
  ## Password. Required for auth_method = "UserName"
  # password = ""
  #
  ## Option to select the metric timestamp to use. Valid options are:
  ##     "gather" -- uses the time of receiving the data in telegraf
  ##     "server" -- uses the timestamp provided by the server
  ##     "source" -- uses the timestamp provided by the source
  # timestamp = "gather"
  #
  ## Node ID configuration
  ## name              - field name to use in the output
  ## namespace         - OPC UA namespace of the node (integer value 0 thru 3)
  ## identifier_type   - OPC UA ID type (s=string, i=numeric, g=guid, b=opaque)
  ## identifier        - OPC UA ID (tag as shown in opcua browser)
  ## tags              - extra tags to be added to the output metric (optional)
  ## Example:
  ## {name="ProductUri", namespace="0", identifier_type="i", identifier="2262", tags=[["tag1","value1"],["tag2","value2]]}
  nodes = [
    {name="DG_Psum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rPsum"},
    {name="DG_Qsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rQsum"},
    {name="DG_Ssum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rSsum"},
    {name="DG_Esum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rEsum"},
    {name="DG_PFsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rPFsum"},
    {name="DG_Frq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rFrq"},
    {name="DG_SpPF", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rSpPF"},
    {name="DG_OpP_Pct", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rOpP_Pct"},
    {name="DG_P_OnlineNom", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rP_OnlineNom"},
    {name="DG_P_Sr", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rP_Sr"},
    {name="DG_SpP_SrReq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rSpP_SrReq"},
    {name="DG_SpP", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.rSpP"},
    {name="DG_DGReq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtDG.xDGReq"},   
    {name="LOAD_Psum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rPsum"},
    {name="LOAD_Qsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rQsum"},
    {name="LOAD_Ssum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rSsum"},
    {name="LOAD_Esum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rEsum"},
    {name="LOAD_PFsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rPFsum"},
    {name="LOAD_Frq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtLOAD.rFrq"},
    {name="GRID_Psum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rPsum"},
    {name="GRID_Qsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rQsum"},
    {name="GRID_Ssum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rSsum"},
    {name="GRID_Esum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rEsum"},
    {name="GRID_PFsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rPFsum"},
    {name="GRID_Frq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtGRID.rFrq"}, 
    {name="PV_Psum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rPsum"},
    {name="PV_Qsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rQsum"},
    {name="PV_Ssum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rSsum"},
    {name="PV_Esum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rEsum"},
    {name="PV_PFsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rPFsum"},
    {name="PV_Frq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rFrq"},
    {name="PV_SpP_Pct", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rSpP_Pct"},
    {name="PV_SpP", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rSpP"},
    {name="PV_SpPF", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtPV.rSpPF"},   
    {name="BAT_Psum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rPsum"},
    {name="BAT_Qsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rQsum"},
    {name="BAT_Ssum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rSsum"},
    {name="BAT_PFsum", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rPFsum"},
    {name="BAT_SpPF", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rSpPF"},
    {name="BAT_SpP", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rSpP"},
    {name="BAT_Frq", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rFrq"},
    {name="BAT_E_TotChg", namespace="8", identifier_type="s", identifier="/g.udtBAT.rE_TotChg"},
    {name="BAT_E_TotDchg", namespace="8", identifier_type="s", identifier="/g.udtBAT.rE_TotDchg"},
    {name="BAT_Qty_Rack_Tot", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.uiQty_Rack_Tot"},
    {name="BAT_Qty_Rack_InServ", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.uiQty_Rack_InServ"},
    {name="BAT_Temp_CellMax", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rTemp_CellMax"},
    {name="BAT_Temp_CellMin", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rTemp_CellMin"},
    {name="BAT_VDC_CellMax", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rVDC_CellMax"},
    {name="BAT_VDC_CellMin", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rVDC_CellMin"},
    {name="BAT_SOC", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rSOC"},
    {name="BAT_SOH", namespace="8", identifier_type="s", identifier="/g.udtSysData.udtBAT.rSOH"},
    {name="CtrlState_BATEgy", namespace="8", identifier_type="s", identifier="/g.udtCtrlState_BATEgy.iState"},
    {name="CtrlState_BATRrc", namespace="8", identifier_type="s", identifier="/g.udtCtrlState_BATRrc.iState"},
    {name="CtrlState_DGActPwr", namespace="8", identifier_type="s", identifier="/g.udtCtrlState_DGActPwr.iState"},
    {name="CtrlState_PVActPwr", namespace="8", identifier_type="s", identifier="/g.udtCtrlState_PVActPwr.iState"},
    {name="AGGState_BESS", namespace="8", identifier_type="s", identifier="/g.udtBatDeratingState.iState"},    
    {name="FallbackState1", namespace="8", identifier_type="s", identifier="/g.udtState_FLBCK_BAT_1.iState"},      
    {name="FallbackState2", namespace="8", identifier_type="s", identifier="/g.udtState_FLBCK_BAT_2.iState"}, 
    {name="FallbackState3", namespace="8", identifier_type="s", identifier="/g.udtState_FLBCK_BAT_3.iState"}, 
    {name="FallbackState4", namespace="8", identifier_type="s", identifier="/g.udtState_FLBCK_BAT_4.iState"},    
    {name="LDSS.iState", namespace="8", identifier_type="s", identifier="/g.udtState_LDSS.iState"},    
  ]
  #
  ## Node Group
  ## Sets defaults for OPC UA namespace and ID type so they aren't required in
  ## every node.  A group can also have a metric name that overrides the main
  ## plugin metric name.
  ##
  ## Multiple node groups are allowed
  #[[inputs.opcua.group]]
  ## Group Metric name. Overrides the top level name.  If unset, the
  ## top level name is used.
  # name =
  #
  ## Group default namespace. If a node in the group doesn't set its
  ## namespace, this is used.
  # namespace =
  #
  ## Group default identifier type. If a node in the group doesn't set its
  ## namespace, this is used.
  # identifier_type =
  #
  ## Node ID Configuration.  Array of nodes with the same settings as above.
  # nodes = [
  #  {name="", namespace="", identifier_type="", identifier=""},
  #  {name="", namespace="", identifier_type="", identifier=""},
  #]

  ## Enable workarounds required by some devices to work correctly
  # [inputs.opcua.workarounds]
    ## Set additional valid status codes, StatusOK (0x0) is always considered valid
    # additional_valid_status_codes = ["0xC0"]
  [inputs.opcua.request_workarounds]
    ## Use unregistered reads instead of registered reads
    use_unregistered_reads = true

Logs from Telegraf

2024-02-08T12:55:25Z I! Starting Telegraf 1.28.2 brought to you by InfluxData the makers of InfluxDB
2024-02-08T12:55:25Z I! Available plugins: 240 inputs, 9 aggregators, 29 processors, 24 parsers, 59 outputs, 5 secret-stores
2024-02-08T12:55:25Z I! Loaded inputs: opcua
2024-02-08T12:55:25Z I! Loaded aggregators: 
2024-02-08T12:55:25Z I! Loaded processors: 
2024-02-08T12:55:25Z I! Loaded secretstores: 
2024-02-08T12:55:25Z I! Loaded outputs: influxdb_v2
2024-02-08T12:55:25Z I! Tags enabled: host=DESKTOP-1BH0VEG
2024-02-08T12:55:25Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"DESKTOP-1BH0VEG", Flush Interval:10s
2024-02-08T12:55:25Z D! [agent] Initializing plugins
2024-02-08T12:55:25Z D! [inputs.opcua] Initialising OpcUAInputClient
2024-02-08T12:55:25Z D! [inputs.opcua] Initialising OpcUAClient
2024-02-08T12:55:25Z D! [inputs.opcua] Initialising node to metric mapping
2024-02-08T12:55:25Z D! [agent] Connecting outputs
2024-02-08T12:55:25Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2024-02-08T12:55:25Z D! [agent] Successfully connected to outputs.influxdb_v2
2024-02-08T12:55:25Z D! [agent] Starting service inputs
2024-02-08T12:55:30Z D! [inputs.opcua] Connecting OPC UA Client to server
2024-02-08T12:55:30Z D! [inputs.opcua] Configuring OPC UA connection options
2024-02-08T12:55:30Z W! [inputs.opcua] Failed to load certificate: open /etc/telegraf/cert.pem: The system cannot find the path specified.
2024-02-08T12:55:30Z D! [inputs.opcua] security policy from configuration http://opcfoundation.org/UA/SecurityPolicy#None
2024-02-08T12:55:30Z D! [inputs.opcua] User cares about both the policy (http://opcfoundation.org/UA/SecurityPolicy#None) and security mode (MessageSecurityModeNone)
2024-02-08T12:55:30Z D! [inputs.opcua] Server has 5 endpoints
2024-02-08T12:55:30Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#None, mode MessageSecurityModeNone, level 0
2024-02-08T12:55:30Z D! [inputs.opcua] Security policy and mode found. Using server endpoint opc.tcp://DESKTOP-1BH0VEG:4840 for security. Policy http://opcfoundation.org/UA/SecurityPolicy#None
2024-02-08T12:55:30Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15, mode MessageSecurityModeSign, level 80
2024-02-08T12:55:30Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15, mode MessageSecurityModeSignAndEncrypt, level 130
2024-02-08T12:55:30Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic256, mode MessageSecurityModeSign, level 90
2024-02-08T12:55:30Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic256, mode MessageSecurityModeSignAndEncrypt, level 140
2024-02-08T12:55:30Z E! [inputs.opcua] Error in plugin: connect failed: error in Client Connection:  Bad (0x80000000)
2024-02-08T12:55:35Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:55:40Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:55:45Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:55:50Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:55:55Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:00Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:05Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:10Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:15Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:20Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:25Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:30Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:35Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:40Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:45Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:56:50Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:56:55Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:57:00Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T12:57:05Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T12:57:10Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"

2024-02-08T13:24:56Z I! Starting Telegraf 1.29.4 brought to you by InfluxData the makers of InfluxDB
2024-02-08T13:24:56Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 5 secret-stores
2024-02-08T13:24:56Z I! Loaded inputs: opcua
2024-02-08T13:24:56Z I! Loaded aggregators: 
2024-02-08T13:24:56Z I! Loaded processors: 
2024-02-08T13:24:56Z I! Loaded secretstores: 
2024-02-08T13:24:56Z I! Loaded outputs: influxdb_v2
2024-02-08T13:24:56Z I! Tags enabled: host=DESKTOP-1BH0VEG
2024-02-08T13:24:56Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"DESKTOP-1BH0VEG", Flush Interval:10s
2024-02-08T13:24:56Z D! [agent] Initializing plugins
2024-02-08T13:24:56Z D! [inputs.opcua] Initialising OpcUAInputClient
2024-02-08T13:24:56Z D! [inputs.opcua] Initialising OpcUAClient
2024-02-08T13:24:56Z D! [inputs.opcua] Initialising node to metric mapping
2024-02-08T13:24:56Z D! [agent] Connecting outputs
2024-02-08T13:24:56Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2024-02-08T13:24:56Z D! [agent] Successfully connected to outputs.influxdb_v2
2024-02-08T13:24:56Z D! [agent] Starting service inputs
2024-02-08T13:25:00Z D! [inputs.opcua] Connecting OPC UA Client to server
2024-02-08T13:25:00Z D! [inputs.opcua] Configuring OPC UA connection options
2024-02-08T13:25:00Z W! [inputs.opcua] Failed to load certificate: open /etc/telegraf/cert.pem: The system cannot find the path specified.
2024-02-08T13:25:00Z D! [inputs.opcua] security policy from configuration http://opcfoundation.org/UA/SecurityPolicy#None
2024-02-08T13:25:00Z D! [inputs.opcua] User cares about both the policy (http://opcfoundation.org/UA/SecurityPolicy#None) and security mode (MessageSecurityModeNone)
2024-02-08T13:25:00Z D! [inputs.opcua] Server has 5 endpoints
2024-02-08T13:25:00Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#None, mode MessageSecurityModeNone, level 0
2024-02-08T13:25:00Z D! [inputs.opcua] Security policy and mode found. Using server endpoint opc.tcp://DESKTOP-1BH0VEG:4840 for security. Policy http://opcfoundation.org/UA/SecurityPolicy#None
2024-02-08T13:25:00Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15, mode MessageSecurityModeSign, level 80
2024-02-08T13:25:00Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15, mode MessageSecurityModeSignAndEncrypt, level 130
2024-02-08T13:25:00Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic256, mode MessageSecurityModeSign, level 90
2024-02-08T13:25:00Z D! [inputs.opcua] Evaluating endpoint opc.tcp://DESKTOP-1BH0VEG:4840, policy http://opcfoundation.org/UA/SecurityPolicy#Basic256, mode MessageSecurityModeSignAndEncrypt, level 140
2024-02-08T13:25:00Z E! [inputs.opcua] Error in plugin: connect failed: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:25:06Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:25:10Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:25:16Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:25:20Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:25:26Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:25:30Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:25:36Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:25:40Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:25:46Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:25:50Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:25:56Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:26:00Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:26:06Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:26:10Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"
2024-02-08T13:26:16Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:26:20Z E! [inputs.opcua] Error in plugin: not connected, in state "Closed"

2024-02-08T13:36:40Z I! Starting Telegraf 1.24.2
2024-02-08T13:36:40Z I! Available plugins: 205 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2024-02-08T13:36:40Z I! Loaded inputs: opcua
2024-02-08T13:36:40Z I! Loaded aggregators: 
2024-02-08T13:36:40Z I! Loaded processors: 
2024-02-08T13:36:40Z I! Loaded outputs: influxdb_v2
2024-02-08T13:36:40Z I! Tags enabled: host=DESKTOP-1BH0VEG
2024-02-08T13:36:40Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"DESKTOP-1BH0VEG", Flush Interval:10s
2024-02-08T13:36:40Z D! [agent] Initializing plugins
2024-02-08T13:36:40Z W! [inputs.opcua] Failed to load certificate: open /etc/telegraf/cert.pem: The system cannot find the path specified.
2024-02-08T13:36:40Z D! [agent] Connecting outputs
2024-02-08T13:36:40Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2024-02-08T13:36:40Z D! [agent] Successfully connected to outputs.influxdb_v2
2024-02-08T13:36:40Z D! [agent] Starting service inputs
2024-02-08T13:36:50Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:36:50Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:00Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:37:00Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:10Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:10Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:37:20Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:20Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:37:30Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:30Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:37:40Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:40Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:37:50Z E! [inputs.opcua] Error in plugin: error in Client Connection:  Bad (0x80000000)
2024-02-08T13:37:50Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:38:00Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:00Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:38:00Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:10Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:10Z D! [outputs.influxdb_v2] Wrote batch of 1000 metrics in 127.3638ms
2024-02-08T13:38:10Z D! [outputs.influxdb_v2] Buffer fullness: 122 / 10000 metrics
2024-02-08T13:38:10Z D! [outputs.influxdb_v2] Wrote batch of 122 metrics in 23.9846ms
2024-02-08T13:38:10Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:38:20Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:20Z D! [outputs.influxdb_v2] Wrote batch of 561 metrics in 108.7081ms
2024-02-08T13:38:20Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:38:30Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:30Z D! [outputs.influxdb_v2] Wrote batch of 561 metrics in 362.978ms
2024-02-08T13:38:30Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2024-02-08T13:38:40Z E! [inputs.opcua] status not OK for node 'LDSS.iState'(metric name 'opcua', tags '')
2024-02-08T13:38:40Z D! [outputs.influxdb_v2] Wrote batch of 561 metrics in 153.7139ms
2024-02-08T13:38:40Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

System info

Telegraf V1.24.2 V1.28.2 V1.29.4, Windows, InfluxDB, OPCUA

Docker

No response

Steps to reproduce

  1. Setup:
    • Windows
    • OPCUA Server
    • InfluxDB
    • Telegraf (V1.24.2), initial starting point)
  2. All are configured correctly. And data is coming into the database.
  3. Reboot Windows. And

    Error in plugin: connect failed: error in Client Connection: Bad (0x80000000) Error in plugin: not connected, in state "Closed"

  4. If I restart the telegraf now, the data will come in.
  5. Stop telegraf. Replace telegraf with V1.29.4, and reboot windows

    Error in plugin: connect failed: error in Client Connection: Bad (0x80000000) Error in plugin: not connected, in state "Closed"

  6. If I restart the telegraf now, the data will come in.
  7. Stop telegraf. Replace telegraf with V1.24.2, and reboot windows
  8. After a few error messages, the data came in.

    Error in plugin: error in Client Connection: Bad (0x80000000)

  9. See the three log files attached

...

Expected behavior

After rebooting the windows, I am expecting that the telegraf will successfully get the data from OPCUA Server and write it into InfluxDB. If it failed to connect to the OPCUA server, it will try again.

Actual behavior

After rebooting the windows, telegraf (V1.28.2 and V1.29.4) failed to connect to the OPCUA Server and remained in error state.

Additional info

Only telegraf V1.24.2 worked as I expected. For telegraf V1.28.2 and V1.29.4, I will need to restart telegraf in order to make it work again. So I feel like, in the new version, it didn't try to re-connect after it failed. Or I will need a restart delay something like this.

Great Thanks if you could take a look

ChenitoAf commented 8 months ago

14066

Relavent to this issue

powersj commented 8 months ago

If it failed to connect to the OPCUA server, it will try again.

Closing this as a dup of #13296