Skip to content

Instantly share code, notes, and snippets.

@vampjaz
Created May 30, 2015 18:04
Show Gist options
  • Save vampjaz/4a33b04692501d334f98 to your computer and use it in GitHub Desktop.
Save vampjaz/4a33b04692501d334f98 to your computer and use it in GitHub Desktop.
Tmux Server monitoring script
#!/bin/bash
SESSION=$USER
# requires tmux, speedometer, htop
# speedometer = network graphs
# htop = better cpu usage
# btcwatch.sh and dogewatch.sh simply call ./<coin>-cli getinfo every 30 seconds
# leaves a pane open to shell
# borrowed some code from http://blog.htbaa.com/news/tmux-scripting
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'Management'
tmux split-window -h
tmux select-pane -t 0
tmux split-window -v
tmux select-pane -t 0
tmux send-keys "speedometer -r eth0 -t eth0" C-m
tmux select-pane -t 1
tmux send-keys "htop" C-m
tmux select-pane -t 2
tmux split-window -v
tmux select-pane -t 2
tmux split-window -h
tmux select-pane -t 2
tmux send-keys "sh ./btcwatch.sh" C-m
tmux select-pane -t 3
tmux send-keys "sh ./dogewatch.sh" C-m
tmux select-pane -t 4
tmux select-window -t $SESSION:1
tmux -2 attach-session -t $SESSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment