职业IT人-IT人生活圈

 找回密码
 成为会员
搜索
查看: 1483|回复: 0

ISA Server 2004的故障恢复

[复制链接]
joe 发表于 2006-10-8 21:00 | 显示全部楼层 |阅读模式
<p>在使用ISA Server 2004的过程中,难免会出现ISA Server 2004服务停止的情况,当然原因可能很多。当服务停止的时候,难道还需要我们做网管的手动启动吗?其实Microsoft已经为我们考虑到了这点,在Windows Server 2003中,新增了一个命令行工具Eventtriggers,可以根据事件日志来触发动作。<font face=\"宋体\">
                </font></p><p align=\"left\"><font face=\"Verdana\">你在Windows系统的帮助中可以查到Eventtriggers的详细,我这儿就只对建立一个触发器的相关参数进行介绍。 <br/>eventtriggers create 新建事件触发器,其监视并作用于按给定条件显示的日志事件。 <p>语法 <br/>eventtriggers[.exe] /create [/s Computer [/u Domain\\User [/p Password]]] /tr TriggerName [/l [APPLICATION] [SYSTEM] [SECURITY] [\"DNS Server\"] [LOG] [DirectoryLogName]
  • ] {[/eid ID] | [/t {ERROR | INFORMATION | WARNING | SUCCESSAUDIT | FAILUREAUDIT}] | [/so Source]} [/d Description] /tk TaskName </p><p>参数 <br/>/s Computer <br/>指定远程计算机名称或 IP 地址(不能使用反斜杠)。该默认值是本地计算机。 <br/>/u Domain\\User <br/>根据由 User 或 Domain\\User 指定的用户所具有的帐户权限来运行脚本。默认值是当前登录发出命令的计算机的用户具有的权限。 <br/>/p Password <br/>指出 /u 参数中指定的用户帐户的密码。 <br/>/tr TriggerName <br/>指定要与事件触发器关联的友好名称。 <br/>/l [APPLICATION] [SYSTEM] [SECURITY] [\"DNS Server\"] [LOG] [DirectoryLogName]
  • ] <br/>指定要监视的事件日志。有效类型包括:Application、System、Security、DNS server、Log 和 Directory 日志。可以使用通配符 (*),并作为默认值。 <br/>/eid ID <br/>指定事件触发器应监视的特定事件 ID。有效值为任意有效整数。 <br/>/t {ERROR | INFORMATION | WARNING | SUCCESSAUDIT | FAILUREAUDIT} <br/>指定事件触发器应监视的事件类型。有效值包括:ERROR、INFORMATION、WARNING、SUCCESSAUDIT 和 FAILUREAUDIT。不能与 /id 参数或 /so 参数一起使用。 <br/>/so Source <br/>指定事件触发器应监视的事件来源。有效值可为任何字符串。不能与 /id 参数或 /type 参数一起使用。 <br/>/d Description <br/>指定事件触发器的详细说明。有效值可为任何字符串。 <br/>/tk TaskName <br/>指定符合事件触发器条件时要执行的任务/命令/行。 <br/>/? <br/>在命令提示符下显示帮助。 <br/>注释 <br/>同时使用参数 /eid、/t 和 /so 时,对于要创建的事件触发器,日志事件必须与这三个参数指定的条件相匹配。 <br/>示例 <br/>下列示例显示如何使用 eventtriggers /create 命令: </p><p>eventtriggers /create /tr \"Disk Cleanup\" /l system /t error /tk c:\\windows\\system32\\cleanmgr.exe <br/>eventtriggers /create /s srvmain /u maindom\\hiropln /p p@ssW23 /tr \"Low Disk Space\" /eid 4133 /t warning /tk \\\\server\\share\\diskcleanup.cmd <br/>eventtriggers /create /s srvmain /user maindom\\hiropln /p p@ssW23 /tr \"Disk Backup\" /eid 4133 /l system /t error /tk \\\\server\\share\\ntbackup.exe <br/> <font face=\"宋体\">
                                    </font></p></font></p><p>语法 <br/>eventtriggers[.exe] /create [/s Computer [/u Domain\\User [/p Password]]] /tr TriggerName [/l [APPLICATION] [SYSTEM] [SECURITY] [\"DNS Server\"] [LOG] [DirectoryLogName]
  • ] {[/eid ID] | [/t {ERROR | INFORMATION | WARNING | SUCCESSAUDIT | FAILUREAUDIT}] | [/so Source]} [/d Description] /tk TaskName </p><p>参数 <br/>/s Computer <br/>指定远程计算机名称或 IP 地址(不能使用反斜杠)。该默认值是本地计算机。 <br/>/u Domain\\User <br/>根据由 User 或 Domain\\User 指定的用户所具有的帐户权限来运行脚本。默认值是当前登录发出命令的计算机的用户具有的权限。 <br/>/p Password <br/>指出 /u 参数中指定的用户帐户的密码。 <br/>/tr TriggerName <br/>指定要与事件触发器关联的友好名称。 <br/>/l [APPLICATION] [SYSTEM] [SECURITY] [\"DNS Server\"] [LOG] [DirectoryLogName]
  • ] <br/>指定要监视的事件日志。有效类型包括:Application、System、Security、DNS server、Log 和 Directory 日志。可以使用通配符 (*),并作为默认值。 <br/>/eid ID <br/>指定事件触发器应监视的特定事件 ID。有效值为任意有效整数。 <br/>/t {ERROR | INFORMATION | WARNING | SUCCESSAUDIT | FAILUREAUDIT} <br/>指定事件触发器应监视的事件类型。有效值包括:ERROR、INFORMATION、WARNING、SUCCESSAUDIT 和 FAILUREAUDIT。不能与 /id 参数或 /so 参数一起使用。 <br/>/so Source <br/>指定事件触发器应监视的事件来源。有效值可为任何字符串。不能与 /id 参数或 /type 参数一起使用。 <br/>/d Description <br/>指定事件触发器的详细说明。有效值可为任何字符串。 <br/>/tk TaskName <br/>指定符合事件触发器条件时要执行的任务/命令/行。 <br/>/? <br/>在命令提示符下显示帮助。 <br/>注释 <br/>同时使用参数 /eid、/t 和 /so 时,对于要创建的事件触发器,日志事件必须与这三个参数指定的条件相匹配。 <br/>示例 <br/>下列示例显示如何使用 eventtriggers /create 命令: </p><p>eventtriggers /create /tr \"Disk Cleanup\" /l system /t error /tk c:\\windows\\system32\\cleanmgr.exe <br/>eventtriggers /create /s srvmain /u maindom\\hiropln /p p@ssW23 /tr \"Low Disk Space\" /eid 4133 /t warning /tk \\\\server\\share\\diskcleanup.cmd <br/>eventtriggers /create /s srvmain /user maindom\\hiropln /p p@ssW23 /tr \"Disk Backup\" /eid 4133 /l system /t error /tk \\\\server\\share\\ntbackup.exe <br/> <font face=\"宋体\">
                    </font></p><p align=\"left\"><font face=\"宋体\"></font></p><p><font face=\"Verdana\">其实这样看来也不容易理解,我以事件日志的系统日志中关于ISA Server 2004防火墙服务停止的记录,给大家讲解一下这个参数:</font><font face=\"宋体\">
                    </font></p><p align=\"center\"><font face=\"宋体\"></font><img src=\"attachments/dvbbs/2006-10/200610820571527341.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571527341.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /></p><p align=\"left\"><font face=\"Verdana\"><br/>从这个图,我们可以获得以下信息: <br/>要监视的日志(/l)是system ,事件ID是7036,/t 是information。其它的根据你的需要来。</font>
            </p><p align=\"left\"><font face=\"Verdana\">再看看另外一个,应用程序日志中关于ISA Server 2004防火墙服务正常停止的日志:</font>
            </p><p align=\"center\"><img src=\"attachments/dvbbs/2006-10/200610820571573297.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571573297.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /></p><p align=\"left\"><font face=\"Verdana\"><br/>从这个图,我们获得的信息更多: <br/>/l 是application,/eid 是14182,/t 是information,/so 是“Microsoft Firewall”。</font>
            </p><p align=\"left\"><font face=\"Verdana\"><br/>在设置这个事件触发的时候,如果你的匹配条件越精确,那么这个触发器的作用越明显,而且对系统的消耗越小。但是你一定要对你设置的触发器进行测试,有的时候,可能不会产生和你设置的触发器匹配的日志。 <br/>如上面的第二个日志,ISA Server 2004正常停止的日志,只有在你手动停止ISA Server 2004服务的时候才会产品,如果ISA Server 2004异常停止,那么是不会产生这个日志的。</font>
            </p><p align=\"left\"><font face=\"Verdana\"><br/>经过我多次的试验,使用第一个日志来作为触发是比较好的,只要ISA Server 2004服务停止,那么就会产生这个日志。但是用这个日志来触发也有个bug,因为只要是服务停止或者启动都会触发,不过正常运行的情况下,一般不会有多少服务停止的情况,而且在服务启动的时候,就算你执行启动服务是没有效果的。我现在因为没有出现ISA Server 2004异常停止,找不到对应的日志信息,只有用这个了。 <p>然后再说说如何在命令行来控制ISA Server 2004。这个时候需要使用net命令来控制ISA Server 2004的服务。 <br/>ISA Server 2004的服务有四个,分别是Microsoft Firewall(fwsrv)、Microsoft ISA Server Control(isactrl)、Microsoft ISA Server Storage(isastg)和Microsoft ISA Server Job Seheduler(isasched)。其中只有fwsrv和isactrl是核心服务。不过根据长久的实践经验,只有fwsrv服务才会出问题。只需要设置启动fwsrv服务就是了,命令行就是 net start fwsrv。你可以直接在/tk 参数后面直接这样写,不过我通常是写个批处理,这样方便修改。<font face=\"宋体\">
                                    </font></p></font></p><p>然后再说说如何在命令行来控制ISA Server 2004。这个时候需要使用net命令来控制ISA Server 2004的服务。 <br/>ISA Server 2004的服务有四个,分别是Microsoft Firewall(fwsrv)、Microsoft ISA Server Control(isactrl)、Microsoft ISA Server Storage(isastg)和Microsoft ISA Server Job Seheduler(isasched)。其中只有fwsrv和isactrl是核心服务。不过根据长久的实践经验,只有fwsrv服务才会出问题。只需要设置启动fwsrv服务就是了,命令行就是 net start fwsrv。你可以直接在/tk 参数后面直接这样写,不过我通常是写个批处理,这样方便修改。<font face=\"宋体\">
                    </font></p><p align=\"center\"><font face=\"宋体\"></font><img src=\"attachments/dvbbs/2006-10/200610820571514213.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571514213.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/></p><p align=\"left\">  </p><p align=\"left\"><font face=\"Verdana\">根据第一个日志,完整的建立触发器的命令是:</font>
            </p><p align=\"left\"><font face=\"Verdana\">eventtriggers /create /tr \"Start ISA Server 2004\" /l system /eid 7036 /tk e:\\startisa.cmd</font>
            </p><p align=\"left\"><font face=\"Verdana\">startisa.cmd是我写的一个批处理文件,里面只有一行内容:</font>
            </p><p align=\"left\"><font face=\"Verdana\">C:\\WINDOWS\\system32\\net.exe start fwsrv</font>
            </p><p align=\"left\"><font face=\"Verdana\"><br/>用户和密码我没有写出来,你可以使用/u和/p参数来添加,如果不写出来,默认会以当前用户身份运行,等下建立时会提示你输入密码,不过只有一次输入的机会,这个时候就要注意输入密码是否正确了。 <br/>建立好后,你可以使用eventtriggers /query /v来察看,如下图:</font>
            </p><p align=\"center\"><img src=\"attachments/dvbbs/2006-10/200610820571549782.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571549782.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/></p><p align=\"left\"><font face=\"Verdana\"><br/>其实这个触发器是任务计划中的一种特殊应用,所以,你需要启动计划任务服务。</font>
            </p><p align=\"center\"><img src=\"attachments/dvbbs/2006-10/200610820571575271.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571575271.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /></p><p align=\"left\"><font face=\"Verdana\"><br/>不要去修改它的任何地方,除了运行的用户和密码。</font>
            </p><p align=\"left\"><font face=\"Verdana\">这个时候,你的触发器就建立好了。不过建议你测试一下,你可以停止一个不必要的服务,这个时候,会触发这个触发器,然后就会跳出一个cmd窗口,运行C:\\WINDOWS\\system32\\net.exe start fwsrv。</font>
            </p><p align=\"left\"><font face=\"Verdana\">如果没有运行也不必紧张,出现问题的最大可能是没有匹配条件或者运行账户的密码输入有误。如果eventtriggers执行事件失败,它会在%systemroot%\\system32\\wbem\\logs 目录中创建一个名为 cmdTriggerConsumer.log 的日志文件,在这个日志信息的最后,就是执行事件触发的信息。你可以根据它的信息检查一下,或者重建一个触发器。</font><br/></p><p align=\"left\"><font face=\"Verdana\">不过当ISA Server 2004出现问题的时候,就算Windows server 2003的稳定性再好,也会耗用一部分系统资源的,就算重新启动ISA Server 2004的服务,也会造成系统的不稳定。所以可能多重启几次就不能启动了。像这种故障恢复的方法,毕竟只是一种投机取巧的方法而已。这点说说我对服务器配置的看法,不要在服务器上安装过多的软件,根据你的情况,只装你真正需要的;另外,请及时打系统补丁和更新杀毒软件,最好有防火墙(ISA Server 2004就是一个很完美的防火墙)。不过就算你把你的服务器配置的很完美,始终不可能做到永远不出现问题。作为一个优秀的网管,你需要随时监控你的服务器,当出现故障时进行及时的恢复。如果你的ISA Server 2004出现了问题,就算当时通过eventtriggers进行了恢复,也建议你在没有用户或者用户很少的时候重启一下服务器,这个时候,服务器才是最优化的。</font>
            </p><p align=\"left\"><font face=\"Verdana\">使用KWF的朋友,也可以通过同样的办法来自动启动KWF。道理是一样的,分析事件日志就可以了。</font>
            </p><p align=\"left\"><font face=\"Verdana\">eventtriggers的功能还很弱,只能通过简单的事件来进行触发。世界级的自动控制软件有两个:Unisyn Software的AutoMate Professional和Neowise的RoboTask,这两个软件自动控制功能的强大,只能用恐怖来形容,当然,复杂程度还是比较高的。</font>
            </p><p align=\"center\"><img src=\"attachments/dvbbs/2006-10/200610820571559293.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571559293.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/><font face=\"Verdana\">Automate中的触发器多达几十种</font>
            </p><p align=\"center\"><font face=\"Verdana\"></font><img src=\"attachments/dvbbs/2006-10/200610820571546739.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571546739.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /></p><p align=\"center\"><font face=\"Verdana\">触发后的动作也有几十种</font>
            </p><p align=\"center\"><font face=\"Verdana\"></font><img src=\"attachments/dvbbs/2006-10/200610820571564640.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571564640.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/><img src=\"attachments/dvbbs/2006-10/200610820571534839.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571534839.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/><font face=\"Verdana\">RoboTask的触发事件要少些,而且没有事件日志的监视</font>
            </p><p align=\"center\"><font face=\"Verdana\"></font><img src=\"attachments/dvbbs/2006-10/200610820571576437.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820571576437.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/><font face=\"Verdana\">但是动作就多种多样了,让它半夜起来给你刻光盘:)</font>
            </p><p align=\"center\"><font face=\"Verdana\"></font></p><p align=\"center\"><img src=\"attachments/dvbbs/2006-10/200610820572672352.jpg\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\\\'hand\\\'; this.alt=\\\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\\\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\\\'attachments/dvbbs/2006-10/200610820572672352.jpg\\\');}\" onmousewheel=\"return imgzoom(this);\" alt=\"\" /><br/><br/></p>
  • JxUmf1W1.jpg
    SMiDfuYd.jpg
    6r7TnfvW.jpg
    2QjEY4js.jpg
    30a0SOR8.jpg
    QqIxFa3M.jpg
    eUFNr91v.jpg
    dzrx61RH.jpg
    a6g3jD1W.jpg
    0RbvJVUr.jpg
    avXx4qdC.jpg
    您需要登录后才可以回帖 登录 | 成为会员

    本版积分规则

    QQ|手机版|小黑屋|网站帮助|职业IT人-IT人生活圈 ( 粤ICP备12053935号-1 )|网站地图
    本站文章版权归原发布者及原出处所有。内容为作者个人观点,并不代表本站赞同其观点和对其真实性负责,本站只提供参考并不构成任何投资及应用建议。本站是信息平台,网站上部分文章为转载,并不用于任何商业目的,我们已经尽可能的对作者和来源进行了通告,但是能力有限或疏忽造成漏登,请及时联系我们,我们将根据著作权人的要求立即更正或者删除有关内容。

    GMT+8, 2024-5-7 02:57 , Processed in 0.154977 second(s), 23 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表