Implemented minor changes as suggested by maintainer

This commit is contained in:
Kael Shipman 2018-10-17 20:32:44 -05:00 committed by GitHub
parent e4e5d3631c
commit eda5c9b4b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -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
}