spartacus
5th October 2007, 17:16
Hi all,
is there a possibility, to setup the cron-deamon in that way, that cron is sending a mail to a desired adress, if there are any problems? (should be Solaris 9)
Richard
csecgn
7th October 2007, 00:05
I don't know a direct way, but if you start your programs via a shell script, the script could set an "ok-marker" if it is finished. Another supervising process checks the presence of the marker and sends an error email if it is not set at an expected time.
Or the scripts sends an email if the return code of the called progam/script is <> 0, or, ...
I think there are many ways to do this or something similar
hth
Regards
Christof
kaukul
7th October 2007, 18:07
you can use mailx utility for this purpose.
spartacus
9th October 2007, 10:04
Hi all,
thank you for your support. In think I asked m question wrong. I tried to keep the description of the problem as short as possible, but now i see .. it was wrong.
The problem is actually, that the crondaemon of a server from us, is sending a whole bunch of error messages during startup of server. This is not nice, but even worse is, that the server adresses this messages to the root adress... and that is, in our case, absolutly undesired.
We now searching a way prevent this messages or redirect them. I thought there might be a kind of standard mechanism which produces this messages and I hoped with my first question, that this mechanism would be mentioned, but I failed :-(
The prob is, right now, we are not able to prevent the messages, or redirect them (except we unlug the cable ;-)). We need some ideas where to look to switch that off.
I hope I managed to clear uo things a little bit (and not vice versa)!
victor_cleto
9th October 2007, 18:53
On Linux you have a /etc/initlog.conf where you can use this to specify regexp expressions that, if matched, are not logged.
You also have a /etc/syslogd.conf where you can specify what types of message go where (mail, specific logs, etc.)
Maybe Solaris has something similar?
spartacus
10th October 2007, 10:06
Hi Victor,
at least we have we have "/etc/syslog.conf". I can't find "initlog.conf". I will check if it helps something. That will take a while, 'cause we can't work continuously on this problem :-(
Han Brinkman
10th October 2007, 12:33
Richard,
I guess you want to send the output to someone working in your organization by mail.
First check if you use mail on your solaris box by using something simple like:
echo hello | mailx -s "test" richard@spartacus.com
If that works you can redirect the output of your cron job by simply adding 2>&1 | mailx -s "job output" richard@spartacus.com
to your job.
If mail from the command line doesn't work than you have to figure out how to get that working. E.g. on my workstation on which I use Services for Unix I have to change the DS entry in /etc/mail/sendmail.cf. The host which I use here is able to receive smtp and is relaying them for our exchange server.
Hope it helps,
Han
bdittmar
10th October 2007, 15:49
Hi all,
thank you for your support. In think I asked m question wrong. I tried to keep the description of the problem as short as possible, but now i see .. it was wrong.
The problem is actually, that the crondaemon of a server from us, is sending a whole bunch of error messages during startup of server. This is not nice, but even worse is, that the server adresses this messages to the root adress... and that is, in our case, absolutly undesired.
We now searching a way prevent this messages or redirect them. I thought there might be a kind of standard mechanism which produces this messages and I hoped with my first question, that this mechanism would be mentioned, but I failed :-(
The prob is, right now, we are not able to prevent the messages, or redirect them (except we unlug the cable ;-)). We need some ideas where to look to switch that off.
I hope I managed to clear uo things a little bit (and not vice versa)!
Hello,
forward the system-mails from root to one or more other existing users may achieve your requirements.
Regards