Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > I need your brain to use Console utility to view log files on a remote server.

I need your brain to use Console utility to view log files on a remote server.
Thread Tools
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Mar 10, 2005, 12:54 AM
 
Hi,

I need some hard-core unix magic.

I'm debugging a mail server on a linux box and it's log file city.

I like the OS X Console utility. It beats using tail, cat and grep in the terminal to go over the various log files.

How can I use it to view log files on a remote server?


I guessing I could mount the remote machine's /var/log partition with NFS. Would that be:

1. Smart
2. Secure
3. Fast

Is there some tricky ssh thing I can do?

Thanks
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Mar 10, 2005, 09:47 PM
 
Do you want to look at them in real time?

If not, just transfer them over however you feel comfortable.

If you do want to look at them in real time, it may be easier/better to configure an AFP or SMB server on the Linux box to share the relevant folder.

Or, you could do some SSH magic... but this would involve:

set up SSH logins to not need passwords
run an SSH session for each file
execute tail -f remotely
redirect the output into a local log file
view the local copy

This would probably look something like:

ssh user@host tail -f /var/log/logfile.log > localfile.log

Note that I have not attempted this, and haven't even reality-checked it for where the > will be sent.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Gavin  (op)
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Mar 11, 2005, 04:32 AM
 
Originally posted by Detrius:
Do you want to look at them in real time?
generally, yeah.

not necessarily realtime with -f, but when I'm actually working on it I check them often enough that downloading each time would be annoying.


set up SSH logins to not need passwords
Already set up that way.

That might do the trick, and it's light weight enough that it's not going to slow things down.

Thanks
     
Gavin  (op)
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Mar 11, 2005, 04:59 AM
 
Works perfectly, thanks!

I can filter and search and everything in real time. The server's CPU isn't breaking a sweat and there's hardly any bandwidth used.

I just added & to the end so it will just go and I don't have a bunch of terminals floating around.
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Mar 11, 2005, 10:50 PM
 
Spiffy! Excellent to hear!

The big question is this: do you understand what it did and why it worked?

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Gavin  (op)
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Mar 13, 2005, 04:16 AM
 
Ha!

Teach a man to fish...


Actually yes.

I used to do something like this with an older version of rsync but I had forgotten that ssh could run a command like this.

I probably never would have put them together though. My skill is to know that -something- is possible, then find someone to fill in the details. ;-)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:49 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2