mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
commit
aa2cb8468e
1 changed files with 53 additions and 27 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue