Users Guide
7
设置警报措施
对运行支持的 Red Hat Enterprise Linux 和 SUSE Linux Enterprise
Server 操作系统的系统设置警报措施
设置事件的警报措施时,可以将操作指定为在服务器上显示警报。为了执行此操作,Server Administrator 会将消息写入 /dev/
console。如果 Server Administrator 系统运行的是 X Window 系统,则不显示该消息。要在运行 X Window 系统时查看 Red Hat
Enterprise Linux 系统上的警报消息,在事件发生之前必须启动 xconsole 或 xterm -C。要在运行 X Window 系统时查看 SUSE
Linux Enterprise Server 系统上的警报消息,在事件发生之前必须启动终端,例如:xterm -C。
为事件设置警报措施时,可以指定用于广播消息的操作。为了执行此操作,Server Administrator 会执行 wall 命令,该命令将消
息发送到已登录且消息权限设为是的每个人。如果 Server Administrator 系统正在运行 X Window 系统,则默认情况下不会显示
该消息。要在 X Window 系统运行时查看广播消息,必须在发生事件前启动诸如 xterm 或 gnome-terminal 之类的终端。
设置事件的警报措施时,您可以将操作指定为执行应用程序 。对 Server Administrator 可以执行的应用程序有一些限制。 要确
保正确执行应用程序:
• 不要指定基于 X Window 系统的应用程序, 因为 Server Administrator 无法正确执行此类应用程序。
• 不要指定需要用户输入信息的应用程序,因为 Server Administrator 无法正确执行此类应用程序。
• 指定应用程序时,请将 stdout 和 stderr 重定向至文件,以便查看所有输出或错误消息。
• 如果希望为警报执行多个应用程序(或命令),请创建一个脚本,并将脚本的完整路径放入应用程序的绝对路径框中。
示例 1:ps -ef >/tmp/psout.txt 2>&1
示例 1 中的命令执行应用程序 ps,将 stdout 重定向至文件 /tmp/psout.txt,并将 stderr 重定向至 stdout 所重定向的同一文
件。
示例 2:mail -s "Server Alert" admin </tmp/alertmsg.txt>/tmp/mailout.txt 2>&1
示例 2 中的命令执行邮件应用程序,将文件 /tmp/alertmsg.txt 中包含的消息以 Server Alert(服务器警报)为主题发送至 Red
Hat Enterprise Linux 用户或 SUSE Linux Enterprise Server 用户和管理员。用户必须在事件发生之前创建文件 /tmp/
alertmsg.txt。此外,出现错误时,stdout 和 stderr 将重定向至文件 /tmp/mailout.txt。
Setting Alert actions in Windows Server to Execute Applications
In windows, the Interactive Services Detection is disabled by default. The Interactive Services Detection must be activated in
Regedit to enable the executable applications.
To enable the Interactive Service Detection follow the steps mentioned below:
1. Modifying the NoIteractiveServices
1. Open Regedit.
2. Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Windows\.
3. Right-click NoIteractiveServices and then click Modify.
4. In Value Data enter 0 and click OK.
5. Close Regedit
6. To add the user to a group, select the group name from the Group drop-down menu and click Add.
7. Click OK.
2. Enabling the Interactive Service Detection
8. Open Services.msc.
55