Adding iozone-nfs.sh script.
authorPhilipp Plüss <philipp.pluess@bfh.ch>
Thu, 25 Jun 2015 11:19:06 +0000 (13:19 +0200)
committerPhilipp Plüss <philipp.pluess@bfh.ch>
Thu, 25 Jun 2015 11:19:06 +0000 (13:19 +0200)
iozone-nfs.sh [new file with mode: 0644]

diff --git a/iozone-nfs.sh b/iozone-nfs.sh
new file mode 100644 (file)
index 0000000..c97aedf
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+# this script is a wrapper around the iozone filesystem benchmark tool,
+# which can be installed from most linux distro repositories.
+# for further information and documentation visit http://www.iozone.org
+
+set -e
+
+_LOCKFILE="/root/disable_script.txt"
+_LOCKDIR="/var/lock/iozone-nfs"
+_IOZONE="iozone"
+_TESTDIR="/srv/perf-tests/iozone-$(date +"%Y%m%d_%H%M")"
+_XLSOUTPUT="$_TESTDIR/results_$(date +"%Y%m%d_%H%M").wks"
+_NFSMOUNT="/mnt/nfs_spdy"
+
+# should script run
+
+if [ ! -f $_LOCKFILE ]; then
+       echo "no lockfile found"
+else
+       echo "lockfile found, exiting script"
+       exit 1
+fi
+
+# does script already run
+
+if mkdir $_LOCKDIR > /dev/null 2>&1; then
+       echo "lock successfully created"
+else
+       echo "lock failed - exiting script"
+       exit 1
+fi
+
+# is iozone installed
+
+if ! type "$_IOZONE" > /dev/null 2>&1; then
+       echo "$_IOZONE not installed, please install."
+fi
+
+# create result folders for actual performance test
+
+mkdir -p ${_TESTDIR}
+
+# start test
+
+iozone -Rac -i 0 -i 1 -i 2 -b "$_XLSOUTPUT" -g 128m -U "$_NFSMOUNT" -f "$_NFSMOUNT/iozone.tmp"
+
+# script finished
+
+rmdir $_LOCKDIR
+
+exit 0