Skip to content

Instantly share code, notes, and snippets.

@jameskyle
Last active December 31, 2015 01:29
Show Gist options
  • Select an option

  • Save jameskyle/7914470 to your computer and use it in GitHub Desktop.

Select an option

Save jameskyle/7914470 to your computer and use it in GitHub Desktop.
#!/bin/bash
SESSION=openstack
function create_session() {
# Create a new session named 'openstack'
tmux -2 new-session -d -s $SESSION
}
function nova_logs() {
tmux new-window -t $SESSION:${1} -n "nova"
tmux send-keys "tail -f /var/log/nova/nova-api.log" C-m
tmux split-window -h "tail -f /var/log/nova/nova-cert.log"
tmux split-window -v "tail -f /var/log/nova/nova-conductor.log"
tmux select-pane -t 0
tmux split-window -v "tail -f /var/log/nova/nova-consoleauth.log"
tmux split-window -v "tail -f /var/log/nova/nova-manage.log"
tmux select-pane -t 3
tmux split-window -v "tail -f /var/log/nova/nova-objectstore.log"
tmux select-pane -t 5
tmux split-window -v "tail -f /var/log/nova/nova-scheduler.log"
}
function glance_logs() {
tmux new-window -t $SESSION:${1} -n "glance"
tmux send-keys "tail -f /var/log/glance/api.log" C-m
tmux split-window -v "tail -f /var/log/glance/registry.log"
}
function cinder_logs() {
tmux new-window -t $SESSION:${1} -n "cinder"
tmux send-keys "tail -f /var/log/cinder/cinder-api.log" C-m
tmux split-window -v "tail -f /var/log/cinder/cinder-scheduler.log"
}
function keystone_logs() {
tmux new-window -t $SESSION:${1} -n "keystone"
tmux send-keys "tail -f /var/log/keystone/keystone.log" C-m
}
function horizon_logs() {
tmux new-window -t $SESSION:${1} -n "horizon"
tmux send-keys "tail -f /var/log/apache2/access.log" C-m
tmux split-window -h "tail -f /var/log/apache2/error.log"
tmux split-window -v "tail -f /var/log/apache2/other_vhosts_access.log"
}
function neutron_logs() {
tmux new-window -t $SESSION:${1} -n "$2"
tmux send-keys "tail -f /var/log/${2}/dhcp-agent.log" C-m
tmux split-window -h "tail -f /var/log/${2}/l3-agent.log"
tmux split-window -v "tail -f /var/log/${2}/metadata-agent.log"
tmux select-pane -t 0
tmux split-window -v "tail -f /var/log/${2}/openvswitch-agent.log"
tmux split-window -v "tail -f /var/log/${2}/${2}-netns-cleanup.log"
tmux select-pane -t 3
tmux split-window -v "tail -f /var/log/${2}/${2}-ns-metadata-proxy*.log"
tmux select-pane -t 5
tmux split-window -v "tail -f /var/log/${2}/server.log"
}
function syslog() {
tmux new-window -t $SESSION:${i} -n "system"
tmux send-keys "tail -f /var/log/syslog" C-m
}
function attach() {
tmux -2 attach-session -t $SESSION
}
function main() {
create_session
nova_logs 1
# second argument specifies if the 'quantum' or 'neutron' pacakge is used
neutron 2 quantum
glance_logs 3
cinder_logs 4
keystone_logs 5
horizon_logs 6
syslog 7
attach
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment