Configure cpanellogd via command line?

svosolutions

Registered
Nov 11, 2012
4
0
1
cPanel Access Level
DataCenter Provider
Is there anyway to configure cpanellogd's run time besides WHM? I admin a server with 30 cpanel VPSs on it and cpanellogd is running at the same time for each VPS causing very high load on the server. I want to stagger them to run at different times but clicking through the GUI 30 times would take quite a while. It would be much easier to write a quick script to automate the reconfiguration but I can find no documentation on cpanellogd configuration from the command line. Is it possible?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello :)

You can configure the "BLACKHOURS" option manually in the /etc/stats.conf file. Here is an example:

Code:
[email protected] [~]# cat /etc/stats.conf
ALLOWALL=yes
BLACKHOURS=0,1,2,3,4,5
DEFAULTGENS=ANALOG,AWSTATS,WEBALIZER
VALIDUSERS=
allow_awstats_include=0
This is equivalent to using "WHM Home » Server Configuration » Statistics Software Configuration » Configure Statistics Process Time Schedule".

Thank you.
 

svosolutions

Registered
Nov 11, 2012
4
0
1
cPanel Access Level
DataCenter Provider
Thank you very much for your reply Michael. Besides blackhours, is there a conf file that controls "Log Processing Frequency" and "Bandwidth Processing Frequency" as well?
 

svosolutions

Registered
Nov 11, 2012
4
0
1
cPanel Access Level
DataCenter Provider
Just for reference, I found out from the hosting provider support the cpanellogd processing frequency is controlled by bwcycle and cycle_hours in /var/cpanel/cpanel.config. Strangely, if you search the cpanel site nothing will come up for these parameters. Not sure why this isn't documented?!

Anyways, here's what I did just in case others want to change the log processing frequency on an OpenVZ node full of cPanel VPSs:

Code:
#!/bin/bash
i=0
for ct in `vzlist -H -o ctid`; do 
        i=$((i+1))
        echo "doing $ct..."
        cp /vz/root/$ct/var/cpanel/cpanel.config /vz/root/$ct/var/cpanel/cpanel.config.orig
        sed -i "s/bwcycle=12/bwcycle=1$i/g" /vz/root/$ct/var/cpanel/cpanel.config
        sed -i "s/cycle_hours=24/cycle_hours=2$i/g" /vz/root/$ct/var/cpanel/cpanel.config
        vzctl exec $ct /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
done