1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-18 16:48:44 +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

@ -19,8 +19,8 @@ env.fsroot /path/to/btrfs/filesystem
=head1 USAGE
Link/Copy this plugin to /etc/munin/plugins/ and restart the munin-node.
Link/Copy this plugin to /etc/munin/plugins/ and restart the munin-node.
=head1 AUTHOR
Alexander Knöbel <alex@belogy.de>

View file

@ -60,7 +60,7 @@ if [ "$1" = "autoconf" ]; then
fi
clean_name() {
echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{
echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{
if (\$3 == \"tmpfs\")
n=\$1\$2
else
@ -80,12 +80,12 @@ if [ "$1" = "config" ]; then
df -T -P -l -x none -x unknown -x udf -x iso9660 -x romfs -x ramfs -x tmpfs | sed 1d | grep -v "//" | sort | while read i; do
name=`clean_name $i`
echo -n "$name.label "
echo $i | awk "{
echo $i | awk "{
dir=\$7
if (length(dir) <= $MAXLABEL)
print dir
else
printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3))
print \"$name.info \" \$7 \" (\" \$2 \") -> \" \$1;
}"
echo "$name.warning 92"

View file

@ -16,10 +16,10 @@
# Requirements
# - bash (or change first line to sh instead of bash or any other shell)
# - existing and readable directory to scan
# - du command, it exists on most of the *nix operating systems
# - du command, it exists on most of the *nix operating systems
#
#################################################################
#
#
# Configuration
#
# directory to check
@ -44,8 +44,8 @@ ID=1;
# Changelog
#
# Revision 0.1 Tue 03 Feb 2009 02:16:02 PM CET _KaszpiR_
# - initial release,
#
# - initial release,
#
#################################################################
# Magick markers (optional - used by munin-config and som installation
# scripts):

View file

@ -33,7 +33,7 @@ print_details() {
val=`echo ${line#*:}`
val1=${val%% *}
[ -z "$line" ] && break
case "$key" in
"Mount count") myname=$1; mc=$val ;;
"Maximum mount count") mmc=$val ;;
@ -90,7 +90,7 @@ if [ "$1" = "config" ]; then
echo "graph_category disk"
args="-l 0"
case "$plugin" in
mounts)
mounts)
echo "graph_vlabel times"
echo "graph_title Ext2 Filesystem mount details"
;;
@ -98,14 +98,14 @@ if [ "$1" = "config" ]; then
echo "graph_vlabel days"
echo "graph_title Ext2 Filesystem fsck interval"
;;
writes)
writes)
args="$args --base 1024"
echo "graph_vlabel bytes"
echo "graph_title Ext2 Filesystem lifetime writes$blkdevAppend"
;;
esac
echo "graph_args $args"
if [ -z "$blkdev" ]; then
lse2
else

View file

@ -8,23 +8,23 @@ case $1 in
COUNTER=1
while [ $COUNTER -gt 0 ]; do
FILE_PATH="file${COUNTER}_path"
# Is the path for this file specified?
eval FILE=\$$FILE_PATH
if [ "$FILE" == "" ]; then
break;
fi
# It is! Add it to the graphs.
GRAPH_ORDER="$GRAPH_ORDER file_$COUNTER"
# Does this file have a specified label?
LABEL_COUNTER="file${COUNTER}_label"
eval LABEL=\$$LABEL_COUNTER
if [ "$LABEL" == "" ]; then
LABEL=`basename $FILE`
fi
# Associated warning level?
WARNING="file${COUNTER}_warning"
eval WARNING=\$$WARNING
@ -44,7 +44,7 @@ case $1 in
echo "file_$COUNTER.min 0"
let COUNTER=COUNTER+1
done;
echo "graph_order $GRAPH_ORDER"
echo "graph_title File age"
echo 'graph_args --base 1000 -l 0'
@ -63,14 +63,14 @@ while [ $COUNTER -gt 0 ]; do
if [ "$FILE" == "" ]; then
break;
fi
# If the file isn't readable, say it's zero.
# If the file isn't readable, say it's zero.
if [ ! -r "$FILE" ]; then
VALUE=0
else
VALUE=$(($(date +%s) - $(stat -c '%Y' "$FILE")))
fi
echo "file_$COUNTER.value $VALUE"
let COUNTER=COUNTER+1
done;

