Skip to content

Commit

Permalink
Add full path to xfs_db
Browse files Browse the repository at this point in the history
  • Loading branch information
hectoras committed May 23, 2014
1 parent 5975c86 commit 8398ec5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gmetric_xfs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

GMETRIC=/usr/bin/gmetric

XFSDB_BIN=/usr/sbin/xfs_db

for dev in `awk '$3=="xfs" { print $1 }' /proc/mounts`
do
FRAG=$(xfs_db -r -c frag $dev | awk '{print $8}' | cut -f1 -d"." | sed 's/,/\./' | sed 's/%//' )
FRAG=$(${XFSDB_BIN} -r -c frag $dev | awk '{print $8}' | cut -f1 -d"." | sed 's/,/\./' | sed 's/%//' )
dev=`basename $dev`
# echo "${dev}_frag: $FRAG"
$GMETRIC --type=float --name="${dev}_frag" --units="%" --value="${FRAG}" --group="fragmentation"
Expand Down

0 comments on commit 8398ec5

Please sign in to comment.