Skip to content

Instantly share code, notes, and snippets.

@alexw23
Forked from vjt/monitor.sh
Created November 4, 2013 04:43
Show Gist options
  • Save alexw23/7298179 to your computer and use it in GitHub Desktop.
Save alexw23/7298179 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Starts a multiplexed terminal session with tmux running monitoring software.
# Requires dstat, htop and grc. The apache configuration for grc can be found
# here: https://gist.github.com/1885569
#
# My .tmux.conf is here instead: https://gist.github.com/1886016#file_3_tmux.conf
#
# tmux 1.7 or later recommended.
#
name=monitor
if ! tmux has-session -t $name; then
tmux start \;\
new-session -d -s $name exit \;\
neww -n monitor 'grc tail -f /var/log/messages' \;\
splitw -v -p 80 'tail -f /var/log/nginx/*.app-access.log | grcat conf.apache' \;\
splitw -v -p 60 'dstat -cdgmnpy' \;\
splitw -h -p 45 'htop' \;
fi
tmux attach -t monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment