Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
monitor:multipane [2021/01/06 06:13] – [Unix - Actively Monitor Multiple Logs] mortifis | monitor:multipane [2021/02/24 12:49] (current) – [Advanced tmux example] more relevant image mortifis | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Unix - Actively Monitor Multiple Logs ====== | ====== Unix - Actively Monitor Multiple Logs ====== | ||
- | On Unix like systems, a handy method to monitor multiple logs simultaneously is combining tmux and lnav (consult your OS for installing these utilities) | + | On Unix like systems, a handy method to monitor multiple logs simultaneously is combining |
This example will actively monitor ''/ | This example will actively monitor ''/ | ||
- | First, setup tmux to have 3 panes start with a bash script similar to: | + | === setup tmux === |
+ | |||
+ | First, setup [[https:// | ||
#!/bin/sh | #!/bin/sh | ||
Line 12: | Line 14: | ||
tmux -2 attach-session -d | tmux -2 attach-session -d | ||
- | Once tmux has started you'll see three panes each with a command prompt. | + | Once [[https:// |
(this example uses the default bindings CTRL+B+< | (this example uses the default bindings CTRL+B+< | ||
+ | |||
+ | == lnav/tmux panes === | ||
This example uses the top full width pane to monitor ''/ | This example uses the top full width pane to monitor ''/ | ||
Line 29: | Line 33: | ||
You should now have 3 panes, each monitoring one aspect of you Synchronet BBS activity. | You should now have 3 panes, each monitoring one aspect of you Synchronet BBS activity. | ||
- | {{:monitor:tmux1.jpg?400|}} | + | == example image === |
+ | |||
+ | {{:monitor:basic-tmux.png? | ||
+ | |||
+ | ===== Advanced tmux example ===== | ||
+ | |||
+ | In this example, we create a bash script that sets tmux up for us and automatically launches a few goodies: | ||
+ | me@localhost: | ||
+ | |||
+ | # | ||
+ | # sbbsMux - SBBS Monitoring script | ||
+ | tmux new-session -d -s sess >/ | ||
+ | tmux rename-window -t sess:0 ' | ||
+ | tmux splitw -v -p 20 -t sess:0.0 | ||
+ | tmux splitw -h -p 80 -t sess:0.1 | ||
+ | #required; otherwise pane numbering is bs | ||
+ | tmux select-pane -t sess:0.0 | ||
+ | tmux splitw -h -p 5 -t sess:0.0 | ||
+ | tmux send-keys -t sess:0.0 ' | ||
+ | tmux send-keys -t sess: | ||
+ | tmux send-keys -t sess:0.1 '/ | ||
+ | tmux select-pane -t sess:0.0 | ||
+ | tmux new-window -t sess | ||
+ | tmux rename-window -t sess:1 ' | ||
+ | tmux splitw -v -p 10 -t sess:1.0 | ||
+ | tmux splitw -h -p 80 -t sess:1.1 | ||
+ | tmux select-pane -t sess:1.0 | ||
+ | tmux splitw -h -p 10 -t sess:1.0 | ||
+ | tmux clock -t sess:1.1 | ||
+ | tmux new-window -t sess | ||
+ | tmux rename-window -t sess:2 ' | ||
+ | tmux splitw -v -p 10 -t sess:2.0 | ||
+ | tmux send-key -t sess:2.0 'lnav / | ||
+ | tmux select-pane -t sess:2.0 | ||
+ | tmux splitw -h -p 5 -t sess:2.0 | ||
+ | tmux clock -t sess:2.1 | ||
+ | tmux select-window -t sess:0.0 | ||
+ | tmux a -t sess | ||
+ | |||
+ | ** note Edit 'tmux rename-window -t sess:x ' | ||
+ | |||
+ | Save this as sbbsmux (or whatever) and chmod +x and launch it | ||
+ | |||
+ | someone@somewhere: | ||
+ | |||
+ | The output should look similar to: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Navigate to the pane with the prompt, this was left available to preforming tasks. | ||
+ | |||
+ | me@mynixbox: | ||
+ | |||
+ | Now we should see something similar to: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== See Also ===== | ===== See Also ===== |