Guide to Standardized Hooks - Stats Functions

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. 

Pre

Parameter

Type

Description

Possible values

Example

lastruntime

integer

The last time at which the system processed the user's statistics.

A valid Unix timestamp.

1417584474

user

string

The cPanel account username.

A valid cPanel username.

username

homedir

string

The cPanel account's home directory.

An absolute directory path.

/home/username/

rLOG_CONF

hash reference

 A hash reference that indicates which analytics programs will process each of the user's domains. 

A valid hash reference.

 

maindomain

string

The cPanel account's main domain.

A valid domain.

example.com

 rALLDOMAINS 

 array reference 

An array reference that contains all of the user's domains.

A valid array reference.

 

logfiledesc

array

An array of hashes for each domain that thecpanellogddaemon will process.

 This array contains a hash for each domain. Each hash contains thedomain,filename, andlogfileparameters. 

 

domain

string

A domain on the cPanel account.

The event returns this parameter in eachlogfiledeschash.

A valid domain.

seconddomain.com

filename

string

The log file's filename.

The event returns this parameter in eachlogfiledeschash.

A valid filename.

logfile

logfile

string

The log file's absolute path.

The event returns this parameter in eachlogfiledeschash.

A valid file path.

 /home/users/logfile 

 Post

 

Parameter

Type

Description

Possible values

Example

lastruntime

integer

The last time at which the system processed the user's statistics.

A valid Unix timestamp.

1417584474

user

string

The cPanel account username.

A valid cPanel username.

username

homedir

string

The cPanel account's home directory.

An absolute directory path.

/home/username/

rLOG_CONF

hash reference

 A hash reference that indicates which analytics programs processed each of the user's domains. 

A valid hash reference.

 

maindomain

string

The cPanel account's main domain.

A valid domain.

example.com

 rALLDOMAINS 

 array reference 

An array reference that contains all of the user's domains.

A valid array reference.

 

logfiledesc

array

An 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

 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....