0

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 ?

ritwik
  • 1
  • 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

1 Answers1

0

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?

mfinni
  • 35,711
  • 3
  • 50
  • 86
  • 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