influxdata / telegraf

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

No data collection with SNMPV3 while instantaneous with SNMPV2C #12011

Closed ashkii7 closed 1 year ago

ashkii7 commented 2 years ago

Relevant telegraf.conf

# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
#
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
#
# Environment variables can be used anywhere in this config file, simply surround
# them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"),
# for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR})

#----------------------------------------------------------
# Global tags can be specified here in key="value" format.
#----------------------------------------------------------
[global_tags]
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"

#----------------------------------------------------------
# Configuration for telegraf agent
#----------------------------------------------------------
[agent]
  interval = "60s"    #    VpD "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  # collection_offset = "5s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = "0s"
  debug = true
  quiet = false
  # logtarget = "file"
  # logfile = ""
  # logfile_rotation_interval = "0h"
  # logfile_rotation_max_size = "0MB"
  # logfile_rotation_max_archives = 5    # If set to -1, no archives are removed.
  log_with_timezone = "Europe/Paris"
  hostname = ""
  omit_hostname = false
  ## Method of translating SNMP objects. Can be "netsnmp" which
  ## translates by calling external programs snmptranslate and snmptable,
  ## or "gosmi" which translates using the built-in gosmi library.
  snmp_translator = "gosmi"    #    VpD "netsnmp"

###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################

#----------------------------------------------------------
# # Configuration for sending metrics to InfluxDB 2.0
#----------------------------------------------------------
[[outputs.influxdb_v2]]
  ## The URLs of the InfluxDB cluster nodes.
  urls = ["http://172.20.0.2:8086"]
  ## Token for authentication.
  token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ## Organization is the name of the organization you wish to write to.
  organization = "Maeva56"
  ## Destination bucket to write into.
  bucket = "nas_telegraf"
  # 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

###############################################################################
#                            PROCESSOR PLUGINS                                #
###############################################################################

#----------------------------------------------------------
## Conversions pour Caméras HIKVISION
#----------------------------------------------------------
  ## Perform string processing on tags, fields, and measurements
[[processors.strings]]
  order = 1
  [[processors.strings.trim_suffix]]
    field = "cpuPercent"
    suffix = " PERCENT"
  [[processors.strings.trim_suffix]]
    field = "memUsed"
    suffix = " PERCENT"

  ## Convert values to another metric value type
[[processors.converter]]
  order = 2
  [processors.converter.fields]
    integer = ["cpuPercent","memUsed"]

###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################

#----------------------------------------------------------
## Synology
#----------------------------------------------------------
[[inputs.snmp]]

  name_override = "snmp.syno"

  agents = ["udp://172.20.0.1:161", "udp://192.168.2.11:161", "udp://192.168.2.1:161"]
  ## Overrides default data collection interval for all inputs
  # interval = "60s"    #    VpD "10s"
  ## Timeout for each request.
  timeout = "60s"    # VpD "5s"
  ## SNMP version; can be 1, 2, or 3.
  version = 3    #    VpD 2
  ## Unconnected UDP socket
  # unconnected_udp_socket = true
  ## Path to mib files : Used by the gosmi translator.
  path = ["/usr/share/snmp/mibs"]
  ## SNMP community string : for SNMP 1 & 2 only
  # community = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ## Agent host tag
  # agent_host_tag = "agent_host"
  ## Number of retries to attempt.
  retries = 3
  ## The GETBULK max-repetitions parameter.
  max_repetitions = 30    # VpD 10

  #----------------------------------------------------------
  ## SNMPv3 authentication and encryption options.
  #----------------------------------------------------------
  ## Security Name.
  sec_name = "telegraf"
  ## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "".
  auth_protocol = "MD5"    #    VpD utilisee par le routeur Synology RT2600ac
  ## Authentication password.
  auth_password = "xxxxxxxxxxxxxxxxxxxxx"
  ## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
  sec_level = "authNoPriv"
  ## Context Name.
  context_name = "Maeva56"
  ## Privacy protocol used for encrypted messages; one of "DES", "AES", "AES192", "AES192C", "AES256", "AES256C", or "".
  # priv_protocol = "DES"    #    VpD utilisee par le routeur Synology RT2600ac
  ## Privacy password used for encrypted messages.
  # priv_password = "xxxxxxxxxxxxxxxxxxxxxx"

  #----------------------------------------------------------
  ## Measurement name
  name = "snmp.SYNO"

  #----------------------------------------------------------
  ## System Details
  #----------------------------------------------------------
  #  System vendor OID
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysObjectID.0"
    name = "sysObjectID"
  #  System description
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysDescr.0"
    name = "sysDescr"
  #  System uptime
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysUpTime.0"
    name = "upTime"
  #  System contact
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysContact.0"
    name = "sysContact"
  #  System name (hostname)
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysName.0"
    name = "sysName"
    is_tag = true
  #  System location
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysLocation.0"
    name = "sysLocation"

