Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an application which is a windows service. It accesses a number of other services using TCP/IP. E.g. sql server databases, informix databases, mail servers, etc.

For instance it will also access multiple SQL server instances on different servers.

In the course of a day if I want to log all of the different services it has connected to how would I do that?

If I use TCPView I can see all the information I want, e.g. remote address, port, but it is a real time view, so the data is not saved.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Process Monitor will do exactly what you are looking for

enter image description here

Once you have your filters set up be sure you to go to File->Backing Files... and choose a file to save the logs to, otherwise it will start deleting old logs once it runs out of virtual memory or close the program.

Be sure to restart the program once you set a new backing source, the change does not take affect till you close and reopen the program!

share|improve this answer
    
I've been using process monitor, but had no idea it could do network stuff too. Exactly what I was after. –  peter Jul 22 '13 at 1:31

I think Wireshark would do exactly what you want.

You can use its powerful filters to choose only tcp traffic from certain ports or ip. In short you can let it run and collect only the data that is important to you. You can see packet-level communication for everything that goes through your network adapter.

share|improve this answer
    
Thanks for cleaning up my answer @Raystafarian! –  anglinb Jul 22 '13 at 3:43

If you are running Windows, you can setup scheduled job which runs script:

netstat -t > C:\your_output_path

your_output_path file can contain variable %time% and %date% so that every time script runs it outputs data to a file with time and date in its name.

If you install tool like UnixUtils you will be able to use grep and gawk command to filter out records which you do not need and leave only desirable once. For example, to get PostgreSQL connection you would do

netstat -t | grep 5432

Run this script as frequent as you want and you will have bunch of files with running record of your connection during the time.

share|improve this answer

Your Answer

 
discard

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.