Notification of cron failing


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Notification of cron failing
# 1  
Old 03-10-2009
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 01:23 PM..
# 2  
Old 03-10-2009
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  
Old 03-11-2009
I thought it would not really be possible but worth a try.

Thanks Jim
# 4  
Old 03-11-2009
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Rsync failing

Hi, I am running a rsync command from one server to another server. Source server is having user - bfdeploy and destination user is ftcjbd. Though ftcjbd is owner of /ftc/envs/static/includes/vehicles on destination server, it is still giving error "mkstemp - Permission denied". I am not able to... (4 Replies)
Discussion started by: solaris_1977
4 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

4. Solaris

oracle cron script failing.

I have this oracle script which my dba is trying to run as a cron job that fails. attached is the script. It seems to run when executed by itself but just not when scheduled. (3 Replies)
Discussion started by: Kjons76
3 Replies

5. Shell Programming and Scripting

ps -ef failing sometimes

Hi Everyone, we have a shell script "DLP_recv.sh" that has below command which is supposed to return the number of active instances of itself, which means of there is no other instance then commad would return 1 (for the current instance). The problem is that it sometimes it returns 0 which is... (3 Replies)
Discussion started by: guycool
3 Replies

6. Shell Programming and Scripting

calling expect script in ksh is failing via cron

I'm calling an expect script via a ksh script in cron and it is failing. The script runs fine if i run it manually. Does anyone know if it is an issue with compatibilty and if there is a way around it? (2 Replies)
Discussion started by: bhatia
2 Replies

7. AIX

Cron Job notification email

Hi, I'm fairly new to Aix and am looking for some help on the following. I have setup a cron job under root and want it to send the email once it's run to an external email address. I can get it to send the output in an email to me by using mail on the end of the crontab entry. But I would... (1 Reply)
Discussion started by: elmesy
1 Replies

8. AIX

failing drive

I posted some errpt output,see Phone Support, that this forum graciously looked at and confirmed what we suspected, that one of our RAID5 disks is failing. I have a replacement, but am having trouble downing the old disk. If I try and run Remove a Disk from smit, it says the device is busy. The... (4 Replies)
Discussion started by: markper
4 Replies

9. AIX

Problem with Cron Email Notification

I have two different cron jobs that run on the same days. The jobs are 7 hours apart. Both jobs are set to send notification emails when they start running. Both jobs always run successfully, but I only receive an email from the first job. I never get the email from the second job. ... (1 Reply)
Discussion started by: sasaliasim
1 Replies

10. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies
Login or Register to Ask a Question