This section provides supplemental information for using Server Administrator.
Setting Alert Actions for Systems Running a Supported Red Hat Linux Operating System
When you set Alert Actions for an event, you can specify the action to "display an alert on the server." To perform this action, Server Administrator writes a message to the console. If the Server Administrator system is running X Windows, you will not see that message by default. To see the alert message when X Windows is running, you must start xconsole before the event occurs.
When you set Alert Actions for an event, you can specify the action to "broadcast a message." To perform this action, Server Administrator executes the "wall" command, which sends the message to everybody logged in with their message permission set to "yes." If the Server Administrator system is running X Windows, you will not see that message by default. To see the broadcast message when X Windows is running, you must start a terminal such as "gnome-terminal" before the event occurs.
When you set Alert Actions for an event, you can specify the action to "execute an application." There are limitations on the applications that Server Administrator can execute. Follow these guidelines to ensure proper execution:
Do not specify X Windows-based applications because Server Administrator cannot execute such applications properly.
Do not specify applications that require input from the user because Server Administrator cannot execute such applications properly.
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 "application to execute" 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® Linux user, Admin, 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.