Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial commit smartctl, telegraf #2319

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/inputs/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import (
_ "github.com/influxdata/telegraf/plugins/inputs/rethinkdb"
_ "github.com/influxdata/telegraf/plugins/inputs/riak"
_ "github.com/influxdata/telegraf/plugins/inputs/sensors"
_ "github.com/influxdata/telegraf/plugins/inputs/smartctl"
_ "github.com/influxdata/telegraf/plugins/inputs/snmp"
_ "github.com/influxdata/telegraf/plugins/inputs/snmp_legacy"
_ "github.com/influxdata/telegraf/plugins/inputs/sqlserver"
Expand Down
41 changes: 41 additions & 0 deletions plugins/inputs/smartctl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# S.M.A.R.T metrics collection

A linux-only collector to query metrics from smartmontools for S.M.A.R.T-capable
hard drives (HDDs), solid-state drives (SSDs) and others.

Read more on smartmontools at the [official](https://www.smartmontools.org/) link here.
Read more on S.M.A.R.T and its origin [here](https://en.wikipedia.org/wiki/S.M.A.R.T.)

# Sample Config
```
## smartctl requires installation of the smartmontools for your distro (linux only)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optional but it would be a nice touch to add the ability to override the smartctl location. smartctl_path = /usr/local/bin/smartctl.

## along with root permission to run. In this collector we presume sudo access to the
## binary.
##
## Users have the ability to specify an list of disk name to include, to exclude,
## or both. In this iteration of the collectors, you must specify the full smartctl
## path for the disk, we are not currently supporting regex. For example, to include/exclude
## /dev/sda from your list, you would specify:
## include = ["/dev/sda -d scsi"]
## exclude = ['/dev/sda -d scsi"]
##
## NOTE: If you specify an include list, this will skip the smartctl --scan function
## and only collect for those you've requested (minus any exclusions).
[[inputs.smartctl]]
include = ["/dev/bus/0 -d megaraid,24"]
exclude = ["/dev/sda -d scsi"]
```

# Points to note
1. The smartmontools are required to run with sudo permissions. This means two things:
you will have to enable your telegraf user with the proper sudo perms to run
smartmontools; and you should make sure the smartmontools pkg is installed :D

2. This collector is set to run a smartctl scan to find all disks on a system. If
this is not what you'd like to do, you can specify the disks you'd like to collect
by itemizing them in the `include` option in the telegraf config. This will skip
the scan command and ONLY run smartctl on those disks in the list.

3. A corollary to the `include` set of disks is the `exclude` set. In this case,
the scan will still be run unless `include` is defined but will limit those to
query for based on the set in the `exclude`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file will need updated to follow the example readme a bit more closely, especially with respect to the a description of the output.

Loading