The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Configure cpanellogd via command line?

Discussion in 'General Discussion' started by svosolutions, Jan 30, 2013.

  1. svosolutions

    svosolutions Registered

    Joined:
    Nov 11, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    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?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    669
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    Code:
    root@vps [~]# 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.
     
  3. svosolutions

    svosolutions Registered

    Joined:
    Nov 11, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    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?
     
  4. svosolutions

    svosolutions Registered

    Joined:
    Nov 11, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    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
     
Loading...

Share This Page