当子域达到一定带宽时如何触发脚本?
我运行托管服务,并且需要能够监控每个客户(使用通过 cPanel 创建的单个子域)消耗的带宽量。
当子域达到一定的带宽时,是否有某种方法可以触发 PHP 脚本运行?如果这不是一个现有的解决方案(我猜想可能是像 Webalizer 这样已经存在的统计模块之一的一部分),那么我可以对它应该写成什么有一些建议吗?
I run a hosted service and I need to be able to monitor how much bandwidth every customer (Who uses an individual subdomain, created through cPanel) consumes.
Is there some way to trigger a PHP script to run when a subdomain reaches a certain amount of bandwidth? If this isn't an existing solution (I would guess as perhaps part of one of the statistic modules that already exist like Webalizer) then can I have some suggestions on what it should be written in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想提前道歉,因为我现在不在编程机上,所以没有在这里提供确切的代码。但是我发现了两个您可能可以使用的链接:
这包含有关获取带宽信息的信息:
< a href="http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api1/ApiBandwidth" rel="nofollow">http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api1/ApiBandwidth
如何调用 API1 函数:
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/CallingApiOne
再次,我很抱歉没有提供任何真实的代码,但你至少可以给这些读。我也没有任何 cPanel 可以使用,但我会看看稍后是否可以获取一些东西。
I'd like to apologize in advance for not providing exact code here, since I'm not on a programming machine right now.. But I found two links that you might be able to use:
This contains info on getting bandwidth information:
http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api1/ApiBandwidth
How to call the API1 functions:
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/CallingApiOne
Again, I'm sorry for not providing any real code, but you can at least give these a read. I haven't got any cPanels to play around with either, but I'll see if I can grab something later.