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

@ -17,7 +17,7 @@
# that die may not appear on the graph, and anyway their last chunk of
# CPU usage before they died is lost. You could modify this plugin to
# read SAR/psacct records if you care about that.
#
#
# 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

@ -17,7 +17,7 @@ graph="$plugin"
style="AREA"
cpus=$(grep -c ^processor /proc/cpuinfo)
run_watchdog() { # should also trap kill and term signals
run_watchdog() { # should also trap kill and term signals
kill -0 $(cat $pidfile) 2> /dev/null || rm -f $pidfile
}
@ -33,7 +33,7 @@ run_daemon() {
run_watchdog
if [ -f $pidfile ]; then
touch $pidfile
else
else
$pluginfull acquire &
fi
}
@ -54,9 +54,9 @@ graph_title $graph
graph_category 1sec
graph_vlabel average cpu use %
graph_scale no
graph_total All CPUs
graph_total All CPUs
update_rate 1
graph_data_size custom 1d, 10s for 1w, 1m for 1t, 5m for 1y
graph_data_size custom 1d, 10s for 1w, 1m for 1t, 5m for 1y
EOF
cpun=0
for ((i=0; i<$cpus; i++)); do

View file

@ -26,7 +26,7 @@
if [ "$1" = "autoconf" ] ; then
if [ "$1" = "autoconf" ] ; then
if [ -n "$procs" ] ; then
echo "yes"
else
@ -49,23 +49,23 @@ if [ "$1" = "config" ] ; then
echo 'graph_scale no'
echo 'graph_period second'
echo "graph_order $cprocs"
for proc in $procs; do
for proc in $procs; do
cproc=${proc//[^A-Za-z0-9_]/_}
echo "${cproc}.label $proc"
echo "${cproc}.info CPU used by process $proc"
done ;
exit
fi
for proc in $procs ; do {
cproc=${proc//[^A-Za-z0-9_]/_}
ps axo '%mem,comm,command' | grep -v grep | grep "$proc" | LC_ALL=us_US awk '
BEGIN {
SUM=0
BEGIN {
SUM=0
}
{
{
SUM+=1
COMM=$2
}

View file

@ -26,7 +26,7 @@
if [ "$1" = "autoconf" ] ; then
if [ "$1" = "autoconf" ] ; then
if [ -n "$procs" ] ; then
echo "yes"
else
@ -49,13 +49,13 @@ if [ "$1" = "config" ] ; then
echo 'graph_scale no'
echo 'graph_period second'
echo "graph_order $cprocs"
for proc in $procs; do
for proc in $procs; do
cproc=${proc//[^A-Za-z0-9_]/_}
echo "${cproc}.label $proc"
echo "${cproc}.info CPU used by process $proc"
done ;
exit
fi
@ -64,14 +64,14 @@ fi
for proc in $procs ; do {
cproc=${proc//[^A-Za-z0-9_]/_}
ps axo 'pcpu,comm,command' | grep -v grep | grep "$proc" | LC_ALL=us_US awk '
BEGIN {
SUM=0
BEGIN {
SUM=0
}
{
SUM+=$1
{
SUM+=$1
}
END {
print "'${cproc}'.value "SUM
END {
print "'${cproc}'.value "SUM
}
'
}