no smart data in telegraf since 8.0

mcfly9

Member
May 11, 2022
26
3
8
Hi,

I have upgraded Proxmox from 7.4 to 8.0 recently and have noticed that smart attributes are not sent any more with telegraf. When I am running telegraf interactively, I am seeing smart attributes. When the service runs, less data is sent, smart data and attributes are missing.

I am not seeing any errors in the telegraf log, even if I crank it up to debug:

Code:
2023-07-20T09:46:04Z I! Starting Telegraf 1.27.2
2023-07-20T09:46:04Z I! Available plugins: 237 inputs, 9 aggregators, 28 processors, 23 parsers, 59 outputs, 4 secret-stores
2023-07-20T09:46:04Z I! Loaded inputs: cpu disk diskio kernel mem processes smart socket_listener swap system
2023-07-20T09:46:04Z I! Loaded aggregators:
2023-07-20T09:46:04Z I! Loaded processors:
2023-07-20T09:46:04Z I! Loaded secretstores:
2023-07-20T09:46:04Z I! Loaded outputs: influxdb_v2
2023-07-20T09:46:04Z I! Tags enabled: host=proxmox
2023-07-20T09:46:04Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"proxmox", Flush Interval:10s
2023-07-20T09:46:04Z D! [agent] Initializing plugins
2023-07-20T09:46:04Z D! [agent] Connecting outputs
2023-07-20T09:46:04Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2023-07-20T09:46:04Z D! [agent] Successfully connected to outputs.influxdb_v2
2023-07-20T09:46:04Z D! [agent] Starting service inputs
2023-07-20T09:46:04Z I! [inputs.socket_listener] Listening on udp://[::]:8089
2023-07-20T09:46:14Z D! [outputs.influxdb_v2] Wrote batch of 77 metrics in 12.231403ms
2023-07-20T09:46:14Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2023-07-20T09:46:24Z D! [outputs.influxdb_v2] Wrote batch of 126 metrics in 19.471541ms
2023-07-20T09:46:24Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

Sounds like an error happening when telegraf runs as a service... but how can I diagnose what's wrong?

If I run telegraf interactively, I am seeint 180+ metrics being transmitted:

telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d/ --debug --once

Code:
2023-07-20T09:47:35Z I! Starting Telegraf 1.27.2
2023-07-20T09:47:35Z I! Available plugins: 237 inputs, 9 aggregators, 28 processors, 23 parsers, 59 outputs, 4 secret-stores
2023-07-20T09:47:35Z I! Loaded inputs: cpu disk diskio kernel mem processes smart socket_listener swap system
2023-07-20T09:47:35Z I! Loaded aggregators:
2023-07-20T09:47:35Z I! Loaded processors:
2023-07-20T09:47:35Z I! Loaded secretstores:
2023-07-20T09:47:35Z I! Loaded outputs: influxdb_v2
2023-07-20T09:47:35Z I! Tags enabled: host=proxmox
2023-07-20T09:47:35Z D! [agent] Initializing plugins
2023-07-20T09:47:35Z D! [agent] Connecting outputs
2023-07-20T09:47:35Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2023-07-20T09:47:35Z D! [agent] Successfully connected to outputs.influxdb_v2
2023-07-20T09:47:35Z D! [agent] Starting service inputs
2023-07-20T09:47:35Z I! [inputs.socket_listener] Listening on udp://[::]:8089
2023-07-20T09:47:36Z D! [agent] Stopping service inputs
2023-07-20T09:47:36Z D! [agent] Input channel closed
2023-07-20T09:47:36Z I! [agent] Hang on, flushing any cached metrics before shutdown
2023-07-20T09:47:36Z D! [outputs.influxdb_v2] Wrote batch of 187 metrics in 21.909394ms
2023-07-20T09:47:36Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2023-07-20T09:47:36Z I! [agent] Stopping running outputs
2023-07-20T09:47:36Z D! [agent] Stopped Successfully

Any ideas where I could look to solve the issue?
 
telegraf does not appear to be part of a default Proxmox installation. It would help to know more about how you installed it. Did you follow a specific guide?

Have you updated the telegraf repository (probably in /etc/apt/sources.list.d/influxdb.list ) to bookworkm as well?

In your output udp socked is opened. Does it work after you do that? How are you trying to view the data which are "not sent"?
 
i guess this question would be more suited in their forum? https://community.influxdata.com/
You are right, sorry, I didn't think about that.

telegraf does not appear to be part of a default Proxmox installation. It would help to know more about how you installed it. Did you follow a specific guide?

Have you updated the telegraf repository (probably in /etc/apt/sources.list.d/influxdb.list ) to bookworkm as well?

In your output udp socked is opened. Does it work after you do that? How are you trying to view the data which are "not sent"?

Back when I have configured it, I have probably used the official guide from influxdata for Debian, adding the generic stable main to apt sources, then install using apt install: https://docs.influxdata.com/telegraf/v1.21/introduction/installation/

Unfortunately, I don't remember what else I did, but I am 100% positive that it has been working with the smart input configured with
use_sudo = false. I do not remember having installed sudo. This has been working correctly, up until I updated Proxmox to 8.0.

The UDP socket is used to ingest metrics from Proxmox. That part seems to work OK. I only have problems with the smart plugin. I have used network capture to compare what's being sent when running telegraf as a service vs. running manually as root.


Meanwhile, I have been able to get it working by installing sudo, changing the smart plugin to use sudo and then adding this using visudo:

Code:
Cmnd_Alias SMARTCTL = /usr/sbin/smartctl
telegraf  ALL=(ALL) NOPASSWD: SMARTCTL
Defaults!SMARTCTL !logfile, !syslog, !pam_session
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!