View file

@ -1,7 +1,7 @@
#!/bin/bash
# -*- sh -*-
#
# Multigraph plugin to monitor harddrive temperature, condition,
# Multigraph plugin to monitor harddrive temperature, condition,
# performance and estimated remaining lifetime through HDSentinel.
#
# To use, download the latest HDSentinel for Linux x86 or x64 from

View file

@ -77,7 +77,7 @@ while (<HPT>)
$name =~ s/\ /_/g;
# add the ID to be 100% unique
$name .= '_'.$id;
if ($mode eq 'config')
{
# only needed here in config
@ -95,7 +95,7 @@ while (<HPT>)
}
# calc warning from threshold, 5% less
my $warning = sprintf("%.0f", $threshold * 95 / 100);
print $name.".label ".$location."\n";
print $name.".warning ".$warning."\n";
print $name.".critical ".$threshold."\n";

View file

@ -3,7 +3,7 @@
# Plugin to monitor the % of allocated area of a LVM snapshot
#
# Parameters:
#
#
# config
# autoconf
#
@ -12,7 +12,7 @@
#
#%# family=auto
#%# capabilities=autoconf
#
#
# 2011/05/20 - pmoranga - initial version
#
# 2012/01/27 - Sébastien Gross
@ -35,7 +35,7 @@ fi
if [ "$1" = "config" ]; then
echo 'graph_title Allocated space for snapshot'
echo 'graph_title Allocated space for snapshot'
echo 'graph_vlabel %'
echo 'graph_category disk'
echo 'graph_args -l 0 -u 100 -r'
@ -48,7 +48,7 @@ ${lvdisplay} -C | awk '$3 ~ /^s/{print}' | while read line; do
origin="$(echo $line | awk '{print $5}')"
origin="$(clean_fieldname "$origin")"
percent="$(echo $line | awk '{print $6}')"
if [ "$1" = "config" ]; then
echo "$id.label $name snapshot of $origin"
else

View file

