Skip to content

[[inputs.smartctl]] conflates name label for device name and attribute name #18385

@hackery

Description

@hackery

Relevant telegraf.conf

[[inputs.smartctl]]
  use_sudo = true

Logs from Telegraf

N/A

System info

Telegraf 1.37.1-1 Ubuntu 24.04

Docker

No response

Steps to reproduce

  1. Enable smartctl input

Expected behavior

The attribute metrics like smartctl_attributes_worst should use the name tag in the same way as the other metrics like smartctl_temperature, smartctl_power_on_hours use it, to identify the device by path, e.g. /dev/sda.

Actual behavior

Attribute metrics use the name tag for the attribute name. The device path does not appear anywhere in the tags.

Example (Prometheus output style):

smartctl_temperature{firmware="S0509A0",host="atom",model="TS240GMTS420S",name="/dev/sda",serial="sss",type="sat",wwn="nnn"} 62
smartctl_attributes_worst{host="atom",model="TS240GMTS420S",name="Valid_Spare_Block_Cnt",serial="sss",type="sat",wwn="nnn"} 100

Additional info

This makes it unwieldy to apply tag selection for related smrtctl metrics on the same dashboard, where the device name (path) is liable to be the primary, user-sensible selector for devices.
The device model number and serial number are available in tags for all metrics, but using these to link to metrics selected by device name is also unwieldy.

Edited: replace Prometheus "label" terminology with "tag".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions