Skip to main content

The smartd check

Project description

smartd

Overview

This integration monitors S.M.A.R.T. disk health by reading state files written by the smartd daemon (part of smartmontools). It collects key disk health attributes such as temperature, reallocated sectors, power-on hours, and pending sector counts, and reports the overall health status of each drive as a service check.

Unlike other approaches that shell out to smartctl (which requires root privileges), this integration reads the state files that smartd already maintains, making it work without any privilege escalation.

Setup

Prerequisites

  • The smartd daemon must be running and writing state files (default location: /var/lib/smartmontools/).
  • The dd-agent user must have read access to the state files (they are typically world-readable with 644 permissions).

Installation

For development, install the check in the Datadog Agent's Python environment:

datadog-agent integration install -e /path/to/smartd

For production, copy the check file and configuration:

cp datadog_checks/smartd/check.py /etc/datadog-agent/checks.d/smartd.py
mkdir -p /etc/datadog-agent/conf.d/smartd.d
cp datadog_checks/smartd/data/conf.yaml.example /etc/datadog-agent/conf.d/smartd.d/conf.yaml

Configuration

Edit /etc/datadog-agent/conf.d/smartd.d/conf.yaml to configure the check:

init_config:

instances:
  - smartd_state_dir: /var/lib/smartmontools
    min_collection_interval: 120

Then restart the Agent.

Validation

Run the Agent's status subcommand and look for smartd under the Checks section:

datadog-agent status

Or run the check directly:

datadog-agent check smartd

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this integration.

Service Checks

smartd.disk_health: Returns OK if the drive is healthy, WARNING if reallocated sectors, pending sectors, or offline uncorrectable counts are non-zero, CRITICAL if a normalized attribute value reaches 0.

smartd.can_read: Returns OK if smartd state files were found and parsed successfully, CRITICAL otherwise.

Events

The smartd integration does not include any events.

Support

For help, open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datadog_smartd-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datadog_smartd-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file datadog_smartd-0.1.0.tar.gz.

File metadata

  • Download URL: datadog_smartd-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datadog_smartd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5b908dc157516c28264e21c0fa8f3a02ce10a05fd48f0dc73c0e7395f87ed10
MD5 58723cd2f9c815c42db4d005e2387440
BLAKE2b-256 42f0172b578853c3afd206fadc1fe0648b57a84fdba6d1042573d5ff824c9859

See more details on using hashes here.

Provenance

The following attestation bundles were made for datadog_smartd-0.1.0.tar.gz:

Publisher: release.yml on jaredledvina/datadog-smartd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datadog_smartd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: datadog_smartd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datadog_smartd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7e0a838dea7399d3a336a1e109940153e5ad9c71633a31b58583c1d215b6fec
MD5 fdb00ca4ba63573204534aae2b3cbbb4
BLAKE2b-256 07cb50e9fa3160dfa24f8c2d5d957866e4a724e2164fc2465cfa8bb282d1768b

See more details on using hashes here.

Provenance

The following attestation bundles were made for datadog_smartd-0.1.0-py3-none-any.whl:

Publisher: release.yml on jaredledvina/datadog-smartd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page