Monitoring multiple log files (on top of ssh) on Windows at the same time?

I used poderosa (an application for .NET applications) to monitor logs on multiple linux / solaris servers. This application is not currently supported, and I had several problems with it.

I am wondering what other users are doing to simultaneously monitor multiple logs in real time (as in tail -f logfile). I would like to be able to insert / cascade multiple ssh tails.

Thank you

+4
source share
7 answers

You can use Putty Connection Manager to add tabs to putty. Then SSH into the machine twice and move back and forth.

Setup Tutorial

+1
source

You can just ssh to one server and use mutitail from there to delay the logs on all other servers.

+7
source

Ssh to one of the servers, run a screen on it. Then you can split the screen into several windows, and each of them performs

ssh serverX tail -f /path/to/log/file 

A side benefit of this method is that you do not have to reload the tails every time you connect. - instead, you can simply attach a working screen to the session

+1
source

From bash you can (save to ~/.bashrc or something else):

 function create-follower () { local _NAME=$1; local _USER=$2; local _HOST=$3; local _PATH=$4; if ! [ "${_NAME}" ]\ || ! [ "${_USER}" ]\ || ! [ "${_HOST}" ]\ || ! [ "${_PATH}" ] ; then { echo "Cannot create log follower." ; echo; echo "Usage: create-follower NAME USER HOST LOG-FILE"; } >&2; return 1 ; fi ; eval "function ${_NAME}(){ ssh ${_USER}@${_HOST} tail -f \"${_PATH}\" & }" } function activate-followers () { if (( $# < 1 )) ; then { echo "You must specify at least one follower to use" ; echo ; echo "Usage:" ; echo " activate-followers follower1 [follower2 ... followerN]"; } >&2; return 1 ; fi ; for FOLLOW in "${@}" ; do ${FOLLOW} ; done ; wait; } function stop-followers () { if [ "$(jobs)" ] ; then kill -9 $(jobs | perl -pe 's/\[([0-9]+)\].*/%$1/') ; fi ; } 

And then from your shell, determine the logs you want to use:

 [ dsm@localhost :~]$ create-follower test1 user1 localhost /tmp/log-1.txt [ dsm@localhost :~]$ create-follower test2 user2 otherhost /tmp/log-2.txt [ dsm@localhost :~]$ create-follower test2 user3 remotebox /tmp/log-3.txt 

Now activate the followers:

 [ dsm@localhost :~]$ activate-followers test1 test2 test3 

To exit a function, use CTRL+C , and to stop background processes use:

 [ dsm@localhost :~]$ stop-followers 

NOTE 1: This assumes that public key authentication has been set for your mailboxes.

NOTE 2. You will need to kill all tasks remaining after exiting the activation-repeater function. You might want to do this manually, as the provided function removes brute force in all background jobs

NOTE 3. This assumes a unix-like working environment that you can get by installing cygwin.

Who says you cannot do lisp in shellscript; -)

+1
source

You can check the login log.

Created Java tool capable of reading local and remote log files using SSH. It is quite easy to use.

A few more explanations: https://github.com/pschweitz/insidelog/wiki

Just download the version that matches your operating system, or the executable file of your own version of jar, executable in your Java Runtime (requires java 8_40 or higher):

https://github.com/pschweitz/insidelog/releases

You can find the full documentation (embedded with and on the Github page)

+1
source

Two options that appear in my head.

Select your favorite SSH application (putty, ssh in cygwin, etc.) and enter the machine.
1. SSH for each log (many windows open on your computer or tabs depending on your application)
2. SSH once and use screen .

0
source

If you really needed to see both logs at the same time, and there was no question on the tabs, you can install a perl script called LogResolveMerge.pl. It will merge the two logs together and upload the output to STDOUT. However, it will be resource intensive, and if your intention is to drop the logs, it probably won't be too efficient.

0
source

Source: https://habr.com/ru/post/1276966/


All Articles