1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!@@GOODSH@@
# -*- sh -*-
: << =cut
=head1 NAME
load - Plugin to monitor system load
=head1 CONFIGURATION
The following environment variables are used by this plugin:
=over 4
=item load_warning <float>
Threshold for when to report a warning
=item load_critical <float>
Threshold for when to report a critical
=back
=head2 EXAMPLE CONFIGURATION
[load]
env.load_warning 5
env.load_critical 10
=head1 AUTHOR
Unknown author
=head1 LICENSE
GPLv2
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
. "$MUNIN_LIBDIR/plugins/plugin.sh"
if [ "$1" = "autoconf" ]; then
echo 'yes'
exit 0
fi
if [ "$1" = "config" ]; then
cat <<EOF
graph_title Load average
graph_category system
graph_scale no
graph_vlabel load
graph_args --base 1000 -l 0
graph_info The load average of the machine describes how many processes are in the run-queue
load.label load
load.info 5 minute load average
EOF
print_warning load
print_critical load
exit 0
fi
# Hmm. Antall elementer endrer seg. (15 - 18)
# 4:30pm up 81 day(s), 10 min(s), 4 users, load average: 0.89, 0.55, 0.51
#
printf "load.value "
/bin/uptime | sed -e 's/.*, \([\.0-9]*\),.*/\1/g'
|