The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron Job notification email elmesy AIX 1 01-13-2009 08:15 AM
failing drive markper AIX 4 07-21-2008 01:28 PM
Problem with Cron Email Notification sasaliasim AIX 1 04-29-2008 12:02 PM
ssh - rm failing shihabvk Shell Programming and Scripting 4 09-30-2005 02:27 AM
FTP login failing zbis12 UNIX for Dummies Questions & Answers 3 05-24-2002 11:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2009
Pablo_beezo Pablo_beezo is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 77
Notification of cron failing

I have just found out that a cron i set up to run everyday has not been running. It turns out there was a problem with the box???

How can i get a notification if it does absolutely nothing i.e. an email to say cron not working today??

any help

I'm using KSH Solaris

Last edited by Pablo_beezo; 03-10-2009 at 12:23 PM..
  #2 (permalink)  
Old 03-10-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
How are you going to fire off or schedule a check on crond ( the cron daemon) if it is not running? at, batch, and crontab all depend on the crond process being up, happy, and working.

A possibility is to look thru the process list every hour with a permanently running process. This is not a great idea but you could try something like this:

Code:
while true
do
   sleep 3600   # one hour
   ps -ef > /tmp/t.lis
   grep -q 'crond' /tmp/t.lis || echo 'crond is down' | /usr/bin/mailx -s 'crond is down'  me@my.com
done
Then logon and start the script nohup as a background process. But then you have the problem later on: is this process still working? And this script does not tell you if there might be something else going on, like your crontab has syntax errors or the syadmin turned of crontab access for your account.

Sometimes having a proactive sysadmin with the right toolset is the best choice - hacks like this come in a distant second.
  #3 (permalink)  
Old 03-11-2009
Pablo_beezo Pablo_beezo is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 77
I thought it would not really be possible but worth a try.

Thanks Jim
  #4 (permalink)  
Old 03-11-2009
frozentin frozentin is offline
Registered User
  
 

Join Date: May 2008
Location: Vienna, VA + Bombay, India
Posts: 109
Do you have any system monitoring software running on your server. Example: HP Openview? If yes, then this can be detected and notifications can be sent out.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0