views:

108

answers:

1

HI all,

I am working on SaaS Hosting Software. a large number of sites are hosted on the server. I am trying to calculate bandwidth consumption, (bytes transferred in and out) using C#, described Here using the MS Log Parser.

In the above case, if the log files are deleted by the user or any administrator even, the bandwidth calculation will not be possible.

Q1: *What is the standard way to measure the Bandwidth for various Hosting accounts (of websites) on a single server?*

Q2: *If Log parser mechanism (as described above) is used, then how to take care of the security issue? Is there some system directory or event viewer logs or something which cannot be deleted except by the System account and contains bandwidth data?*

Please point me in the right direction.

Thanks

+1  A: 

The logs your talking about can be deleted by an administrator but so can the entire site. You should probably talk to them about your need to access/use these files. You could also change IIS to log to a DB versus a file, so you can keep the data in your own repository. In addition to getting information directly from your logs, administrators may have other tools to use to monitor and report bandwidth (Firewalls, Routers, etc...). You should probably be working together with them to develop your solution.

Zachary