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.

Is there anyway to monitor crond?

Discussion in 'General Discussion' started by jols, Dec 29, 2005.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    A hosted customer just pointed out to us that their crons had not run since Dec 8th. I was amazed to find that crond had stopped on the server without our receiving any sort of notice. We may have received an email about this, but we, like many receive a TON of email every day and this may have been overlooked.

    Is there any way to have crond monitored via the Service Manager so that the stats appears when clicking on he Server Status link in WHM?

    Thanks much for any answer on this.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I was told a while back that this was going to be put into chkservd, but it never materialised - possibly because of the different cron daemons used by RH/trustix/FreeBSD. If you want to hack in your own process check it should be straightforward enough if you know some perl and look in the files in /etc/chkserv.d/ and the script itself /usr/local/cpanel/libexec/chkservd
     
  3. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    For a very late thanks; Thanks much for the tip.
     
  4. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Trying to write a script for this for chkserv monitoring and restarting cron (when needed).

    How does this look:

    cd /etc/chkserv.d
    touch crond
    pico -w crond

    Inserting this line at the top:
    service[crond]=x,x,x,service crond restart,crond,root|mailnull

    Then:
    pico -w chkservd.conf

    Inserting this line in alpehbetical order within the list:

    crond:1


    Look good?

    Thanks much.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Looks good - simple to test it. You probably don't need the |mailnull at the end of the line.

    This would need tweaking for the likes of FreeBSD and Trustix that use different cron daemons and start methods.
     
  6. jondolar

    jondolar Well-Known Member

    Joined:
    Feb 15, 2004
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    This works

    This worked for me. Remember to restart chkservd

    service chkservd restart

    Not sure if that is required to restart but once I did that it automatically restarted crond so I know it works now.

    Thanks
     
Loading...

Share This Page