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 write a program to find out what resources an IIS server has and how many hits are there on each resource. The resource can be anything from a html page to files like sound clips, pictures , etc. I want to find out a list of all these resources and then i got to calculate the traffic as well. So can this be done without using any existing tool. I am not allowing myself to use any tools. I looked into WMI classes, but they do not give very detailed data like i want. I also thought about using ISAPI Filters to log each request. But i am finding it very difficult to learn. So is that a good way to go ? or shall i look at some thing else ?

share|improve this question
I'm voting to move to SO. You want to write a program, not use any existing tools, so this is a programming question. – mfinni Aug 10 '11 at 12:31
@mfinni but wouldnt i get more guidance here given the fact that i am writing the code for a SERVER ?? just asking ... – ritwik Aug 10 '11 at 12:43
No, not at all. Server admins don't generally write their own tools; we usually string together existing tools with a "glue" or scripting language. Much more effective use of our time. – mfinni Aug 10 '11 at 13:16

f you were to use existing tools, you would need to find all DocRoot and Virtual Directories and then enumerate them (to list all the resources), and then use LogParser (or something like it) to count the hits. Using an ISAPI filter to log hits would be silly, since IIS already does that part for you

If you're going to write this all yourself, then you would do the same thing but without using LogParser. Will you allow yourself to use 3rd-party libraries? What is the purpose of doing this yourself? Is it just for a learning exercise?

share|improve this answer
no this aint a learning exercise. ia m working for a company making 'monitoring' tools for server farms. Hence i cant use third party tools. my code has to be self sufficient. Would you please elaborate why using ISAPI Filter would be silly ? i mean when and where does IIS do that for me ? i dont know. please tell me. – ritwik Aug 10 '11 at 12:38
i cant use the logParser tool but surely i can use the logs. I can write a logreader myself – ritwik Aug 10 '11 at 12:39
I do not understand at all why you can't use existing tools. – mfinni Aug 10 '11 at 13:17
It would be silly to write an additional logging program in a filter, when the information you need IS ALREADY being logged by IIS. – mfinni Aug 10 '11 at 13: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.