1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Using event manager - question

Discussion in 'Plesk for Linux - 8.x and Older' started by ElricM, Jul 27, 2005.

  1. ElricM

    ElricM Guest

    0
     
    I want to use the Event Manager to trap domains that exceed their monthly bandwidth limit. I've been playing with it and I notice that the execution of event manager scripts is very sensitive to the proper arguments being passed in. I can test it with events like client account updated, physical hosting updated, etc. However it's obviously pretty hard to test for my event of interest which is 'Traffic limit for domain reached'.

    The allowable parameters for this event are 'old_maximum_traffic', 'new_maximum_traffic' but how am I supposed to know which domain tripped the event???

    I am assuming that if I do something like:

    /mydirectory/myscript <new_maximum_traffic> <new_domain_name>

    that parameter "<new_domain_name>" will be null. In fact, if the parameter is out of context my experiments seem to show that the event might not fire at all.

    So again, how will I know which domain triggered the 'Traffic limit for domain reached' event?
     
  2. hardweb

    hardweb Guest

    0
     
    This aproach is not recommended. I advise you to query directly the psa database as it's faster and less intenssive.
     
  3. ElricM

    ElricM Guest

    0
     
    Well, turns out this won't work for me anyway since it appears that Plesk only writes the bandwidth to the database once every 24 hours. I have some domains that offer file downloads, and some of them can be quite large, like 400-500 MBs. The domain might exceed it's bandwidth allocation in a matter of hours, 24 hours is way too long to wait. I'm now customizing the download utility to keep track of bytes downloaded directly rather than relying on Plesk to take the domain offline. In the long run, this is a better solution anyway since the visitor can receive a "sorry, too bad" message rather than domain is offline contact the administrator.
     
  4. hardweb

    hardweb Guest

    0
     
    If you want you can modify the cron line for:

    /usr/local/psa/admin/sbin/statistics

    to execute every several hours, this is the script that writes statistics every 24 hours :)
     
Loading...