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

Events not working?

Discussion in 'Plesk for Linux - 8.x and Older' started by PedstersPlanet, Jan 11, 2006.

  1. PedstersPlanet

    PedstersPlanet Guest

    0
     
    Ok, I have a Event in Event manager that disables a domain if the traffic limit is reached.. however, it didnt execute?

    Am I right in thinking that you have to run it as the user of the domain and not root?

    ----------
    Event: Traffic limit reached for domain
    Priority: 50
    User: <client user>
    /usr/local/psa/admin/sbin/domainmng --turn-off --domain-name=<full domain name here>
    -----------

    Is this right? I can not see why it wouldnt work, unless its a permission error on the domainmng - if so, how do you tell which domain exceeds limit if its executed under root?

    Or am I missing something here?
     
  2. PedstersPlanet

    PedstersPlanet Guest

    0
     
  3. PedstersPlanet

    PedstersPlanet Guest

    0
     
    I found the problem:
    So how can I turn the domain off under the user the domain belongs to?
    There must be a way?
     
  4. dhthwy

    dhthwy Guest

    0
     
    /usr/local/psa/admin/sbin/domainmng

    -r-xr-x--- 1 root psaadm 2893044 Aug 24 08:28 domainmng

    it can only be run by users root or psaadm

    just run it as one of those users.
     
  5. PedstersPlanet

    PedstersPlanet Guest

    0
     
    Ok, if I run it as root, then how will I know which domain has maxed its limits, using the 'Traffic limit for domain reached' event?
    Or is there a way to check for all domains by default?
     
  6. dhthwy

    dhthwy Guest

    0
     
    btw domains are unique and can't be shared by other clients so you won't have to worry about what domain belongs to what user.
     
  7. dhthwy

    dhthwy Guest

    0
     
    when any domain has reached its limit plesk will notify the event manager and it will call the event you have made.
     
  8. PedstersPlanet

    PedstersPlanet Guest

    0
     
    Sorry if I soundthick lol, but IIRC, domainmng needs a domain name in the --domain-name= argument yes, so if I run the domainmng as root, then what do i add to the --domain-name= argument?
    Or is there a way, via a script, to check each domains with domainmng.

    I would always thought that when a domain has maxed any limit, it'll automatically disable domains (as per their documentation), but it doesnt.... That kind of defeats the object of having limits....
     
  9. dhthwy

    dhthwy Guest

    0
     
    http://download1.swsoft.com/Plesk/Plesk7.5/Doc/plesk-7.5r-admins-guide-html/ch02s26.html

    /usr/local/psa/admin/sbin/domainmng --turn-off --domain-name=<new_domain_name>

    this should work. the event manager will replace <new_domain_name> with the domain attached to the event.

    <new_domain_name> might seem a little confusing since its an event on an active domain, makes more sense for it to be just <domain_name> but thats not how it's designed.
     
  10. PedstersPlanet

    PedstersPlanet Guest

    0
     
    Ok, I'm stupid.......... lol....... I was making it asif it was harder to do than it is lol.... thanks

    One final question...... Can we run the statistics say every 10 minutes, so it updates for customer purposes? Or will it drain a lot resources? As a new customer thought that my statistics were broken, as they uploaded 350mb but the stats stil were 0mb....
     
  11. dhthwy

    dhthwy Guest

    0
     
    statistic generation seems to be handled by /usr/local/psa/admin/sbin/statistics so you could try setting up a cron job for it.

    im new to plesk myself so im not sure if this will work. someone with more knowledge of plesk would be better to answer your question.

    calling it with no arguments generates stats for all domains.
    if load becomes an issue you could try adding a custom button to the control panel thatll update stats for a single domain.

    statistics --calculate-one --domain-name=

    i see some errors when i run it manually from the command line so it might not work.... try it out and see.

    */10 * * * * /usr/local/psa/admin/sbin/statistics >> /usr/local/psa/var/log/stats.out.log 2>&1
     
Loading...