Skip to content

Instantly share code, notes, and snippets.

@hsergei
Created March 15, 2018 21:21
Show Gist options
  • Save hsergei/51bb6c5a5f0612a6c26a758499054245 to your computer and use it in GitHub Desktop.
Save hsergei/51bb6c5a5f0612a6c26a758499054245 to your computer and use it in GitHub Desktop.
#!/bin/bash
URL='http://localhost:8081/nexus/content/repositories/yum/repodata/repomd.xml'
while true; do
TS=`/bin/date "+%Y%m%d-%H%M%S"`
DISKUTIL0=`iostat -yxd 2 1 xvdf|egrep ^xvdf|awk '{print $14}'`
CRRUNNING='createrepo off'
if pgrep createrepo >/dev/null; then
CRRUNNING='createrepo ON '
fi
CURLTIME=`curl -s -o /dev/null -w "%{time_total}" ${URL}`
DISKUTIL1=`iostat -yxd 2 1 xvdf|egrep ^xvdf|awk '{print $14}'`
echo "${TS} ${CRRUNNING}, disk util ${DISKUTIL0} ${DISKUTIL1} %, latency ${CURLTIME}"
done 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment