07-25-2010
Crobjob Script to Email if Problem Found
I have a script that runs in cron twice every hour. My question is, when this script finds an error and sends an email on that error, and the error recovers
how do i make the script only email when there's a problem and also when there's a recovery for that problem?
simply inserting a "mail -s ....." in front of the command will send out an email with EVERY output from the script. this isn't what i need.
i want the script to send an email out to whomever i tell it to, only when an occurrence of an error is found in a file, and when that error has cleared (enough time passes and that alert didn't reoccur).
makes sense?
please help.
thank you
Last edited by SkySmart; 07-25-2010 at 04:48 PM..
10 More Discussions You Might Find Interesting
1. AIX
Hi guys,
I am trying to install Big Brother monitoring on my box p570 AIX5.3ML2.
But the after the installation you must run a make and it is failed see below the message:
/home/bb/bb1.9h-btf/src/ # make
Making aix makefile
BBOS="aix" CC="cc" CFLAGS=" -Daix -DTIMEH -DREGEXEC... (1 Reply)
Discussion started by: touny
1 Replies
2. UNIX for Dummies Questions & Answers
Title explains it already. I need to solve the problem from log files. But backspace types ^H . I dont know how to delete character. How can I mend the keybord ? (1 Reply)
Discussion started by: olddays
1 Replies
3. Shell Programming and Scripting
Hello Guys,
what is the significance of using #!/bin/sh at the start of shell script.
my default shell is ksh, when i run my script i have ksh: not found error
and when i use ./myscript it works.
Can anyone explain me the problem please ?
tnx (1 Reply)
Discussion started by: midhun_u
1 Replies
4. Shell Programming and Scripting
when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key
I know its probably something simple can anyone help?
here is my pause function:
function pause(){
read -s -n 1 -p "Press any key to return to Menu . . ."
echo
}
SCRIPT... (2 Replies)
Discussion started by: Alendrin
2 Replies
5. Solaris
I'm first time user on Enterprise 3500 and got some problem,
that I try to install Solaris 9 on this machine (and it work fine on Sun U10)
it not found harddisk in fdisk command
on 'ok prompt' I try probe-scsi-all but it show only Tape and CDrom
in this machine I install 2 harddisk in... (2 Replies)
Discussion started by: Harmut
2 Replies
6. Shell Programming and Scripting
Help with script that will check log, then find a match is found, add that as the subject line.
1. The script will always run as a deamon.. and scan the event.log file
2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies
7. Shell Programming and Scripting
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies
8. Shell Programming and Scripting
Hi,
In the shell script, i want to do sftp and go to a directory and check if a particular file is present, if not i send an email with some error message. Please guide me about how i could achieve it...." (1 Reply)
Discussion started by: sJohn
1 Replies
9. Shell Programming and Scripting
Hi All,
I am using a putty session to login a server in which autosys is installed. we get the GUI by entering . /opt/CA/UnicenterAutoSysJM/autouser/autosys.ksh.server and then jobscape.
when i tried autorep -j jobname it gives me autorep not found. Please help me with this. (1 Reply)
Discussion started by: mahesh300182
1 Replies
10. Red Hat
Hi,
I have problem with a script, it was working for 6 month and suddenly I started getting strange expire times
example:
# chage -l wXXp
Last password change : Oct 28, 2014
Password expires : Nov 27, 2014
Password... (3 Replies)
Discussion started by: redmansas
3 Replies
LEARN ABOUT DEBIAN
script-email
SCRIPT-EMAIL(8) System Administration Commands SCRIPT-EMAIL(8)
NAME
script-email - Amanda script to send email notifications
DESCRIPTION
script-email is an Amanda script implementing the Script API. It should not be run by users directly. It sends a notification email to the
addresses specified in the MAILTO property.
PROPERTIES
This section lists the properties that control script-email's functionality. See amanda-scripts(7) for information on the Script API,
script configuration.
MAILTO
List of email addresses that will receive an email on command execution. It is a multi-valued property:
property "MAILTO" "amanda@domain.com" "sysadmin@domain.com" "amandauser@domain.com"
EXAMPLE
In this example, script-email is scheduled to be run before the DLE, on the server. The unqualified email address amanda will be passed to
the email system unchanged. The script is then attached to a dumptype, which can then be specified for any DLEs which require
notification.
define script-tool pre-email {
comment "email me before this DLE is backed up"
plugin "script-email"
execute-on pre-dle-backup
execute-where server
property "mailto" "amanda"
}
define dumptype user-tar-email {
user-tar
script "pre-email"
}
SEE ALSO
amanda(8), amanda.conf(5), amanda-client.conf(5), amanda-scripts(7)
The Amanda Wiki: : http://wiki.zmanda.com/
AUTHORS
Jean-Louis Martineau <martineau@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Dustin J. Mitchell <dustin@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Amanda 3.3.1 02/21/2012 SCRIPT-EMAIL(8)