| Last change
                  on this file since 980 was
                  736,
                  checked in by quentin, 18 years ago | 
        
          | Initial import of munin AFS monitoring plugin | 
        
          | 
              
                  Property svn:executable set to
                  * | 
        | File size:
            1.1 KB | 
      
      
        
  | Rev | Line |  | 
|---|
| [736] | 1 | #!/bin/sh | 
|---|
|  | 2 | # | 
|---|
|  | 3 | # Script to monitor disk usage. | 
|---|
|  | 4 | # | 
|---|
|  | 5 | # Parameters understood: | 
|---|
|  | 6 | # | 
|---|
|  | 7 | #       config   (required) | 
|---|
|  | 8 | #       autoconf (optional - used by munin-config) | 
|---|
|  | 9 | # | 
|---|
|  | 10 | # | 
|---|
|  | 11 | # | 
|---|
|  | 12 | # Magic markers (optional - used by munin-config and installation | 
|---|
|  | 13 | # scripts): | 
|---|
|  | 14 | # | 
|---|
|  | 15 | #%# family=auto | 
|---|
|  | 16 | #%# capabilities=autoconf | 
|---|
|  | 17 |  | 
|---|
|  | 18 | MAXLABEL=20 | 
|---|
|  | 19 |  | 
|---|
|  | 20 | CELL=`basename $0 | sed 's/^afs_df_//g'` | 
|---|
|  | 21 |  | 
|---|
|  | 22 | if [ "$1" = "autoconf" ]; then | 
|---|
|  | 23 | echo yes | 
|---|
|  | 24 | exit 0 | 
|---|
|  | 25 | fi | 
|---|
|  | 26 |  | 
|---|
|  | 27 | clean_name() { | 
|---|
|  | 28 | echo $1 | sed 's/[\/.-]/_/g' | 
|---|
|  | 29 | } | 
|---|
|  | 30 |  | 
|---|
|  | 31 |  | 
|---|
|  | 32 | if [ "$1" = "config" ]; then | 
|---|
|  | 33 |  | 
|---|
|  | 34 | echo 'graph_title '"$CELL"' partition usage (in %)' | 
|---|
|  | 35 | echo 'graph_args --upper-limit 100 -l 0' | 
|---|
|  | 36 | echo 'graph_vlabel %' | 
|---|
|  | 37 | echo 'graph_category AFS' | 
|---|
|  | 38 | echo 'graph_info This graph shows disk usage on the '"$CELL"' cell.' | 
|---|
|  | 39 | fs df /afs/"$CELL"/service/partitions/* | grep '^disk.' | while read i; do | 
|---|
|  | 40 | name=`clean_name $i` | 
|---|
|  | 41 | echo -n "$name.label " | 
|---|
|  | 42 | echo $i | awk "{ print \$1; }" | 
|---|
|  | 43 | echo "$name.warning 90" | 
|---|
|  | 44 | echo "$name.critical 98" | 
|---|
|  | 45 | done | 
|---|
|  | 46 | exit 0 | 
|---|
|  | 47 | fi | 
|---|
|  | 48 |  | 
|---|
|  | 49 | fs df /afs/"$CELL"/service/partitions/* | grep '^disk.' | while read i; do | 
|---|
|  | 50 | name=`clean_name $i` | 
|---|
|  | 51 | echo -n "$name.value " | 
|---|
|  | 52 | echo $i | awk '{ print $3/$2*100 }' | 
|---|
|  | 53 | done | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.