#----------------------------------------------------------
# HIKVISION IP Camera
#----------------------------------------------------------
  # Uses the HIK-DEVICE-MIB
[[inputs.snmp]]

  name_override = "snmp.hik"

  agents = [  "192.168.2.21", "192.168.2.22", "192.168.2.23", "192.168.2.24" ]
  ## Overrides default data collection interval for all inputs
  interval = "60s"    #    VpD "10s"
  ## Timeout for each request.
  timeout = "10s"    # VpD "5s"
  ## SNMP version; can be 1, 2, or 3.
  version = 3    #    VpD 2
  ## Unconnected UDP socket
  # unconnected_udp_socket = true
  ## Path to mib files : Used by the gosmi translator.
  path = ["/usr/share/snmp/mibs"]
  ## SNMP community string : for SNMP 1 & 2 only
  # community = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ## Agent host tag
  # agent_host_tag = "agent_host"
  ## Number of retries to attempt.
  retries = 3
  ## The GETBULK max-repetitions parameter.
  max_repetitions = 30    # VpD 10

  #----------------------------------------------------------
  ## SNMPv3 authentication and encryption options.
  #----------------------------------------------------------
  ## Security Name.
  sec_name = "telegraf"
  ## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "".
  auth_protocol = "MD5"    #    VpD utilisee par le routeur Synology RT2600ac
  ## Authentication password.
  auth_password = "xxxxxxxxxxxxxxxxxx"
  ## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
  sec_level = "authNoPriv"
  ## Context Name.
  context_name = "Maeva56"
  ## Privacy protocol used for encrypted messages; one of "DES", "AES", "AES192", "AES192C", "AES256", "AES256C", or "".
  # priv_protocol = "DES"    #    VpD utilisee par le routeur Synology RT2600ac
  ## Privacy password used for encrypted messages.
  # priv_password = "xxxxxxxxxxxxxxxxxxxxxxx"

  #----------------------------------------------------------
  ## Measurement name
  name = "snmp.HIK"
  #----------------------------------------------------------
  # HIK Manufacturer
  [[inputs.snmp.field]]
    name = "manufacturer"
    oid = "HIK-DEVICE-MIB::manufacturer.0"
  # HIK Device Model
  [[inputs.snmp.field]]
    name = "deviceModel"
    oid = "HIK-DEVICE-MIB::deviceType.0"
  # HIK Device ID
  [[inputs.snmp.field]]
    name = "deviceID"
    oid = "HIK-DEVICE-MIB::deviceID.0"
  # HIK Version Software
  [[inputs.snmp.field]]
    name = "softwVersion"
    oid = "HIK-DEVICE-MIB::softwVersion.0"
  # HIK Cpu Precent
  [[inputs.snmp.field]]
    name="cpuPercent"
    oid = "HIK-DEVICE-MIB::cpuPercent.0"
  # HIK Mem Used
  [[inputs.snmp.field]]
    name="memUsed"
    oid = "HIK-DEVICE-MIB::memUsed.0"
  # HIK IP Address
  [[inputs.snmp.field]]
    name="staticIpAddr"
    oid = "HIK-DEVICE-MIB::staticIpAddr.0"
  # HIK Dynmamic IP Address
  [[inputs.snmp.field]]
    name="dynIpAddr"
    oid = "HIK-DEVICE-MIB::dynIpAddr.0"
  # HIK MAC Address
  [[inputs.snmp.field]]
    name="macAddr"
    oid = "HIK-DEVICE-MIB::macAddr.0"
  # HIK Video Encode
  [[inputs.snmp.field]]
    name="vidEncode"
    oid = "HIK-DEVICE-MIB::videoEncode.0"
  # HIK Video Encode
  [[inputs.snmp.field]]
    name="restartDev"
    oid = "HIK-DEVICE-MIB::restartDev.0"

Logs from Telegraf