@ -1,72 +1,72 @@
#!/usr/bin/perl -w
#
# Munin plugin for MegaRAID
# Munin plugin for MegaRAID
# This plugin can graph:- Currently Drive Temperature and Error Count
#
#
#---------------------
# Examples
# Create a symbolic link to MegaRaid_<AdapterNumber>_<temp|error|other|predictive>
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_temp
# graph temperature on adapter 0
#
#
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_error
# graph media errors on adapter 0
#
#
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_1_temp
# graph temperature on adapter 1
#
#
#---------------------
# Log
# Revision 0.1 2011/04/16 idobson
# -First version only basic support of the MegaRaid controller
#
#
# Revision 0.2 2011/04/17 fkatzenb
# -Added bash statement to remove the log file created each time MegaCli64 is ran
# -Added a few comments and visual changes
#
#
# Revision 1.0 2011/04/17 fkatzenb
# -Revamped Code to symbolic link for sensor type and future growth
#
#
# Revision 1.1 2011/04/17 fkatzenb
# -Revised scalling
#
#
# Revision 1.2 2011/04/28 fkatzenb
# -Added support for graph_info support
# -Added warning & critical alerts support
# -Added data info
#
#
# Revision 2.0 2011/04/29 fkatzenb
# -Added remaining support for SMART Errors
#
#
# Revision 2.1 2011/04/29 fkatzenb
# -Added version information for in the graph description
#
#
#
#
#---------------------
#
#
# Add the following to your /etc/munin/plugin-conf.d/munin-node:
#
#
# [MegaRaid_*]
# user root
#
#
#---------------------
#
#
#
#
# Magic markers (optional - used by munin-config and installation scripts):
#
#
#%# family=auto
#%# capabilities=autoconf
#
#
my $DisplayVer=2.1;
use strict;
use warnings;
my $DevID=0; #Device Number found
my $DevData=0; #Device Data found
my $DevData=0; #Device Data found
# Parse out Adapter number and parameter desired from file name and remove whitespace
my $Parameters=`basename $0 | sed 's/^MegaRaid_//g' | tr '_' '-'` ;
my $Parameters=`basename $0 | sed 's/^MegaRaid_//g' | tr '_' '-'` ;
chomp $Parameters;
my ($Adapter,$Type)=split(/-/,$Parameters);
@ -128,13 +128,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
print "yes\n";
exit 0;
} else {
print "no\n";
print "no\n";
exit 1
}
}
#Read Output of MegaRaid command
$Command.=" -PDList -a".$Adapter;
$Command.=" -PDList -a".$Adapter;
my @Output=qx($Command);
#Munin Config Options
@ -145,14 +145,14 @@ if ($ARGV[0] and $ARGV[0] eq "config"){
print "graph_scale yes\n";
print "graph_category disk\n";
print "graph_info $config{$Type}->{description} <br />Generated by MegaRaid_, Version $DisplayVer<br />\n";
foreach my $Line (@Output) {
$Line=~ s/\r//g;
$Line=~ s/\n//g;
#Find the device ID
if ( $Line=~ m/Slot Number: /i ) {
$DevID=$Line;
if ( $Line=~ m/Slot Number: /i ) {
$DevID=$Line;
$DevID=~ s/Slot Number: //;
print "A".$Adapter."_D".$DevID."_$Type.label A$Adapter:D$DevID $config{$Type}->{label}\n";
print "A".$Adapter."_D".$DevID."_$Type.info Adapter: $Adapter / Drive: $DevID - $config{$Type}->{info_tag}\n";
@ -161,9 +161,9 @@ if ($ARGV[0] and $ARGV[0] eq "config"){
}
if ($config{$Type}->{critical} ne '') {
print "A".$Adapter."_D".$DevID."_$Type.critical $config{$Type}->{critical}\n";
}
}
}
}
}
exit 0;
}
@ -176,7 +176,7 @@ foreach my $Line (@Output) {
if ( $Line=~ m/Slot Number: /i ) { $DevID=$Line; $DevID=~ s/Slot Number: //; chomp $DevID; }
#Find the data and print it out
if ( $Line=~ m/$config{$Type}->{lookfor}/i ) {
if ( $Line=~ m/$config{$Type}->{lookfor}/i ) {
$DevData=$Line;
$DevData=~s/$config{$Type}->{lookfor}//;
$DevData=~s/C.*//;

View file

@ -1,8 +1,8 @@
#!/bin/bash
# Plugin to monitor harddrive temperatures connected to a MegaRAID controller
#
# Plugin must be ran as root so add these configuration in
#
# Plugin must be ran as root so add these configuration in
# /etc/munin/plugin-conf.d/munin-node.
#
# [megacli*]

View file

@ -28,18 +28,18 @@ You could define two alert levels, the graph language, min. human UID and dealin
env.humanuid [value] (default: 1000, only need if there is an other value define for UID_MIN in /etc/login.defs)
env.low_uid [never|no|yes] (default: never)
set to no for producing rrd files for system user, but don't show those graphs (e.g. for later analyses)
if set to yes system user graphs are drawn
if set to yes system user graphs are drawn
=head1 DESCRIPTION
Wild card Plugin for monitoring the utilization of devices with quota rules.
A graph is drawn for each user, which shows the usage as a percentage of his hard limit. System accounts (UID <1000) are suppressed.
In addition, a graph is displayed which indicates the ratio device size to device coverage.
The script repqutoa, usually part of the package quota, is needed.
Wild card Plugin for monitoring the utilization of devices with quota rules.
A graph is drawn for each user, which shows the usage as a percentage of his hard limit. System accounts (UID <1000) are suppressed.
In addition, a graph is displayed which indicates the ratio device size to device coverage.
The script repqutoa, usually part of the package quota, is needed.
The plugin itself can be stored in any directory. For example, the device sdb1 shell be monitored, a symbolic link must be created
in the /etc/munin/plugins/ directory as follows:
in the /etc/munin/plugins/ directory as follows:
=over
=over
I<<< ln -s /<path to file>/quota2percent_ quota2percent_sdb1 >>>
@ -72,7 +72,7 @@ V17.0214
add example graph for Munin Plugin Gallery
remove setting a PATH
remove German comments
remove German comments
V17.0124
@ -83,7 +83,7 @@ V17.0124
Jo Hartmann
=head1 LICENSE
GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
=cut
@ -142,7 +142,7 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
###################################################
# Reading the quotes for the selected device, using repquota
if repquota "/dev/$Id" &> /dev/null; then
if repquota "/dev/$Id" &> /dev/null; then
readarray Quotas < <( repquota "/dev/$Id" | grep " -- " )
else
echo "No limitations administered via 'quota' for $Id" >&2
@ -151,13 +151,13 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
# the avoidance of a divide-by-zero error
Quotas[0]="root -- 1 1 1 1 1 1"
# no rrd file need
# no rrd file need
Low_UID="never"
fi
readarray Totals < <( df "/dev/$Id" )
# Get the count of Users
# Get the count of Users
Users=${#Quotas[@]}
@ -167,7 +167,7 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
if [ "$1" = "config" ]; then
# Localisation of the graphic texts
# Localisation of the graphic texts
case $Language in
de)
echo "graph_title Quota-Hard-Limit von $Id"
@ -176,9 +176,9 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
Total_txt="Su. aller Nutzer"
Total_info="Inklusive Systemnutzer (UID < $Min_UID)"
;;
es)
echo "graph_title Cuota de límite absoluto de $Id"
echo "graph_vlabel el % de uso del límite duro"
es)
echo "graph_title Cuota de límite absoluto de $Id"
echo "graph_vlabel el % de uso del límite duro"
echo "graph_info El gráfico muestra la disponibilidad de espacio regulado por cuotas para todos los usuarios regulares (UID >= $Min_UID) como porcentaje de límites duros."
Total_txt="Suma de todos los usuarios "
Total_info="La inclusión de usuario del sistema (UID < $Min_UID) "
@ -188,11 +188,11 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
echo "graph_vlabel Usage in %"
echo "graph_info The graphic shows the allocation of the quota-regulated storage space for all regular users (UID >= $Min_UID) as a percentage of the hard limit ."
Total_txt="all users"
Total_info="system users (UID < $Min_UID) included"
Total_info="system users (UID < $Min_UID) included"
;;
esac
# Defaults configuration
# Defaults configuration
echo "graph_category disk"
echo "graph_args --lower-limit 0 --upper-limit 100"
echo "graph_printf %5.2lf %%"
@ -208,9 +208,9 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
# Determine the currently processing UID
Cur_UID="$(id -u "$User")"
# skip if actual user a system user und low_uid ist set to never
# skip if actual user a system user und low_uid ist set to never
[ "$Cur_UID" -lt "$Min_UID" ] && [ "$Low_UID" = "never" ] && continue
# No graph for none human uid if low_uid ist set to no
[ "$Cur_UID" -lt "$Min_UID" ] && echo "$Fieldname.graph $Low_UID"
@ -218,7 +218,7 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
echo "$Fieldname.label $User"
echo "$Fieldname.warning $Warning"
echo "$Fieldname.critical $Critical"
done
# configure the total line and send exit code NO ERROR happens
@ -238,15 +238,15 @@ GPLv2 (L<http://www.gnu.org/licenses/gpl-2.0.html>)
Quota=( ${Quotas[$i]} )
Fieldname="$(clean_fieldname "${Quota[0]}")"
# skip if actual user a system user und low_uid ist set to never
# skip if actual user a system user und low_uid ist set to never
[ "$Cur_UID" -lt "$Min_UID" ] && [ "$Low_UID" = "never" ] && continue
# write the result zu munin
# write the result zu munin
echo "${Quota[2]} ${Quota[4]} $Fieldname.value" | awk '{printf "%s %f\n",$3,$1*100/$2}'
done
# the value for the total line
# the value for the total line
Total=( ${Totals[1]} )
echo "${Total[2]} ${Total[1]} total.value" | awk '{printf "%s %f\n",$3,$1*100/$2}'

View file

@ -1,11 +1,11 @@
#!/usr/bin/perl -w
#
#
# (c) 2007 Nathan Rutman nathan@clusterfs.com
#
# Plugin to monitor RAID status
#
# Plugin to monitor RAID status
#
# Results are % of healthy drives in a raid device
# and % rebuilt of devices that are resyncing.
# and % rebuilt of devices that are resyncing.
#
#%# family=contrib
#%# capabilities=autoconf
@ -54,7 +54,7 @@ while (@text) {
$failed = $members;
$failed =~ s/[^F]+//g;
$failed = length($failed);
$line = shift @text;
if ($line =~ /$devstat_re/) {
# second line should like "123456 blocks super 1.2 [2/2] [UU]"
@ -66,7 +66,7 @@ while (@text) {
# second line did not exist on /proc/mdstat
next;
}
$line = shift @text;
if ($line =~ /$action_re/) {
# third line should like " [==>..................] check = 10.0% (12345/123456) finish=123min speed=12345/sec"

View file

@ -3,22 +3,22 @@
# Copyright (C) 2011 Rory Jaffe <rsjaffe@gmail.com>
# derived from md_sync_speed by Kristian Lyngstøl
# Copyright (C) 2010 Kristian Lyngstøl <kristian@bohemians.org>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#####
#
#
# Magic Markers:
# #%# family=auto
# #%# capabilities=autoconf

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Munin plugin which reports queue busy-values per online SCSI
Munin plugin which reports queue busy-values per online SCSI
device on Linux, as seen in /proc/scsi/sg/devices
If the busy-values often reach the queue depth of the device,
@ -11,7 +11,7 @@ plugin.
Wildcard use:
If your system has many SCSI-like devices, filtering may be needed
to make the resulting graphs readable.
If you symlink the plugin, so that it's executed as
If you symlink the plugin, so that it's executed as
scsi_queue_X_through_Y
then the plugin will only look at devices
/dev/sdX .. /dev/sdY
@ -27,7 +27,7 @@ X and Y are translated into a regular expression like:
# Released according to the "New BSD License" AKA the 3-clause
# BSD License:
# ====================================================================
# ====================================================================
# Copyright (c) 2010, Danish National Board of Health.
# All rights reserved.
#
@ -52,7 +52,7 @@ X and Y are translated into a regular expression like:
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ====================================================================
# ====================================================================
# $Id: scsi_queue 13630 2010-08-31 15:29:14Z tra $
@ -144,10 +144,10 @@ def map_procentries_to_devices(list_of_dicts,devfilter_regex):
# 2:0:0:0
# 3:0:0:0
#
# The colon-separated values map to the first four parts
# The colon-separated values map to the first four parts
# of /proc/scsi/sg/devices
# And the directory entries are symlinks which point to directories
# in /sys/devices. By following a symlink, we may end up in
# And the directory entries are symlinks which point to directories
# in /sys/devices. By following a symlink, we may end up in
# a directory which contains directory entries like:
# - block:sdb
# ...
@ -162,7 +162,7 @@ def map_procentries_to_devices(list_of_dicts,devfilter_regex):
# Search for dirent called block:SOMETHING
# Put SOMETHING into blockdev_name
# Couldn't make glob.glob() work: The length of the result
# Couldn't make glob.glob() work: The length of the result
# of glob() returned TypeError: len() of unsized object on
# RHEL 5's python...
dirents = os.listdir(sys_pathname)

View file

@ -189,7 +189,7 @@ def snmpwalk(root):
# Decode SNMP response
rsp.decode(answer)
# Make sure response matches request (request IDs, communities, etc)
if req != rsp:
raise 'Unmatched response: %s vs %s' % (str(req), str(rsp))

View file

@ -4,7 +4,7 @@
#
# Munin-plugin to monitor temperature on HP-servers.
# Uses SNMP, and needs hpasmd.
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,

View file

@ -94,7 +94,7 @@ while (<IN>) {
close(IN);
foreach my $func ( keys %config ) {
print "multigraph xfs_$func\n";
print "multigraph xfs_$func\n";
if (defined $ARGV[0] and $ARGV[0] eq 'config') {
print "graph_title $config{$func}->{title}\n";

View file

@ -37,7 +37,7 @@ shopt -s nocasematch
case $1 in
config)
cat <<'EOF'
cat <<'EOF'
graph_title XFS fragmentation
graph_vlabel Percent
graph_category disk
@ -64,4 +64,4 @@ do
echo $FIELDNAME.value $FRAG
fi
done