Parallels H-Sphere Documentation System Administrator Guide

 

H-Sphere Traffic Calculation

 
 

Related Docs:   Web Server Configuration Mail Server Configuration Winbox Traffic Calculation Since 2.5

Last modified: 16 Nov 2005

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

This document dwells specifically on the issues of traffic logs and traffic calculation.

  1. Check traffic with H-Sphere Control Panel

    Log into H-Sphere as admin and view the Transfer Traffic Report in the Reports menu.

  2. Check traffic on physical servers

    Web, FTP and mail logs are located in the /hsphere/local/var/statistic directory of the corresponding physical server.

    Log files have the following names:

    • dd.mm.YYYY.txt - web logs,
    • dd.mm.YYYY.gst.txt - ftp logs,
    • dd.mm.YYYY.ftp.txt - virtual ftp logs.
    • dd.mm.YYYY.qml - mail logs,

    where dd.mm.YYYY is the timestamp of log file creation date.

    Here, mail logs are generated by the qmail server, and ftp logs by proftpd utility.

    Log files contain specially-formatted information tabulated as follows:

    |name|xFer(kB)|Hits_All|Hits_HTML|

    Here, name is the domain name, xFer is total traffic in kilobytes.

    Processed traffic files are moved to the /hsphere/local/var/statistic/loaded directory as .gz archives.

    Starting with 2.5 version, a new scheme for reading Winbox traffic data using XMLs has been implemented.

  3. Traffic processing scripts in cron

    • HTTP traffic:

      Please refer to Web Traffic Calculation for details.

    • User FTP traffic:

      Cron runs the /hsphere/shared/scripts/cron/ftp_anlz_user.pl script on everyday basis for collecting user FTP traffic.

      ftp_anlz_user.pl parses the /hsphere/local/var/proftpd/xferlog FTP log file and writes FTP traffic statistics into the timestamp-named /hsphere/local/var/statistic/dd.mm.YYYY.gst.txt statistics files.

    • Virtual FTP traffic:

      Cron runs the /hsphere/shared/scripts/cron/ftp_anlz.pl script on everyday basis for collecting virtual FTP traffic.

      ftp_anlz.pl parses the /hsphere/local/var/proftpd/logs/{vhost_id}.ftp.log logs files for each virtual FTP account and writes traffic statistics into the timestamp-named /hsphere/local/var/statistic/dd.mm.YYYY.ftp.txt statistics files.

    • Mail traffic:

      Cron runs the /hsphere/scripts/cron/mail_anlz.pl script on everyday basis to collect mail traffic. The script analyzes the /var/log/maillog Qmail log file and collects mail statistics into the specially formatted dd.mm.YYYY.qml.txt files in the H-Sphere statistics directory (/hsphere/local/var/statistic).

  4. TrafficLoader

    TrafficLoader H-Sphere Java class is in charge of parsing the server traffic. That's how it is launched by cron:

    30 5 * * * su -l cpanel -c 'java psoft.hsphere.TrafficLoader'

    TrafficLoader processes Web, mail, FTP and virtual FTP traffic in the formatted statistics files located in the /hsphere/local/var/statistic directory and inserts these lines into the translog table of the H-Sphere system database.

    TrafficLoader also calls the /hsphere/shared/scripts/xfer_cat.pl script to move the already loaded statistics files to the /hsphere/local/var/statistic/loaded directory as .txt.gz archives.


Related Docs:   Web Server Configuration Mail Server Configuration Winbox Traffic Calculation Since 2.5



© Copyright 2017. Parallels Holdings. All rights reserved.