1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -2,12 +2,12 @@
#
# Plugin to monitor a ZFS Filesystem
#
# Wildcard-plugin to monitor a zfs filesystems.
# Wildcard-plugin to monitor a zfs filesystems.
#
# To monitor a filesystem, link zfs_fs_<zpool>_<filesystem> to this file. E.g.
#
# ln -s /usr/share/munin/node/plugins-auto/zfs_fs_ /etc/munin/node.d/zfs_fs_tank_foo
#
#
# ...will monitor tank/foo fs.
#
# You can monitor zpool as well by a link on zfs_fs_<zpool>
@ -16,7 +16,7 @@
#
# config (required)
# autoconf (optional - used by munin-config)
#
#
# ** WARNING **
# For now this plugin does not allow "_" in the name of a zpool or filesystems
#

View file

@ -42,8 +42,8 @@ if [ "$1" = "config" ]; then
echo 'graph_info This graph shows the ARC Efficiency'
/usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /Efficiency/ {print}' | \
awk '/^\t.*%/ {sub("\t","");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
awk '/^\t.*%/ {sub("\t","");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
exit 0
fi

View file

@ -42,8 +42,8 @@ if [ "$1" = "config" ]; then
echo 'graph_info This graph shows the ARC Size utilization'
/usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /^ARC Size/ {print}' | \
awk '/^\t/ {sub("\t","");sub(/ \(.*\):.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
awk '/^\t/ {sub("\t","");sub(/ \(.*\):.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
exit 0
fi

View file

@ -42,7 +42,7 @@ if [ "$1" = "config" ]; then
echo 'graph_info This graph shows the ARC cache hits by cache list'
/usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /CACHE HITS BY CACHE LIST/ {print}' | \
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/ \(.*\):/,":");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/ \(.*\):/,":");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
exit 0
fi

View file

@ -42,10 +42,10 @@ if [ "$1" = "config" ]; then
echo 'graph_info This graph shows the ARC cache hits and misses by data type'
/usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /HITS BY DATA TYPE/ {print}' | \
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (hits)"; gsub(/[ .]/,"_",$0); print "hits_"$0".label "displayname"\nhits_"$0".min 0"}'
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (hits)"; gsub(/[ .]/,"_",$0); print "hits_"$0".label "displayname"\nhits_"$0".min 0"}'
/usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /MISSES BY DATA TYPE/ {print}' | \
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (misses)"; gsub(/[ .]/,"_",$0); print "misses_"$0".label "displayname"\nmisses_"$0".min -100"}'
awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (misses)"; gsub(/[ .]/,"_",$0); print "misses_"$0".label "displayname"\nmisses_"$0".min -100"}'
exit 0
fi

View file

@ -41,9 +41,9 @@ if [ "$1" = "config" ]; then
echo 'graph_category fs'
echo 'graph_info This graph shows the DMU prefech stats'
/usr/local/bin/zfs-stats -Z | awk '/Hit Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
/usr/local/bin/zfs-stats -Z | awk '/Miss Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min -100"}'
/usr/local/bin/zfs-stats -Z | awk '/Hit Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}'
/usr/local/bin/zfs-stats -Z | awk '/Miss Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min -100"}'
exit 0
fi

View file

@ -25,7 +25,7 @@
For FreeBSD, it should be necessary to change shebang /bin/bash -> /usr/local/bin/bash
=head1 ENVIRONMENT VARIABLES
None
=head1 AUTHOR
@ -66,7 +66,7 @@ get_osname() {
SunOS)
case $osver in
illumos*)
osname=illumos
osname=illumos
;;
esac
;;
@ -84,7 +84,7 @@ preconfig() {
case $func in
size)
global_attr="
graph_title ZFS ARC - Size
graph_title ZFS ARC - Size
graph_category fs
graph_args --base 1024 --lower-limit 0
graph_vlabel Bytes
@ -150,7 +150,7 @@ preconfig() {
"
data_attr="
mfu_ghost_hits DERIVE LINE dummy
mfu_hits DERIVE LINE MFU
mfu_hits DERIVE LINE MFU
mru_ghost_hits DERIVE LINE dummy
mru_hits DERIVE LINE MRU
"
@ -219,12 +219,12 @@ preconfig() {
echo "Unknown function: $func"
exit 1
;;
esac
esac
}
do_config() {
local func=$1
local label_max_length=45
local label_max_length=45
local field type draw label
preconfig "$func"
@ -254,7 +254,7 @@ do_config() {
get_stats() {
local arcstats stat value
case $osname in
SunOS|illumos)
arcstats=$( kstat -p 'zfs:0:arcstats' | sed -e 's/:/ /g' | awk '{ print $4,$5 }' )
@ -286,8 +286,8 @@ get_stats() {
esac
while read -r stat value
do
printf -v "arcstats_${stat}" "%s" "$value"
do
printf -v "arcstats_${stat}" "%s" "$value"
# printf -v means indirect variable assignment (similar to eval)
done <<< "$arcstats"
}
@ -303,8 +303,8 @@ do_fetch() {
do
[ -z "$field" ] && continue
ref="arcstats_${field}"
value=${!ref:-0}
ref="arcstats_${field}"
value=${!ref:-0}
# ${!varname} means indirect evaluation (similar to eval)
echo "${field}.value ${value}"

View file

@ -16,7 +16,7 @@ graph_title ZFS ARC efficiency
graph_vlabel %
graph_scale no
graph_category fs
graph_args -l 0
graph_args -l 0
graph_info FreeBSD ZFS ARC Utilisation - Counters
graph_period minute
graph_order hits misses l2_hits l2_misses mfu_hits mru_hits arc_access_total mfu_hits_perc mru_hits_perc arc_misses_perc l2_efficency_tot

View file

@ -29,7 +29,7 @@ fi
case $i in
*) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;;
esac
echo -n "$name.value "
echo -n "$name.value "
echo $i|awk '{ print $4}' | awk ' /T/ {print $1*1000000}; /G/ {print $1*1000}; /M/ {print "777"}; /K/ {print "1"}' | sed 's/^\$name.value //'
done

View file

@ -26,7 +26,7 @@
user root
=head1 ENVIRONMENT VARIABLES
critical : default 90
warning : default 80
@ -132,7 +132,7 @@ preconfig() {
do_config() {
local func="$1"
local label_max_length=45
local label_max_length=45
local field type draw label
preconfig "$func"