-------------------------------------------------------------------------------------
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker-compose up -d
Creating telegraf ... done
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker logs -f telegraf
2022-10-10T16:17:13Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-10T18:17:13+02:00 I! Starting Telegraf 1.24.2
2022-10-10T18:17:13+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-10T18:17:13+02:00 I! Loaded inputs: snmp (2x)
2022-10-10T18:17:13+02:00 I! Loaded aggregators:
2022-10-10T18:17:13+02:00 I! Loaded processors:
2022-10-10T18:17:13+02:00 I! Loaded outputs: influxdb_v2
2022-10-10T18:17:13+02:00 I! Tags enabled: host=telegraf
2022-10-10T18:17:13+02:00 I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
2022-10-10T18:17:13+02:00 D! [agent] Initializing plugins
2022-10-10T18:17:15+02:00 D! [agent] Connecting outputs
2022-10-10T18:17:15+02:00 D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-10-10T18:17:15+02:00 D! [agent] Successfully connected to outputs.influxdb_v2
2022-10-10T18:17:15+02:00 D! [agent] Starting service inputs
2022-10-10T18:17:25+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-10T18:17:35+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-10T18:17:45+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-10T18:17:55+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-10T18:18:05+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 10.54312ms
2022-10-10T18:18:05+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-10T18:18:15+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
^C
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker exec -it telegraf bash
I have no name!@telegraf:/$ telegraf --test
2022-10-10T16:18:38Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-10T18:18:38+02:00 I! Starting Telegraf 1.24.2
2022-10-10T18:18:38+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-10T18:18:38+02:00 I! Loaded inputs: snmp (2x)
2022-10-10T18:18:38+02:00 I! Loaded aggregators:
2022-10-10T18:18:38+02:00 I! Loaded processors:
2022-10-10T18:18:38+02:00 W! Outputs are not used in testing mode!
2022-10-10T18:18:38+02:00 I! Tags enabled: host=telegraf
2022-10-10T18:18:38+02:00 D! [agent] Initializing plugins
2022-10-10T18:18:39+02:00 D! [agent] Starting service inputs
> snmp.hik,agent_host=192.168.2.22,host=telegraf cpuPercent="69 PERCENT",deviceID="2",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.22",macAddr="bc-ba-c2-13-ce-bd",manufacturer="Hikvision",memUsed="56 PERCENT",restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1665418720000000000
> snmp.hik,agent_host=192.168.2.24,host=telegraf cpuPercent="57 PERCENT",deviceID="4",deviceModel="DS-2CD2085FWD-I",dynIpAddr="192.168.2.24",macAddr="58-50-ed-72-87-2d",manufacturer="Hikvision",memUsed="71 PERCENT",restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1665418720000000000
> snmp.hik,agent_host=192.168.2.23,host=telegraf cpuPercent="67 PERCENT",deviceID="3",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.23",macAddr="c0-51-7e-84-b7-f1",manufacturer="Hikvision",memUsed="55 PERCENT",restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1665418720000000000
> snmp.hik,agent_host=192.168.2.21,host=telegraf cpuPercent="67 PERCENT",deviceID="1",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.21",macAddr="bc-ba-c2-13-ce-ef",manufacturer="Hikvision",memUsed="55 PERCENT",restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1665418720000000000
^Z
[1]+ Stopped telegraf --test
I have no name!@telegraf:/$ exit
exit
There are stopped jobs.
I have no name!@telegraf:/$ exit
exit
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf#
-------------------------------------------------------------------------------------

System info

influxdb 2.4, Telegraf 1.24.1, Docker 20.10.3-1308, DSM 7.1.1

Docker

---
version: "3"

services:

    telegraf:
        image: telegraf:latest
        container_name: telegraf
        restart: unless-stopped
        hostname: telegraf
        pid: "host"
        user: 1034:65536    #    User:Group --> telegraf:docker
        mac_address: d2:ca:ab:cd:20:03
        networks:
            monitoring:
                ipv4_address: 172.20.0.3
        ports:
            - 8125:8125/udp
            - 8092:8092/udp
            - 8094:8094
        volumes:
            # config
            - /volume1/docker/monitoring/telegraf-data/telegraf.conf:/etc/telegraf/telegraf.conf:ro
            # additionnal MIBs
            - /volume1/docker/mibs:/usr/share/snmp/mibs:ro
            # docker socket mounting
            - /var/run/docker.sock:/var/run/docker.sock:ro
            # disk inputs
            - /etc:/hostfs/etc:ro
            - /proc:/hostfs/proc:ro
            - /sys:/hostfs/sys:ro
            - /var:/hostfs/var:ro
            - /run:/hostfs/run:ro
            - /:/hostfs:ro
            # system mounting
            - /run/udev:/run/udev:ro
        labels:
            - "com.centurylinklabs.watchtower.enable=true"
        environment:
            - HOST_ETC=/hostfs/etc
            - HOST_PROC=/hostfs/proc
            - HOST_SYS=/hostfs/sys
            - HOST_VAR=/hostfs/var
            - HOST_RUN=/hostfs/run
            - HOST_MOUNT_PREFIX=/hostfs
