How to debug traffic cronjob

Discussion in 'Developers' Forum' started by mikosf, Feb 21, 2021.

  1. mikosf

    mikosf New Member

    Hello,
    were can i find ISPConfig cronjobs related to Traffic Quota? And how can i execute them on-demand?
    Seems user is not being locked when surpassing limit for Traffic assigned and i will like to troubleshoot further in addition to change some parameters in the notifications ( emails )
    Sorry i am not a developer, got the Manual but i was unable to find info about this there
    appreciate your feedback, thank you
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    The notify is sent by a separate cronjob, which you can debug with
    Code:
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=300-quota_notify.inc.php
    Also, make sure "Disable websites that exceed traffic limit" is enabled under System -> Server config -> server1.example.com -> Web.
     
  3. mikosf

    mikosf New Member

    Hello,

    Debug cronjob returns no errors ( no errors in ispconfig, syslog either ), i can also see that quota enforcement is also run by "300-quota_notify.inc.php" ?
    Kindly correct me if i am wrong

    "Disable websites that exceed traffic limit" is enabled for the server ( master server only mode )

    Web Quota is working properly though, i received a mail notification when quota is exceeded
    However traffic quota does not seem to be working, additionally in statistics it displays "NAN" for web and ftp traffic, displays correctly in Website quota
    Note, other websites ( that have been running for months ) does display statistics correctly, the website i am currently troubleshooting has been created 2 days ago.

    Can you point me to the right troubleshooting steps, and if possible advise on how to trigger the quota and site locking manually so i dont have to wait for cron schedules?

    Thank you
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so traffic enforcement is probably working properly but you don't have any traffic accounting which explains why there can be no traffic quota if no traffic is recorded. Check if access to the website is recorded properly in the access.log files in the log folder of that website.
     
  5. mikosf

    mikosf New Member

    Hi Till,

    Yes, access is recorded properly in the access.log file of the website

    Also, i thought traffic accounting might not be properly working since i am on the same LAN as the server hosting the website, using local hosts file to test.
    so tried testing from outside my network, installed wordpress, uploaded some media files, transferred a couple of 100MB files through FTP, waited an hour and still statistics shows "NAN" for FTP and Web Traffic.

    moreover, i did the same test with other websites, that has confirmed statistics in "This Month" tab, metrics has not changed as well.

    Could it be that i have to wait a day or so for the changes to be applied on the ISPConfig web interface? and if so were can i find those records or trigger the cronjob/script that inputs them into the database for ISPConfig to read?

    Thank you
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to wait until the next day, traffic statistics get generated nightly and also the cronjob to disable a site works only nightly after the statistics run, running it earlier will have no effect.
     
  7. mikosf

    mikosf New Member

    I'll wait for tomorrow then and confirm
    thank you for the helpful information
    On a side note, it will be a useful feature to add support for changing the runtime options for such events from within ISPConfig, as server can be easily abused before locking a site or a user at mid-night
    I will try to play around with cronjob.inc.php and ../cron.d/* , hopefully without breaking anything around them
     

Share This Page