Skip to content

clara-j/telegraf-btrfs-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

telegraf-btrfs-exec

Python script that can be used to capture BTRFS information in telegraf

What does it capture

Currently it captures the following information for all the pools mounted at the time of running

$btrfs device stat

  • write_io_errs
  • read_io_errs
  • flush_io_errs
  • corruption_errs
  • generation_errs

$btrfs filesystem df

  • Data (total, used, free)
  • System (total, used, free)
  • Metadata (total, used, free)
  • GlobalReserve (total, used, free)

$btrfs filesystem usage

  • Device_size
  • Device_allocated
  • Device_unallocated
  • Device_missing
  • Used
  • Free_(estimated)
  • Data_ratio
  • Metadata_ratio
  • Global_reserve
  • Data (Per Device)
  • Metadata (Per Device)
  • System (Per Device)
  • Unallocated (Per Device)

Usage

  1. Install and place btrfs.read.py in location accessible by telgraf. For example /etc/telegraf/btrfs.read.py
  2. Grant telegraf permission to sudo btrfs command without password by adding the following to /etc/sudoers
telegraf ALL=(root) NOPASSWD: /usr/local/bin/btrfs
  1. Update /etc/telegraf/telegraf.conf to call the script
 [[inputs.exec]]
   commands = [
     "python /etc/telegraf/btrfs.read.py"
   ]
   timeout = "5s"
   data_format = "influx"

Requirements

  • python
  • btrfs-tools

Donation

If you find this usefull and you would like to support please the use option below.

paypal

About

Python script that can be used to capture BTRFS information in telegraf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages