Ssh – Use local tools to monitor remote logs

log-filesremote-accesssshtail

I don't have root access on my hosted web server, but I would like to use tools like MultiTail to monitor log files that are generated on my web host.

Is there a way I can pipe the log output on my remote host ( I have ssh access ), to my locally running MultiTail?

The local machine is running Ubuntu 9.04. The remote machine is running FreeBSD 6.

==

The answer in a nut-shell:

1) Set up key-based login for ssh.

2) Execute the following command:

multitail -l "ssh -l USER HOST tail -f ./www_logs/access_log" -l "ssh -l USER2 HOST2 tail -f ./www_logs/access_log"

Best Answer

You could try something like this:

multitail -l "ssh remotehost tail -f /var/log/messages" \
          -l "ssh remotehost tail -f /var/log/mail.log"

I'm sure there are lots of nice multitail options I'm missing, but that should at least get the basics working.