From eda5c9b4b4a83c47d83b3e66e6592ab809df6b96 Mon Sep 17 00:00:00 2001 From: Kael Shipman Date: Wed, 17 Oct 2018 20:32:44 -0500 Subject: [PATCH] Implemented minor changes as suggested by maintainer --- plugins/systemd/systemd_units | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/systemd/systemd_units b/plugins/systemd/systemd_units index 5d5f15f4..dc12d463 100755 --- a/plugins/systemd/systemd_units +++ b/plugins/systemd/systemd_units @@ -21,6 +21,9 @@ reloading, inactive, failed, activating, deactivating) like so: env.failed_critical 5 env.inactive_warning 10 env.inactive_critical 20 + +Note that for failed units, default warning and critical values are set to 0 and 10, respectively. No other +states have default levels set. =head1 AUTHOR @@ -39,6 +42,9 @@ GPLv2 . "$MUNIN_LIBDIR/plugins/plugin.sh" +failed_warning="${failed_warning:-0}" +failed_critical="${failed_critical:-10}" + states="active \ reloading \ inactive \ @@ -61,14 +67,8 @@ EOF for state in $states; do echo "$state.label $state" echo "$state.draw AREASTACK" - # Set default alert levels for failed units - if [ "$state" = "failed" ]; then - failed_warning="${failed_warning:-0}" print_warning $state - failed_critical="${failed_critical:-10}" print_critical $state - else - print_warning $state - print_critical $state - fi + print_warning $state + print_critical $state done }