networks:
    monitoring:
        external: true

Steps to reproduce

  1. At each execution of the telegraf container
  2. ...

Expected behavior

Why such a difference in behavior between the two versions of the SNMP protocol? Why do I have the message "Collection Took Longer Than Expect; Not Complete After Interval of 1m0s"? I pushed the "Interval" parameter at 10 minutes and it's the same: no collection of data for NAS.

Actual behavior

Hello, Pay for my English but Google Translator is my friend. I use on a Synology NAS with Docker the InfluxDB V2.4 and Telegraf 1.24.2 services to collect monitoring data from my 2 NAS DS918+ and my RT2600AC router. So I defined an agent for these three devices:

[[inputs.snmp]]
       Agents = ["UDP: //172.20.0.1: 161", "UDP: //192.168.2.11: 161", "UDP: //192.168.2.1: 161"]

In addition, I also collect data from 4 surveillance cameras:

[[inputs.snmp]]
       Agents = ["192.168.2.21", "192.168.2.22", "192.168.2.23", "192.168.2.24"]
  1. When I am under SNMPV2C the collection of all data (NAS, cameras) is instantaneous. (Interval = 60S, Flush_Interval = 10s, Timeout = 10s) Everything is going perfectly well.

  2. Problem: when I go under SNMPV3 (after modification of the corresponding access parameters of the SNMP service under DSM7.1.1 and in the telegraf.conf file) and without changing anything else in the telegraf.conf file with Data to recover, plugin data [[inputs.snmp]] for the three Synology devices are not at all collected and the "SNMP.Syno" measurement is not created. For example in the log provided below, no batch is written in the Bucket InfluxDB2. On the other hand, the data for the 4 cameras are collected without any problem.

In addition, when I use SNMP requests live via the SNMPGET and SNMPWALK commands it both provide an instant response. For instance :

SNMPWALK -V3 -U telegraf -L AUTHNOPRIV -A MD5 -A PASSWORD 172.20.0.1 SYNOLOGY -SYSTEM -MIB :: Synosystem
SNMPGET -V3 -U telegraf -L AUTHNOPRIV -A MD5 -A PASSWORD 172.20.0.1 SYNOLOGY -SYSTEM -MIB :: Temperature.0

Note : 172.20.0.1 --> IPv4 NAS 1

Additional info

No response

MyaLongmire commented 2 years ago

At a quick glance, I would think there is an issue with the v3 credintials or how telegraf handles them.

@Hipska any ideas?

Hipska commented 2 years ago

Yeah probably, as the user tested the device directly with v3 and got response. I have no experience with v3.

Hipska commented 2 years ago

I also see you stopped the test without waiting to finish. A second observation is the agents are configured differently for syno vs hik.

Tip: also set an alias for each snmp input, so you can see from which one eventual errors come..

ashkii7 commented 2 years ago

@Hipska Hello, As suggested, I therefore configured the agents in the same way (ditto Hik) and I added in the Telegraf.conf file an "alias" instruction for each "inputs.snmp". But, always the same: no collection with the Syno part.

