RSS

eventtriggers

19 Apr

windows 6带来了一个新变化:将任务附加到事件上,通常用来检测重要的事件,比如关机。那么如何在windows server 2003上使用呢?用到一个命令 eventtriggers.exe为了达到错误事件发送邮件需要创建一个脚本email.vbs

   1: set objEmail = CreateObject("CDO.Message")
   2: objEmail.From = "xunyang@cashcat.com"
   3: objEmail.TO = "xunyang@cashcat.com"
   4: objEmail.Subject = "An error from 10.10.10.10"
   5: objEmail.Textbody = "servername 10.10.10.10 have a error"
   6: objEmail.send

然后创建一个bat

   1: eventtriggers /create /tr “Error logs” /t error /tk c:\email.vbs

设置为开机启动即可。

Advertisements
 
Leave a comment

Posted by on April 19, 2009 in Cmdlets&Tools

 

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: