Hi all,
I’m trying to configure monitoring a Qnap with Telegram (ver 1.30.3), InfluxDB (V2) and Grafana => QNAP Dashboard - Telegraf SNMP - InfluxDB | Grafana Labs
file config of Telegraf:
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 = false
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 = “”
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 = “0d”
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 = “0MB”
Maximum number of rotated archives to keep, any older logs are deleted.
If set to -1, no archives are removed.
logfile_rotation_max_archives = 5
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 = [“ht tps://us-west-2-1.aws.cloud2.influxdata.com”]
urls = [“ht tp://192.168.1.25:8086”]
Token for authentication.
token = “$INFLUX_TOKEN”
Organization is the name of the organization you wish to write to; must exist.
organization = “fritz_users”
Destination bucket to write into.
bucket = “telegraf”
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 = “ht tp://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
Retrieves SNMP values from remote agents
[[inputs.snmp]]
Agent addresses to retrieve values from.
format: agents = [“scheme://:”]
scheme: optional, either udp, udp4, udp6, tcp, tcp4, tcp6.
default is udp
port: optional
example: agents = [“udp://127.0.0.1:161”]
agents = [“tcp://127.0.0.1:161”]
agents = [“udp4://v4only-snmp-agent”]
agents = [“udp://192.168.1.24:161”]
Timeout for each request.
timeout = “5s”
SNMP version; can be 1, 2, or 3.
version = 2
Unconnected UDP socket
When true, SNMP reponses are accepted from any address not just
the requested address. This can be useful when gathering from
redundant/failover systems.
unconnected_udp_socket = false
Path to mib files
Used by the gosmi translator.
To add paths when translating with netsnmp, use the MIBDIRS environment variable
path = [“/usr/share/snmp/mibs”]
SNMP community string.
community = “monitoring-ro”
Agent host tag
agent_host_tag = “snmp.QNAP”
Number of retries to attempt.
retries = 3
The GETBULK max-repetitions parameter.
max_repetitions = 10
SNMPv3 authentication and encryption options.
Security Name.
sec_name = “myuser”
Authentication protocol; one of “MD5”, “SHA”, “SHA224”, “SHA256”, “SHA384”, “SHA512” or “”.
auth_protocol = “MD5”
Authentication password.
auth_password = “pass”
Security Level; one of “noAuthNoPriv”, “authNoPriv”, or “authPriv”.
sec_level = “authNoPriv”
Context Name.
context_name = “”
Privacy protocol used for encrypted messages; one of “DES”, “AES”, “AES192”, “AES192C”, “AES256”, “AES256C”, or “”.
Protocols “AES192”, “AES192”, “AES256”, and “AES256C” require the underlying net-snmp tools
to be compiled with --enable-blumenthal-aes (ht tp://www.net-snmp.org/docs/INSTALL.html)
priv_protocol = “”
Privacy password used for encrypted messages.
priv_password = “”
Add fields and tables defining the variables you wish to collect. This
example collects the system uptime and interface variables. Reference the
full plugin documentation for configuration details.
System Details & Metrics
CPU
[[inputs.snmp.field]]
name = “name”
oid = “NAS-MIB::enclosureName.1”
is_tag = true
[[inputs.snmp.table]]
name = “snmp.QNAP.cpuTable”
oid = “NAS-MIB::cpuTable”
[[inputs.snmp.table.field]]
name = “cpuIndex”
oid = “NAS-MIB::cpuIndex”
is_tag = true
[[inputs.snmp.table.field]]
name = “cpuID”
oid = “NAS-MIB::cpuID”
is_tag = true
[[inputs.snmp.table.field]]
name = “cpuUsage”
oid = “NAS-MIB::cpuUsage”
System
Enclosures
[[inputs.snmp.table]]
name = “snmp.QNAP.systemTable”
Memory
[[inputs.snmp.table.field]]
name = “systemTotalMemEX”
oid = “NAS-MIB::systemTotalMemEX”
[[inputs.snmp.table.field]]
name = “systemFreeMemEX”
oid = “NAS-MIB::systemFreeMemEX”
System temp
[[inputs.snmp.table.field]]
name = “cpu-TemperatureEX”
oid = “NAS-MIB::cpu-TemperatureEX”
[[inputs.snmp.table.field]]
name = “systemTemperatureEX”
oid = “NAS-MIB::systemTemperatureEX”
Uptime
[[inputs.snmp.table.field]]
name = “systemUptime”
oid = “NAS-MIB::systemUptimeEX”
Uptime
[[inputs.snmp.table.field]]
name = “systemCPU-UsageEX”
oid = “NAS-MIB::systemCPU-UsageEX”
Enclosures
[[inputs.snmp.table]]
name = “snmp.QNAP.enclosureTable”
oid = “NAS-MIB::enclosureTable”
# Memory
[[inputs.snmp.table.field]]
name = “enclosureID”
oid = “NAS-MIB::enclosureID”
is_tag = true
[[inputs.snmp.table.field]]
name = “enclosureModel”
oid = “NAS-MIB::enclosureModel”
is_tag = true
[[inputs.snmp.table.field]]
name = “enclosureName”
oid = “NAS-MIB::enclosureName”
is_tag = true
[[inputs.snmp.table.field]]
name = “enclosureSystemTemp”
oid = “NAS-MIB::enclosureSystemTemp”
Fan
[[inputs.snmp.table]]
name = “snmp.QNAP.systemFanTableEx”
oid = “NAS-MIB::systemFanTableEx”
[[inputs.snmp.table.field]]
name = “sysFanIndexEX”
oid = “NAS-MIB::sysFanIndexEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “sysFanDescrEX”
oid = “NAS-MIB::sysFanDescrEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “sysFanSpeedEX”
oid = “NAS-MIB::sysFanSpeedEX”
Power
[[inputs.snmp.table]]
name = “snmp.QNAP.systemPowerTable”
oid = “NAS-MIB::systemPowerTable”
[[inputs.snmp.table.field]]
name = “systemPowerIndex”
oid = “NAS-MIB::systemPowerIndex”
is_tag = true
[[inputs.snmp.table.field]]
name = “systemPowerID”
oid = “NAS-MIB::systemPowerID”
is_tag = true
[[inputs.snmp.table.field]]
name = “systemPowerEnclosureID”
oid = “NAS-MIB::systemPowerEnclosureID”
is_tag = true
[[inputs.snmp.table.field]]
name = “systemPowerStatus”
oid = “NAS-MIB::systemPowerStatus”
[[inputs.snmp.table.field]]
name = “systemPowerFanSpeed”
oid = “NAS-MIB::systemPowerFanSpeed”
[[inputs.snmp.table.field]]
name = “systemPowerFanSpeed”
oid = “NAS-MIB::systemPowerFanSpeed”
[[inputs.snmp.table.field]]
name = “systemPowerTemp”
oid = “NAS-MIB::systemPowerTemp”
Interfaces
[[inputs.snmp.table]]
name = “snmp.QNAP.systemIfTableEx”
oid = “NAS-MIB::systemIfTableEx”
[[inputs.snmp.table.field]]
name = “ifIndexEX”
oid = “NAS-MIB::ifIndexEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “ifDescrEX”
oid = “NAS-MIB::ifDescrEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “ifPacketsReceivedEX”
oid = “NAS-MIB::ifPacketsReceivedEX”
[[inputs.snmp.table.field]]
name = “ifPacketsSentEX”
oid = “NAS-MIB::ifPacketsSentEX”
[[inputs.snmp.table.field]]
name = “ifErrorPacketsEX”
oid = “NAS-MIB::ifErrorPacketsEX”
Interfaces
[[inputs.snmp.table]]
name = “snmp.QNAP.ifXTable”
oid = “IF-MIB::ifXTable”
[[inputs.snmp.table.field]]
name = “ifName”
oid = “IF-MIB::ifName”
is_tag = true
[[inputs.snmp.table.field]]
name = “ifHCInOctets”
oid = “IF-MIB::ifHCInOctets”
[[inputs.snmp.table.field]]
name = “ifHCOutOctets”
oid = “IF-MIB::ifHCOutOctets”
Disk Details & Metrics
Disk
[[inputs.snmp.table]]
name = “snmp.QNAP.diskTable”
oid = “NAS-MIB::diskTable”
[[inputs.snmp.table.field]]
name = “diskIndex”
oid = “NAS-MIB::diskIndex”
is_tag = true
[[inputs.snmp.table.field]]
name = “diskID”
oid = “NAS-MIB::diskID”
is_tag = true
[[inputs.snmp.table.field]]
name = “diskEnclosureID”
oid = “NAS-MIB::diskEnclosureID”
is_tag = true
[[inputs.snmp.table.field]]
name = “diskSummary”
oid = “NAS-MIB::diskSummary”
[[inputs.snmp.table.field]]
name = “diskTemperture”
oid = “NAS-MIB::diskTemperture”
[[inputs.snmp.table.field]]
name = “diskSmartInfo”
oid = “NAS-MIB::diskSmartInfo”
[[inputs.snmp.table.field]]
name = “diskGlobalSpare”
oid = “NAS-MIB::diskGlobalSpare”
[[inputs.snmp.table.field]]
name = “diskModel”
oid = “NAS-MIB::diskModel”
is_tag = true
[[inputs.snmp.table.field]]
name = “diskCapacity”
oid = “NAS-MIB::diskCapacity”
is_tag = true
Volume Details & Metrics
Volumes
[[inputs.snmp.table]]
name = “snmp.QNAP.systemVolumeTableEx”
oid = “NAS-MIB::systemVolumeTableEx”
[[inputs.snmp.table.field]]
name = “sysVolumeIndexEX”
oid = “NAS-MIB::sysVolumeIndexEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “sysVolumeDescrEX”
oid = “NAS-MIB::sysVolumeDescrEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “sysVolumeFSEX”
oid = “NAS-MIB::sysVolumeFSEX”
is_tag = true
[[inputs.snmp.table.field]]
name = “sysVolumeTotalSizeEX”
oid = “NAS-MIB::sysVolumeTotalSize”
[[inputs.snmp.table.field]]
name = “sysVolumeFreeSize”
oid = “NAS-MIB::sysVolumeFreeSizeEX”
[[inputs.snmp.table.field]]
name = “sysVolumeStatus”
oid = “NAS-MIB::sysVolumeStatusEX”
Disk Performance Details & Metrics
Disk Performance
[[inputs.snmp.table]]
name = “snmp.QNAP.diskPerformanceTable”
oid = “NAS-MIB::diskPerformanceTable”
[[inputs.snmp.table.field]]
name = “diskPerformanceIndex”
oid = “NAS-MIB::diskPerformanceIndex”
is_tag = true
[[inputs.snmp.table.field]]
name = “blvID”
oid = “NAS-MIB::blvID”
is_tag = true
[[inputs.snmp.table.field]]
name = “iops”
oid = “NAS-MIB::iops”
[[inputs.snmp.table.field]]
name = “latency”
oid = “NAS-MIB::latency”
JBOD
[[inputs.snmp.table]]
name = “snmp.QNAP.jBODHdTable1”
oid = “NAS-MIB::jBODHdTable1”
[[inputs.snmp.table.field]]
name = “jBODHdIndex1”
oid = “NAS-MIB::jBODHdIndex1”
is_tag = true
[[inputs.snmp.table.field]]
name = “jBODHdDescr1”
oid = “NAS-MIB::jBODHdDescr1”
is_tag = true
[[inputs.snmp.table.field]]
name = “jBODHdTemperature1”
oid = “NAS-MIB::sysVolumeFSEX”
[[inputs.snmp.table.field]]
name = “jBODHdStatus1”
oid = “NAS-MIB::jBODHdStatus1”
[[inputs.snmp.table.field]]
name = “jBODHdModel1”
oid = “NAS-MIB::jBODHdModel1”
is_tag = true
[[inputs.snmp.table.field]]
name = "jBODHdCapacity1 "
oid = “NAS-MIB::jBODHdCapacity1”
[[inputs.snmp.table.field]]
name = “jBODHdSmartInfo1”
oid = “NAS-MIB::jBODHdSmartInfo1”
but if I paste the API token and try to start telegraf:
telegraf --config ht tp://192.168.1.25:8086/api/v2/telegrafs/XXXXXXXXX
I have this result:
I! Loading config: ht tp://192.168.1.25:8086/api/v2/telegrafs/XXXXXXXX
I! Starting Telegraf 1.30.3 brought to you by InfluxData the makers of InfluxDB
I! Available plugins: 233 inputs, 9 aggregators, 31 processors, 24 parsers, 60 outputs, 6 secret-stores
I! Loaded inputs: snmp
I! Loaded aggregators:
I! Loaded processors:
I! Loaded secretstores:
I! Loaded outputs: influxdb_v2
I! Tags enabled: host=monitorr
I! [agent] Config: Interval:10s, Quiet:false, Hostname:“monitorr”, Flush Interval:10s
E! [telegraf] Error running agent: could not initialize input inputs.snmp: initializing table snmp.QNAP.cpuTable: translating: MIB search path: /home/monitor/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf
Cannot find module (NAS-MIB): At line 1 in (none)
NAS-MIB::cpuTable: Unknown Object Identifier: exit status 2
but in /usr/share/snmp/mibs NAS-MIB is present!
monitor@monitorr:/usr/share/snmp/mibs$ ll
total 308
drwxr-xr-x 2 root root 4096 Jun 3 16:02 ./
drwxr-xr-x 5 root root 4096 May 31 20:02 …/
-rw-r–r-- 1 root root 5931 Feb 17 2023 LM-SENSORS-MIB.txt
-rwxrwxrwx 1 root root 148598 May 31 20:31 NAS-MIB.txt*
-rw-r–r-- 1 root root 15901 Feb 17 2023 NET-SNMP-AGENT-MIB.txt
-rw-r–r-- 1 root root 9160 Feb 17 2023 NET-SNMP-EXAMPLES-MIB.txt
-rw-r–r-- 1 root root 9326 Feb 17 2023 NET-SNMP-EXTEND-MIB.txt
-rw-r–r-- 1 root root 2036 Feb 17 2023 NET-SNMP-MIB.txt
-rw-r–r-- 1 root root 3730 Feb 17 2023 NET-SNMP-PASS-MIB.txt
-rw-r–r-- 1 root root 4814 Feb 17 2023 NET-SNMP-TC.txt
-rw-r–r-- 1 root root 5039 Feb 17 2023 NET-SNMP-VACM-MIB.txt
-rw-r–r-- 1 root root 2163 Feb 17 2023 UCD-DEMO-MIB.txt
-rw-r–r-- 1 root root 4965 Feb 17 2023 UCD-DISKIO-MIB.txt
-rw-r–r-- 1 root root 3087 Feb 17 2023 UCD-DLMOD-MIB.txt
-rw-r–r-- 1 root root 8118 Feb 17 2023 UCD-IPFWACC-MIB.txt
-rw-r–r-- 1 root root 53338 Feb 17 2023 UCD-SNMP-MIB.txt
What could be the problem?
Thanks,
G.