-----------------------------------------------------------------------------------------------------------------------
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker logs -f telegraf
2022-10-20T10:19:32Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-20T12:19:32+02:00 I! Starting Telegraf 1.24.2
2022-10-20T12:19:32+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-20T12:19:32+02:00 I! Loaded inputs: snmp (2x)
2022-10-20T12:19:32+02:00 I! Loaded aggregators:
2022-10-20T12:19:32+02:00 I! Loaded processors: converter strings
2022-10-20T12:19:32+02:00 I! Loaded outputs: influxdb_v2
2022-10-20T12:19:32+02:00 I! Tags enabled: host=telegraf
2022-10-20T12:19:32+02:00 I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
2022-10-20T12:19:32+02:00 D! [agent] Initializing plugins
2022-10-20T12:19:33+02:00 D! [agent] Connecting outputs
2022-10-20T12:19:33+02:00 D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-10-20T12:19:33+02:00 D! [agent] Successfully connected to outputs.influxdb_v2
2022-10-20T12:19:33+02:00 D! [agent] Starting service inputs
2022-10-20T12:19:43+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:19:53+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:03+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:14+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 80.744844ms
2022-10-20T12:20:14+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:23+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:33+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:43+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:20:53+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:03+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:05+02:00 D! [inputs.snmp::syno.snmp] Previous collection has not completed; scheduled collection skipped
2022-10-20T12:21:05+02:00 W! [inputs.snmp::syno.snmp] Collection took longer than expected; not complete after interval of 1m0s
2022-10-20T12:21:14+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 22.585474ms
2022-10-20T12:21:14+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:23+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:33+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:43+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:21:53+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:22:03+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:22:05+02:00 D! [inputs.snmp::syno.snmp] Previous collection has not completed; scheduled collection skipped
2022-10-20T12:22:05+02:00 W! [inputs.snmp::syno.snmp] Collection took longer than expected; not complete after interval of 1m0s
2022-10-20T12:22:13+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 10.382566ms
2022-10-20T12:22:13+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:22:23+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:22:33+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T12:22:43+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
I have no name!@telegraf:/$ telegraf --test
2022-10-20T10:23:49Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-20T12:23:49+02:00 I! Starting Telegraf 1.24.2
2022-10-20T12:23:49+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-20T12:23:49+02:00 I! Loaded inputs: snmp (2x)
2022-10-20T12:23:49+02:00 I! Loaded aggregators: 
2022-10-20T12:23:49+02:00 I! Loaded processors: converter strings
2022-10-20T12:23:49+02:00 W! Outputs are not used in testing mode!
2022-10-20T12:23:49+02:00 I! Tags enabled: host=telegraf
2022-10-20T12:23:49+02:00 D! [agent] Initializing plugins
2022-10-20T12:23:51+02:00 D! [agent] Starting service inputs
> snmp.hik,agent_host=192.168.2.21,host=telegraf cpuPercent=67i,deviceID="1",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.21",macAddr="bc-ba-c2-13-ce-ef",manufacturer="Hikvision",memUsed=56i,restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1666261432000000000
> snmp.hik,agent_host=192.168.2.23,host=telegraf cpuPercent=67i,deviceID="3",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.23",macAddr="c0-51-7e-84-b7-f1",manufacturer="Hikvision",memUsed=55i,restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1666261432000000000
> snmp.hik,agent_host=192.168.2.24,host=telegraf cpuPercent=57i,deviceID="4",deviceModel="DS-2CD2085FWD-I",dynIpAddr="192.168.2.24",macAddr="58-50-ed-72-87-2d",manufacturer="Hikvision",memUsed=71i,restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1666261432000000000
> snmp.hik,agent_host=192.168.2.22,host=telegraf cpuPercent=69i,deviceID="2",deviceModel="DS-2CD2045FWD-I",dynIpAddr="192.168.2.22",macAddr="bc-ba-c2-13-ce-bd",manufacturer="Hikvision",memUsed=56i,restartDev=0i,softwVersion="V5.6.6 build 210625",staticIpAddr="0.0.0.0",vidEncode="H.264" 1666261432000000000
-----------------------------------------------------------------------------------------------------------------------

The HIK data go up but for the Syno data the test also remains "blocked". After 10 minutes, still nothing more!

I don't understand what's going on ...

Hipska commented 2 years ago

So by only changing version to 2, you do directly get the data?

ashkii7 commented 2 years ago

@Hipska Hello, Yes, as I explained in the first post, with the same telegraf.conf just modified file to adapt the connection settings to version 2 of SNMP, I get all Syno and Hik data instantly.

ashkii7 commented 2 years ago

@Hipska Hello, For your information I did two new tests:

In the first case, I get this and no data collected:

