Last active
August 8, 2016 15:13
-
-
Save qgp9/5e55cf789ceecd133d0c1024fee5cd26 to your computer and use it in GitHub Desktop.
monitoring with tmux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
com=${1:-"htop"} | |
tname=mon | |
twin=mon | |
tnw=$tname:$twin | |
tmux has-session -t $tname | |
if [ $? != 0 ] | |
then | |
tmux new-session -s $tname -n $twin -d ssh -t a1 "$com" | |
tmux split-window -t $tnw.0 -h ssh -t v1 "$com" | |
tmux split-window -t $tnw.0 -v ssh -t v2 "$com" | |
tmux split-window -t $tnw.1 -v ssh -t vr "$com" | |
tmux select-pane -t $tnw.0 | |
fi | |
tmux attach -t $tname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment