Python script that can be used to capture BTRFS information in telegraf
Currently it captures the following information for all the pools mounted at the time of running
- write_io_errs
- read_io_errs
- flush_io_errs
- corruption_errs
- generation_errs
- Data (total, used, free)
- System (total, used, free)
- Metadata (total, used, free)
- GlobalReserve (total, used, free)
- 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)
- Install and place btrfs.read.py in location accessible by telgraf. For example /etc/telegraf/btrfs.read.py
- Grant telegraf permission to sudo btrfs command without password by adding the following to /etc/sudoers
telegraf ALL=(root) NOPASSWD: /usr/local/bin/btrfs
- Update /etc/telegraf/telegraf.conf to call the script
[[inputs.exec]]
commands = [
"python /etc/telegraf/btrfs.read.py"
]
timeout = "5s"
data_format = "influx"
- python
- btrfs-tools
If you find this usefull and you would like to support please the use option below.