Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
monitor:multipane [2021/01/06 06:13] – [Unix - Actively Monitor Multiple Logs] mortifismonitor: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 [[https://linuxize.com/post/getting-started-with-tmux/|tmux]] and [[https://www.2daygeek.com/install-and-use-advanced-log-file-viewer-navigator-lnav-in-linux/|lnav]] (consult your OS for installing these utilities)
  
 This example will actively monitor ''/var/log/syslog''; ''/sbbs/data/sbbsecho.log''; ''/sbbs/exec/umonitor'' This example will actively monitor ''/var/log/syslog''; ''/sbbs/data/sbbsecho.log''; ''/sbbs/exec/umonitor''
  
-First, setup tmux to have 3 panes start with a bash script similar to:+=== setup tmux === 
 + 
 +First, setup [[https://linuxize.com/post/getting-started-with-tmux/|tmux]] to have 3 panes start with a bash script similar to:
  
   #!/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.  Depending on how your tmux key bindings are setup,+Once [[https://linuxize.com/post/getting-started-with-tmux/|tmux]] has started you'll see three panes each with a command prompt.  Depending on how your [[https://linuxize.com/post/getting-started-with-tmux/|tmux]] key bindings are setup,
 (this example uses the default bindings CTRL+B+<arrow_key>) navigate to each pane and launch your desired app.  (this example uses the default bindings CTRL+B+<arrow_key>) navigate to each pane and launch your desired app. 
 +
 +== lnav/tmux panes ===
  
 This example uses the top full width pane to monitor ''/var/log/syslog'' as it is the most verbose of our active monitoring: This example uses the top full width pane to monitor ''/var/log/syslog'' as it is the most verbose of our active monitoring:
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?400|}}  
 + 
 +===== 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: $ nano sbbsmux 
 + 
 +  #!/bin/bash 
 +  # sbbsMux - SBBS Monitoring script 
 +  tmux new-session -d -s sess >/dev/null 
 +  tmux rename-window -t sess:0 'AlleyCat' 
 +  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 'lnav' Enter 
 +  tmux send-keys -t sess:0.2  'sudo htop -u pi' Enter 
 +  tmux send-keys -t sess:0.1 '/sbbs/exec/umonitor' Enter 
 +  tmux select-pane -t sess:0.0 
 +  tmux new-window -t sess 
 +  tmux rename-window -t sess:1 'BBS' 
 +  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 'Monitor' 
 +  tmux splitw -v -p 10 -t sess:2.0 
 +  tmux send-key -t sess:2.0 'lnav /sbbs/data/sbbsecho.log' Enter 
 +  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 'Accordingly' ** 
 + 
 +Save this as sbbsmux (or whatever) and chmod +x and launch it 
 + 
 +  someone@somewhere: $ ./sbbsmux 
 + 
 +The output should look similar to: 
 + 
 +{{:monitor:sbbs-tmux-sbbsecho1.png?400|}} 
 + 
 +Navigate to the pane with the prompt, this was left available to preforming tasks.  Here we will launch another monitoring tool: 
 + 
 +  me@mynixbox: $ lnav /sbbs/data/sbbsecho.log 
 +   
 +Now we should see something similar to: 
 + 
 +{{:monitor:sbbs-tmux-sbbsecho.png?400|}} 
 + 
 + 
 + 
 + 
  
 ===== See Also ===== ===== See Also =====