Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to log all network traffic on a Mac OS X server (like tcpdump does), but including the ID of the process that is responsible. Using lsof only gives me the current connections, not the past ones.

Is there a way to do this?

Regards, Jochen

share|improve this question
up vote 0 down vote accepted

Sadly, the best way to do this (tcpsnoop, which uses DTrace to do exactly what you describe) does not work on the Mac OS X implementation of dtrace. You'd need some kind of application firewall (Little Snitch for example) but that's more of a desktop / single user thing than something you want running on your server.

This seems like an odd requirement actually, are you trying to make an intrusion detection system, or just figure out what is causing network access?

share|improve this answer
Just trying to see what's causing weird network traffic on my box. Regards, Jochen – Jochen Feb 22 '11 at 18:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.