Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm running Windows 7 Pro and have a few servers running. One of the servers is a SSH / file server that was made via Cygwin. I already have logging setup internally using syslog-d; however, it does not provide adequate logging. When a user is connected to the server I can see him/her in the Windows 7 Resource Monitor and it shows his/her IP address as well as how much data is being sent/received. When a user is downloading a file from the file server I can also see in the resource monitor what file he/she is downloading by looking at the disk usage.

Herein lies the first question: How can I log users' IP address, the time they connect & disconnect, what files they download, and what their download speed was, to a database in MySQL?

In addition to the aforementioned server, I also use IIS to host a website, and would like to have some sort of networking logging.

If I could find a tool that would work for both of these servers that would be the best solution.

I did some searching and found a program called Snort that looks like it would work for the network side of things, but not for the disk usage. I'm not familiar with this program at all, but at first glance maybe it could accomplish part of what I want to do? Maybe there is an easier/better way?

I'm pretty new to MySQL and know very little about network and disk logging so any and all help and guidance would be much appreciated. Thanks!

share|improve this question

1 Answer

up vote 0 down vote accepted

Advanced Web Statistics does a pretty good job of making sense of the IIS log files, and though it will give you more information than you need, it will certainly give you the information you want. It is open source, and my hosting provider uses it for the ASP.NET sites I have developed.

As far as logging the information to MySQL:

I am assuming that you already have, or know how to get the information and you simply want to log it to a MySQL DB.

1st, you will need to create the database.

2nd, you need the MySQL connector for your programming language of choice. The MySQL ADO.NET connector is excellent and easy to use. I am also assuming you know at least one programming language and how to connect it to a database. If not, I recommend C# with ADO.NET-- it is super easy and there are plenty of tutorials online.

3rd, write a program to send your information to the database, when you receive it.

share|improve this answer
I'll look into Advanced Web Statistics. Thanks for the recommendation. Actually, getting the information is probably the bigger problem. I know a handful of languages and will look into the MySQL ADO.NET connector. Thanks again. – Slayer537 Jan 3 '12 at 5:34
Just looked into AWStats. It looks like it can handle the IIS logs as well as the logs from syslog. Now I just need to figure out how to log the files being accessed. I also like how the program is done in Perl, as I've already written Perl scripts to run queries on a database, so putting the data into the database shouldn't be too difficult. I'd prefer a direct-link between the servers and the database without using a log file, but that would most likely require much more work and coding on my end. Thanks for your help, you helped me solve the majority of my problems :) – Slayer537 Jan 3 '12 at 6:01

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.