Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHANGE disk_gmetric.sh (RHEL Command Support) #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions disk/disk_gmetric.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ then
mkdir -p `dirname $STATEFILE`
fi
echo "$date" > $STATEFILE
$iostat -d | tail +4 >> $STATEFILE
$iostat -d | tail -n +4 >> $STATEFILE
if [ ! -e $STATEFILE ]
then
# if it didn't exist and we couldn't create
Expand All @@ -124,7 +124,7 @@ exec 3>&-

# this script uses iostat (part of the sysstat packag)
# to retrieve disk metrics
stats=(`$iostat -d | tail +4`)
stats=(`$iostat -d | tail -n +4`)
old_stats=(`cat $STATEFILE`)
old_date=${old_stats[0]}

Expand Down Expand Up @@ -212,7 +212,7 @@ do
then
#just write out the new stats and exit; there's nothing we can do
echo "$date" > $STATEFILE
$iostat -d | tail +4 >> $STATEFILE
$iostat -d | tail -n +4 >> $STATEFILE
exit 1
fi
# if the system gets backed up and multiple invocations are launched
Expand Down Expand Up @@ -249,7 +249,7 @@ $GMETRIC $GMETRIC_ARGS --name="disk_reads" --value="$read_sum" --type="float" --
$GMETRIC $GMETRIC_ARGS --name="disk_writes" --value="$write_sum" --type="float" --units="blocks/sec"

echo "$date" > $STATEFILE
$iostat -d | tail +4 >> $STATEFILE
$iostat -d | tail -n +4 >> $STATEFILE

rm -f $ERROR_CREATE $ERROR_IOSTAT $ERROR_DEVNAME2 $ERROR_DEVNAME $ERROR_GMETRIC $ERROR_TIMEDIFF $ERROR_NOTROOT