1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-19 00:53:19 +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 #!/bin/sh
# # -*- sh -*-
# Script to monitor disk usage.
# : << EOF
# By PatrickDK =head1 NAME
#
# Parameters understood: lvm_ - Wildcard plugin for monitoring disk usage on LVM. Each Volume Group is graphed separately.
#
# config (required) =head1 CONFIGURATION
# autoconf (optional - used by munin-config)
# suggest This plugin needs to run as the root user in order to have permission to run lvs and vgs
#
# Needs to be run as root, so the following needs to be added to the config: [lvm_*]
# user root
# [lvm_]
# user root =head1 AUTHOR
#
# $Log$ =over 4
#
# Magic markers (optional - used by munin-config and installation =item * PatrickDK (Original Author)
# scripts):
# =item * Niall Donegan
#%# family=auto
#%# capabilities=autoconf suggest =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 if [ "$1" = "autoconf" ]; then
echo yes if ! which lvs 2>&1 >/dev/null; then
exit 0 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 fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then
@ -43,9 +70,8 @@ clean_name() {
if [ "$1" = "config" ]; then 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_args --base 1024 -l 0'
# echo 'graph_vlabel %'
echo 'graph_category disk' echo 'graph_category disk'
echo 'graph_info This graph shows disk usage on the machine.' echo 'graph_info This graph shows disk usage on the machine.'
echo "free.label free" echo "free.label free"