如何在 ASP.Net 应用程序中使用 C# 计算托管帐户的带宽消耗?
大家好,
我正在开发 SaaS 托管软件。服务器上托管了大量站点。我正在尝试使用 C# 计算带宽消耗(传入和传出的字节数),此处描述使用 MS Log Parser。
在上述情况下,如果日志文件被用户甚至任何管理员删除,则带宽计算将无法进行。
Q1: 测量单个服务器上各种(网站)托管帐户带宽的标准方法是什么?
Q2: 如果使用日志解析器机制(如上所述),那么如何处理安全问题?是否有某些系统目录或事件查看器日志或除系统帐户之外无法删除且包含带宽数据的内容?
请为我指出正确的方向。
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所谈论的日志可以被管理员删除,但整个站点也可以删除。您可能应该与他们讨论您访问/使用这些文件的需要。您还可以将 IIS 更改为记录到数据库而不是文件,这样您就可以将数据保存在您自己的存储库中。除了直接从日志中获取信息之外,管理员还可以使用其他工具来监视和报告带宽(防火墙、路由器等)。您可能应该与他们一起开发您的解决方案。
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.