Skip to content

Instantly share code, notes, and snippets.

@nmichlo
Last active March 29, 2021 14:33
Show Gist options
  • Save nmichlo/ff767413195e7add29ac5587f2daf2a7 to your computer and use it in GitHub Desktop.
Save nmichlo/ff767413195e7add29ac5587f2daf2a7 to your computer and use it in GitHub Desktop.
Quick MS Cluster disk debug information.
#!/bin/bash
# TPS corresponds to IOPS:
# https://en.wikipedia.org/wiki/IOPS
function cluster-disk-info() {
folders="/tmp /home-mscluster/ /scratch"
# disk space
df -h -P $folders
disks=$(df -h -P $folders | perl -n -e '/.*.dev.(...).*/ && print "$1 "')
# disk usage -- record for 5 seconds
echo; echo "recording 5s of usage..."
iostat -y -c 5 1 --human -p $disks | sed '1d'
}
# one line version:
# folders="/tmp /home-mscluster/ /scratch" ; df -h -P $folders ; disks=$(df -h -P $folders | perl -n -e '/.*.dev.(...).*/ && print "$1 "') ; echo; echo "recording 5s of usage..." ; iostat -y -c 5 1 --human -p $disks | sed '1d'
function install-network-monitors() {
# make dirs
mkdir -p net_utils/.local ;
mkdir -p net_utils/.pkgs ;
cd net_utils ;
# downlaod files
# https://www.binarytides.com/linux-commands-monitor-network/
cd _pkgs ;
apt-get download bmon bwm-ng cbm collectl dstat ifstat ;
cd .. ;
# unzip files
for pkg in .pkgs/*.deb ; do
dpkg -x "$pkg" .local ;
done ;
# link binaries
echo 'Installed:' ;
for pkg in .local/usr/bin/* ; do
ln -sf "$(realpath "$pkg")" "$(basename "$pkg")"
echo "- $(basename "$pkg")"
done ;
# move back to pwd
cd .. ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment