NETWAYS / NETWAYS/check_disk_btrfs

[Feature]: Extend metrics being evaluated in the plugin

Open
#17 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
5
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Please try to fill out as much of the information below as you can. Thank you!
  • Yes, I've searched similar issues on GitHub and didn't find any.
Which version contains the bug?

3.1.0

Describe the bug

The usage output might be wrong and or confusing. Maybe we'll just use the percentage the btrfs output shows.

Output from the plugin:

'Data,RAID1': 11.66842% used (0.42458TB/3.6387TB), 
'Metadata,RAID1': 0.01452% used (0.00053TB/3.6387TB), 
'System,RAID1': 0.0% used (0.0TB/3.6387TB

Output from btrfs filesystem usage

Data,RAID1: Size:469225177088, Used:466829971456 (99.49%)
   /dev/sda     469225177088
   /dev/sdb     469225177088

Metadata,RAID1: Size:2147483648, Used:580681728 (27.04%)
   /dev/sda     2147483648
   /dev/sdb     2147483648

System,RAID1: Size:41943040, Used:81920 (0.20%)
   /dev/sda       41943040
   /dev/sdb       41943040

Full output:

check_disk_btrfs --btrfs-path /usr/bin/btrfs -V /tank --no-sudo -w 100 -c 100 -v --missing --error
/usr/bin/btrfs filesystem usage -b /tank
Label: Data,RAID1, Total: 469225177088, Used: 466829971456
Label: Metadata,RAID1, Total: 2147483648, Used: 580730880
Label: System,RAID1, Total: 41943040, Used: 81920
/usr/bin/btrfs filesystem show /tank
/usr/bin/btrfs scrub stat /tank
OK: 'Data,RAID1': 11.66842% used (0.42458TB/3.6387TB), 'Metadata,RAID1': 0.01452% used (0.00053TB/3.6387TB), 'System,RAID1': 0.0% used (0.0TB/3.6387TB) | dataraid1_used=466829971456;100;100;; dataraid1_total=4000797868032;100;100;; metadataraid1_used=580730880;100;100;; metadataraid1_total=4000797868032;100;100;; systemraid1_used=81920;100;100;; systemraid1_total=4000797868032;100;100;;
/usr/bin/btrfs filesystem usage -b /tank
Overall:
    Device size:                     4000797868032
    Device allocated:                 942829207552
    Device unallocated:              3057968660480
    Device missing:                              0
    Device slack:                                0
    Used:                             934821470208
    Free (estimated):                1531379535872      (min: 1531379535872)
    Free (statfs, df):               1531378462720
    Data ratio:                               2.00
    Metadata ratio:                           2.00
    Global reserve:                      485900288      (used: 0)
    Multiple profiles:                          no

Data,RAID1: Size:469225177088, Used:466829971456 (99.49%)
   /dev/sda     469225177088
   /dev/sdb     469225177088

Metadata,RAID1: Size:2147483648, Used:580681728 (27.04%)
   /dev/sda     2147483648
   /dev/sdb     2147483648

System,RAID1: Size:41943040, Used:81920 (0.20%)
   /dev/sda       41943040
   /dev/sdb       41943040

Unallocated:
   /dev/sda     1528984330240
   /dev/sdb     1528984330240

See also https://github.com/NETWAYS/check_disk_btrfs/issues/13

How to recreate the bug?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the plugin code that parses btrfs filesystem usage -b output and compare its calculations with the supplied Data, Metadata, and System examples. The change is done when the plugin reports the percentages shown by btrfs filesystem usage and its usage output is no longer misleading for these profiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.