From d10c11989b39aec62c81f301156089bb1fca49b9 Mon Sep 17 00:00:00 2001 From: HaseHarald Date: Sun, 11 Apr 2021 18:26:09 +0200 Subject: [PATCH] [btrfs_device_stats] Allow for configuring warning values as a global and individual value. --- plugins/disk/btrfs_device_stats | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/disk/btrfs_device_stats b/plugins/disk/btrfs_device_stats index c586a23c..191f002c 100755 --- a/plugins/disk/btrfs_device_stats +++ b/plugins/disk/btrfs_device_stats @@ -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("")