mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
[btrfs_device_stats] Allow for configuring warning values as a global and individual value.
This commit is contained in:
parent
b392cacc4b
commit
d10c11989b
1 changed files with 8 additions and 6 deletions
|
@ -54,6 +54,7 @@ LGPLv3
|
|||
|
||||
|
||||
import btrfs
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
|
@ -77,6 +78,7 @@ def munin_config(fs):
|
|||
print("")
|
||||
|
||||
devices = fs.devices()
|
||||
warning = os.getenv('warning', default = 1)
|
||||
for this_device in devices:
|
||||
this_dev_info = fs.dev_info(this_device.devid)
|
||||
this_dev_name = this_dev_info.path.replace('/dev/', '')
|
||||
|
@ -88,18 +90,18 @@ def munin_config(fs):
|
|||
print("graph_info This graph shows stats of devices used by btrfs")
|
||||
|
||||
print("corruption_errs.label Corruption Errors")
|
||||
print("corruption_errs.warning 1")
|
||||
print("corruption_errs.warning " + os.getenv('corruption_errs_warning', default = str(warning)))
|
||||
print("flush_errs.label Flush Errors")
|
||||
print("flush_errs.warning 1")
|
||||
print("flush_errs.warning " + os.getenv('flush_errs_warning', default = str(warning)))
|
||||
print("generation_errs.label Generation Errors")
|
||||
print("generation_errs.warning 1")
|
||||
print("generation_errs.warning " + os.getenv('generation_errs_warning', default = str(warning)))
|
||||
print("read_errs.label Read Errors")
|
||||
print("read_errs.warning 1")
|
||||
print("read_errs.warning " + os.getenv('read_errs_warning', default = str(warning)))
|
||||
print("write_errs.label Write Errors")
|
||||
print("write_errs.warning 1")
|
||||
print("write_errs.warning " + os.getenv('write_errs_warning', default = str(warning)))
|
||||
print("nr_items.label Nr. of Items")
|
||||
print("flags.label Nr. of Flags")
|
||||
print("flags.warning 1")
|
||||
print("flags.warning " + os.getenv('flags_warning', default = str(warning)))
|
||||
|
||||
print("")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue