Projet

Général

Profil

Révision 51c53c63

ID51c53c6390a379b087b0f05cd30f1857d5fa7abb
Parent 3d49277a
Enfant 5332dc60

Ajouté par pmoranga il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/lvm_snap_used
1
#!/bin/bash
2
#
3
# Plugin to monitor the % of allocated area of a LVM snapshot
4
#
5
# Parameters:
6
# 	
7
# 	config
8
# 	autoconf
9
#
10
# Configuration variables
11
#    no config variables
12
#
13
#%# family=auto
14
#%# capabilities=autoconf
15
# 
16
# 2011/05/20 - pmoranga - initial version
17

  
18
if [ "$1" = "autoconf" ]; then
19
        /usr/sbin/lvdisplay 2>/dev/null >/dev/null
20
        if [ $? -eq 0 ]
21
        then
22
          echo yes
23
          exit 0
24
        else
25
                echo "no lvdisplay found"
26
        fi
27
        exit 1
28
fi
29

  
30

  
31

  
32
if [ "$1" = "config" ]; then
33
	echo 'graph_title Allocated space for snapshot' 
34
	echo 'graph_vlabel %'
35
	echo 'graph_category disk'
36
	echo 'graph_args --base 100'
37
        /usr/sbin/lvdisplay -C | awk '$3 ~ /^s/{print $1".label "$1" snapshot of "$5} '
38
	exit 0
39
fi
40

  
41

  
42
/usr/sbin/lvdisplay -C | awk '$3 ~ /^s/{print $1".value",int($6)} '

Formats disponibles : Unified diff