Skip to content

Commit

Permalink
initial commit smartctl, telegraf
Browse files Browse the repository at this point in the history
  • Loading branch information
sebito91 committed Jan 25, 2017
1 parent 168270e commit 7daddd7
Show file tree
Hide file tree
Showing 5 changed files with 853 additions and 0 deletions.
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)
## 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`.
Loading

0 comments on commit 7daddd7

Please sign in to comment.