1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Merge pull request #156 from ndonegan/master

LVM Plugin Tidy
This commit is contained in:
Kenyon Ralph 2012-07-24 12:18:06 -07:00
commit aa2cb8468e

View file

@ -1,31 +1,58 @@
#!/bin/sh
#
# Script to monitor disk usage.
#
# By PatrickDK
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
# suggest
#
# Needs to be run as root, so the following needs to be added to the config:
#
# [lvm_]
# user root
#
# $Log$
#
# Magic markers (optional - used by munin-config and installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf suggest
# -*- sh -*-
: << EOF
=head1 NAME
lvm_ - Wildcard plugin for monitoring disk usage on LVM. Each Volume Group is graphed separately.
=head1 CONFIGURATION
This plugin needs to run as the root user in order to have permission to run lvs and vgs
[lvm_*]
user root
=head1 AUTHOR
=over 4
=item * PatrickDK (Original Author)
=item * Niall Donegan
=back
=head1 LICENSE
Unknown license
=head1 MAGIC MARKERS
=begin comment
These magic markers are used by munin-node-configure when installing
munin-node.
=end comment
#%# family=auto
#%# capabilities=autoconf suggest
=cut
EOF
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
if ! which lvs 2>&1 >/dev/null; then
echo "no (lvs not found)"
elif ! which vgs 2>&1 >/dev/null; then
echo "no (vgs not found)"
else
echo "yes"
fi
exit 0
fi
if [ "$1" = "suggest" ]; then
@ -43,9 +70,8 @@ clean_name() {
if [ "$1" = "config" ]; then
echo 'graph_title Logical Volume usage'
echo "graph_title Logical Volume Usage($vg)"
echo 'graph_args --base 1024 -l 0'
# echo 'graph_vlabel %'
echo 'graph_category disk'
echo 'graph_info This graph shows disk usage on the machine.'
echo "free.label free"