Users Guide

106 Setting Alert Actions
Redirect
stdout
and
stderr
to a file when specifying the application so that
you can see any output or error messages.
If you want to execute multiple applications (or commands) for an alert,
create a script to do that and put the full path to the script in the
Absolute
path to the application
box.
Example 1:
ps -ef >/tmp/psout.txt 2>&1
The command in Example 1 executes the application
ps
, redirects
stdout
to the file
/tmp/psout.txt
, and redirects
stderr
to the same file as
stdout
.
Example 2:
mail -s "Server Alert" admin </tmp/alertmsg.txt
>/tmp/mailout.txt 2>&1
The command in Example 2 executes the mail application to send the
message contained in the file
/tmp/alertmsg.txt
to Red Hat Enterprise
Linux user or SUSE Linux Enterprise Server user, and Administrator, with
the subject
Server Alert.
The file
/tmp/alertmsg.txt
must be created by the
user before the event occurs. In addition,
stdout
and
stderr
are redirected
to the file
/tmp/mailout.txt
in case an error occurs.
Setting Alert Actions in Microsoft Windows
Server 2003, and Windows Server 2008
When specifying alert actions, Visual Basic scripts are not automatically
interpreted by the Execute Application feature, although you can run a
.cmd, .com, .bat, or .exe file by only specifying the file as the
alert action.
To resolve this issue, first call the command processor cmd.exe to start your
script. For example, the alert action value to execute an application can be set
as follows:
c:\winnt\system32\cmd.exe /c d:\example\example1.vbs
where d:\example\example1.vbs is the full path to the script file.
book.book Page 106 Friday, December 4, 2009 3:20 PM