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.

Stats run but WHM Reports Error?

Discussion in 'General Discussion' started by lkraven, Jun 20, 2007.

  1. lkraven

    lkraven Member

    Joined:
    Jun 19, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Running WHM 11.1.0, CPanejl 11.4.19-C14377 CURRENT BRANCH

    In WHM -> Server Configuration -> Statistics Software Configuration, it is showing this text in red:

    The server is having trouble keeping up with your statistics processing schedule. You should increase the time between statistic generation, or upgrade the server. If you have recently decreased the time between statistic generation, you may wish to wait that amount of time to see if the server will catch up before changing back.

    :confused:

    However, the stats themselves appear to be running. Executing /scripts/runstatsonce doesn't seem to report an error.

    Anyone know where WHM is getting the lastrun information or determining when the last time the stats ran? All of the domains show they are thousands of minutes behind in WHM.
     
  2. cpanelinfoseeker

    cpanelinfoseeker Well-Known Member

    Joined:
    Oct 25, 2002
    Messages:
    323
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    NE Illinois
    cPanel Access Level:
    Root Administrator
    It is not limited to current, I have it in release also (WHM 11.1.0 cPanel 11.4.19-R14378
    FEDORA 2 i686 - WHM X v3.1.0 ). I actually reinstalled rrdtools as that fixed it about a year ago, but not this time. Everything appears normal except in WHM Statistics Software Configuration.

    cpanellogd appears to be processing as normal and klogd is running.

    I actually was searching here to see if there was a fix.

    I'll keep looking,
    Ron
     
  3. lkraven

    lkraven Member

    Joined:
    Jun 19, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Well, if I find anything, I'll post it to this thread. I have already searched quite exhaustively-- at this point, I'm not even looking for a fix so much as some insight on how WHM determines when the last reports were run so I can start looking for trouble there.

    I have already reinstalled rrdtools as well-- it did not help.
     
  4. lkraven

    lkraven Member

    Joined:
    Jun 19, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Well, I found the lastrun files here:

    /var/cpanel/lastrun

    There's a directory for each usern on the system, and in that directory, there are 0 byte files. One for stats, one for bandwidth. The date of the file is what WHM is using for the last run time of the stats and bandwidth processing.

    Presumably, when the stats are done running, these files get updated or touched and that tells WHM that the stats have run sometime in the past.

    I cannot, for the life of me, figure out why they aren't being updated. I ended up deleting them all just to get rid of that annoying red message, but now I have the problem that I have no idea when the last time stats were run for any of my domains.

    Anyone have any ideas??
     
  5. lkraven

    lkraven Member

    Joined:
    Jun 19, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I have found the problem and fixed it, but I don't know how long the fix will be good for.

    The cpanellogd script is a perl script that creates a lastrun file. Presumably some process either deletes it or this script is supposed to UPDATE the time the lastrun file is accessed as well. In my CentOS system, this script does not do that.

    The solution for me was to modify this code so that the OLD lastrun file is deleted right before the new one is created.

    Here is the old code:

    Code:
        if ($stats) {
            open( RUN, '>', $lastrunstatsfile );
            chmod( oct('0600'), $lastrunstatsfile );
            close(RUN);
            return 0 if ( !-e $lastrunstatsfile );
        }
        if ($bandwidth) {
            open( RUN, '>', $lastrunbwfile );
            chmod( oct('0600'), $lastrunbwfile );
            close(RUN);
            return 0 if ( !-e $lastrunbwfile );
        }
    
    Here is the new code:

    Code:
        if ($stats) {
    [B]        if ( -e $lastrunstatsfile ) { unlink $lastrunstatsfile; }
    [/B]        open( RUN, '>', $lastrunstatsfile );
            chmod( oct('0600'), $lastrunstatsfile );
            close(RUN);
            return 0 if ( !-e $lastrunstatsfile );
        }
        if ($bandwidth) {
    [B]        if ( -e $lastrunbwfile) { unlink $lastrunbwfile; }
    [/B]        open( RUN, '>', $lastrunbwfile );
            chmod( oct('0600'), $lastrunbwfile );
            close(RUN);
            return 0 if ( !-e $lastrunbwfile );
        }
    
    This fixes my problem.
     
Loading...

Share This Page