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.

Cron error

Discussion in 'General Discussion' started by DreamPhysix, Aug 16, 2011.

  1. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Received an email notification with subject "Cron <root@fourier> /usr/lib64/sa/sa2 -A" and body "Invalid system activity file: /var/log/sa//sa16" not sure how to interpret this. first time ive seen it
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It appears to be related to some cron for sar that you have setup. What is the full cron you have in /var/spool/cron/root in regards to sar?
     
  3. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Nothing in my cron relates to sar:
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I think the cron is stemming from this location:

    /etc/cron.d/sysstat

    Please post the contents of sysstat:

    Code:
    cat /etc/cron.d/sysstat
    Next, does /var/log/sa exist? If so, please post the contents of /var/log/sa files:

    Code:
    ls -lah /var/log/sa
     
  5. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    The contents of the sar files are too long to post here.. I read something the other day that told me to remove the sar files
     
    #5 DreamPhysix, Aug 17, 2011
    Last edited: Aug 17, 2011
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Removing the /var/log/sa/sa files is what is causing this issue. You removed the binaries and now they can't be found. Here are the files in /var/log/sa on my machine:

    Code:
    root@host [/var/log/sa]# ls -lah
    total 3.9M
    drwxr-xr-x 2 root root 4.0K Aug 17 00:00 ./
    drwxr-xr-x 9 root root 4.0K Aug 17 17:50 ../
    -rw-r--r-- 1 root root 210K Aug  9 23:50 sa09
    -rw-r--r-- 1 root root 210K Aug 10 23:50 sa10
    -rw-r--r-- 1 root root 210K Aug 11 23:50 sa11
    -rw-r--r-- 1 root root 210K Aug 12 23:50 sa12
    -rw-r--r-- 1 root root 210K Aug 13 23:50 sa13
    -rw-r--r-- 1 root root 210K Aug 14 23:50 sa14
    -rw-r--r-- 1 root root 210K Aug 15 23:50 sa15
    -rw-r--r-- 1 root root 210K Aug 16 23:50 sa16
    -rw-r--r-- 1 root root 158K Aug 17 17:50 sa17
    -rw-r--r-- 1 root root 227K Aug  8 23:53 sar08
    -rw-r--r-- 1 root root 227K Aug  9 23:53 sar09
    -rw-r--r-- 1 root root 227K Aug 10 23:53 sar10
    -rw-r--r-- 1 root root 227K Aug 11 23:53 sar11
    -rw-r--r-- 1 root root 227K Aug 12 23:53 sar12
    -rw-r--r-- 1 root root 227K Aug 13 23:53 sar13
    -rw-r--r-- 1 root root 227K Aug 14 23:53 sar14
    -rw-r--r-- 1 root root 227K Aug 15 23:53 sar15
    -rw-r--r-- 1 root root 227K Aug 16 23:53 sar16
    I cannot determine why anything would tell someone to remove the sa* files in /var/log/sa, since that contains valuable information that tells you server cpu, idle, and so on for the past 24 hours. I also don't know how you'd get them back, since the files removed were binary files. You might have to reinstall sar itself, but that's an OS level option.

    Of note, I would not suggest removing contents on any system per any guide or troubleshooting recommendations. Moving the contents to /root/backup or /root/sar would have been a better idea. At that point, you'd be able to restore those files.

    If you don't want to correct sar working, which now means you won't have the useful information it provides when your server crashes or hangs, you can simply get rid of that cron:

    Code:
    cd /etc/cron.d
    mv sysstat /root/sysstat
    The cron would quit running then.
     
  7. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I don't remember the actual command I issued and it's not in /root/.bash_history. My sar command still seems to be functioning, so if the cron error disappears (i've only seen it once which was 21 hours ago) then it should work, I hope.
     
  8. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    The guide I followed is located here: SYSSTAT
     
  9. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I ran both entries in /etc/cron.d/sysstat without error:
     
Loading...

Share This Page