-----------------------------------------------------------------------------------------------------------------------
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker logs -f telegraf
2022-10-20T16:35:52Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-20T18:35:52+02:00 I! Starting Telegraf 1.24.2
2022-10-20T18:35:52+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-20T18:35:52+02:00 I! Loaded inputs: snmp
2022-10-20T18:35:52+02:00 I! Loaded aggregators:
2022-10-20T18:35:52+02:00 I! Loaded processors: converter strings
2022-10-20T18:35:52+02:00 I! Loaded outputs: influxdb_v2
2022-10-20T18:35:52+02:00 I! Tags enabled: host=telegraf
2022-10-20T18:35:52+02:00 I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
2022-10-20T18:35:52+02:00 D! [agent] Initializing plugins
2022-10-20T18:35:54+02:00 D! [agent] Connecting outputs
2022-10-20T18:35:54+02:00 D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-10-20T18:35:54+02:00 D! [agent] Successfully connected to outputs.influxdb_v2
2022-10-20T18:35:54+02:00 D! [agent] Starting service inputs
2022-10-20T18:36:04+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:36:14+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:36:24+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:36:34+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:36:44+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:36:54+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:00+02:00 D! [inputs.snmp::syno.snmp] Previous collection has not completed; scheduled collection skipped
2022-10-20T18:37:00+02:00 W! [inputs.snmp::syno.snmp] Collection took longer than expected; not complete after interval of 1m0s
2022-10-20T18:37:04+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:14+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:24+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:34+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:44+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:37:54+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T18:38:00+02:00 D! [inputs.snmp::syno.snmp] Previous collection has not completed; scheduled collection skipped
2022-10-20T18:38:00+02:00 W! [inputs.snmp::syno.snmp] Collection took longer than expected; not complete after interval of 1m0s
2022-10-20T18:38:04+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
-----------------------------------------------------------------------------------------------------------------------

In the second case, I get this with data collected but a lot of error "buffer fullness" (as in the first case):

-----------------------------------------------------------------------------------------------------------------------
root@Maeva56:/volume1/docker/scripts_install/monitoring/telegraf# docker logs -f telegraf
2022-10-20T17:36:38Z I! Using config file: /etc/telegraf/telegraf.conf
2022-10-20T19:36:38+02:00 I! Starting Telegraf 1.24.2
2022-10-20T19:36:38+02:00 I! Available plugins: 222 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-20T19:36:38+02:00 I! Loaded inputs: snmp
2022-10-20T19:36:38+02:00 I! Loaded aggregators:
2022-10-20T19:36:38+02:00 I! Loaded processors: converter strings
2022-10-20T19:36:38+02:00 I! Loaded outputs: influxdb_v2
2022-10-20T19:36:38+02:00 I! Tags enabled: host=telegraf
2022-10-20T19:36:38+02:00 I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
2022-10-20T19:36:38+02:00 D! [agent] Initializing plugins
2022-10-20T19:36:40+02:00 D! [agent] Connecting outputs
2022-10-20T19:36:40+02:00 D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-10-20T19:36:40+02:00 D! [agent] Successfully connected to outputs.influxdb_v2
2022-10-20T19:36:40+02:00 D! [agent] Starting service inputs
2022-10-20T19:36:50+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:00+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 315.224413ms
2022-10-20T19:37:00+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:10+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:20+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:30+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:40+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:37:50+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:00+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 10.530067ms
2022-10-20T19:38:00+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:10+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:20+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:30+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:40+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:38:50+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:00+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 9.668451ms
2022-10-20T19:39:00+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:10+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:20+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:30+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:40+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:39:50+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:40:00+02:00 D! [outputs.influxdb_v2] Wrote batch of 4 metrics in 10.307016ms
2022-10-20T19:40:00+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:40:10+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2022-10-20T19:40:20+02:00 D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
-----------------------------------------------------------------------------------------------------------------------
ashkii7 commented 1 year ago

@Hipska Hello, I come back to you to get news about my problem

Hipska commented 1 year ago

Hi, sorry for this late response, but it looks like here is the same/similar issue #12435. Would you be able to confirm?

Hipska commented 1 year ago

@ashkii7 could you confirm please?

ashkii7 commented 1 year ago

@Hipska Hi, Sorry for the delay to answer you, but I did not test the issue #12435. I have not done any tests since my initial post for a long time to devote to it. So I cannot give you the confirmation (or not) that you want. Sorry again. I would come back to you for this problem later.

Hipska commented 1 year ago

Are you ok we close this for now? You can reopen or create a new issue if you encounter problems again with latest versions of telegraf.

ashkii7 commented 1 year ago

Hi, OK you can close this issue, i reopen it later if needed