Child pages
  • Guide to Standardized Hooks - Stats Functions
Skip to end of metadata
Go to start of metadata

 

Introduction

The Stats category's events occur during statistics processing.

RunAll


This event takes place when the system processes statistics for all of the server's cPanel accounts.

Available Stages:

  • pre — Hook action code runs before the system processes cPanel statistics.
  • post — Hook action code runs after the system processes cPanel statistics.

Action Code Runs As:

root

Blocking Attribute:

Escalate Privileges Attribute:

N/A

Output parameters

This event does not return output.

 

RunUser


This event takes place when the system processes statistics for a specific cPanel account.

Available Stages:

  • pre — Hook action code runs before the system processes cPanel statistics.
  • post — Hook action code runs after the system processes cPanel statistics.

Action Code Runs As:

The cPanel user.

Blocking Attribute:

Escalate Privileges Attribute:

Output parameters

Note:

The chosen stage determines the event's output. Select the appropriate tab to view output parameters for that stage. 

ParameterTypeDescriptionPossible valuesExample
lastruntimeintegerThe last time at which the system processed the user's statistics.A valid Unix timestamp.1417584474
userstringThe cPanel account username.A valid cPanel username.username
homedirstringThe cPanel account's home directory.An absolute directory path./home/username/
rLOG_CONFhash referenceA hash reference that indicates which analytics programs will process each of the user's domains.A valid hash reference. 
maindomainstringThe cPanel account's main domain.A valid domain.example.com
rALLDOMAINSarray referenceAn array reference that contains all of the user's domains.A valid array reference. 
logfiledescarrayAn array of hashes for each domain that the cpanellogd daemon will process.This array contains a hash for each domain. Each hash contains the domain, filename, and logfile parameters. 

domain

string

A domain on the cPanel account.

The event returns this parameter in each logfiledesc hash.

A valid domain.seconddomain.com

filename

string

The log file's filename.

The event returns this parameter in each logfiledesc hash.

A valid filename.logfile

logfile

string

The log file's absolute path.

The event returns this parameter in each logfiledesc hash.

A valid file path./home/users/logfile
ParameterTypeDescriptionPossible valuesExample
lastruntimeintegerThe last time at which the system processed the user's statistics.A valid Unix timestamp.1417584474
userstringThe cPanel account username.A valid cPanel username.username
homedirstringThe cPanel account's home directory.An absolute directory path./home/username/
rLOG_CONFhash referenceA hash reference that indicates which analytics programs processed each of the user's domains.A valid hash reference. 
maindomainstringThe cPanel account's main domain.A valid domain.example.com
rALLDOMAINSarray referenceAn array reference that contains all of the user's domains.A valid array reference. 
logfiledescarrayAn array of hashes for each domain that the cpanellogd daemon processed.This array contains a hash for each domain. Each hash contains the domain, filename, and logfile parameters. 

domain

string

A domain on the cPanel account.

The event returns this parameter in each logfiledesc hash.

A valid domain.seconddomain.com

filename

string

The log file's filename.

The event returns this parameter in each logfiledesc hash.

A valid filename.logfile

logfile

string

The log file's absolute path.

The event returns this parameter in each logfiledesc hash.

A valid file path./home/users/logfile