From d2ee68217e6fe2228a462ed5188df10483c5d3da Mon Sep 17 00:00:00 2001 From: Chl Date: Sun, 1 Oct 2023 01:32:25 +0200 Subject: [PATCH] nagios/btrfs: quick patch --- nagios/check_btrfs_quota.sh | 9 +++++---- nagios/etc/35_btrfs-checks.cfg | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 nagios/etc/35_btrfs-checks.cfg diff --git a/nagios/check_btrfs_quota.sh b/nagios/check_btrfs_quota.sh index e4ede15..50a70f5 100755 --- a/nagios/check_btrfs_quota.sh +++ b/nagios/check_btrfs_quota.sh @@ -109,6 +109,7 @@ check_freespace_is_above_threshold() { # 4: EXCL # 5: MAXRFER # 6: MAXEXCL +# 7: SUBVOLUMEPATH format_output_item() { local LOCAL_OUTPUT="" if [ "$5" != "none" ]; then @@ -125,7 +126,7 @@ format_output_item() { )" fi if [ -n "$LOCAL_OUTPUT" ]; then - printf "%s:%s (%s)" "$1" "$2" "$LOCAL_OUTPUT" + printf "%s:%s (%s)" "$1" "$2$( test -n "$7" && echo ":$7" )" "$LOCAL_OUTPUT" fi } @@ -175,7 +176,7 @@ while getopts hw:c:V: f; do # Loop on each qgroup # (the kinda weird <