彩神排列三_神彩排列三官方

IIS与ApplicationPool重启检测自动化解决方案

时间:2019-12-24 19:10:55 出处:彩神排列三_神彩排列三官方

Write-Host "-----------------------"

}else{

感谢Lardy 哥给予的支持;

}else{

$global:W3WPStartTime=$global:W3WPSProcesses[$j].StartTime

}else{

        $name=$_.name

if($global:i -ne 0){

end{

Write-Host "Through the analysis from 'HotCheck':"

$global:NewOrOldProcess=0

Write-Host "Since there're no 'Hotfix' updated, we don't need to care about whether the IIS has been reset yet."

Write-Host "IIS has been reset after the 'Hotfix' updated."

$global:IISLogs|IISCK

        New-Object psobject | Add-Member -MemberType noteproperty -PassThru Name $name |

$global:Old=$global:Old+1

if($global:HotfixLog -is [array]){

            Add-Member -MemberType noteproperty -PassThru AppPoolID $cmd |

Write-Host "IIS hasn't been reset after the 'Hotfix' updated."

#将IISLogs放进过滤器进行判断

Write-Host "Through the analysis from 'HotCheck':"

if($global:W3WPSProcesses -is [array]){

}else{

Write-Host "No application pool has been reset or new created after the 'Hotfix' updated."

$global:IndexOfEnd=$global:nameofthepool.indexof('"')

Get-Process -Name w3wp -ErrorAction SilentlyContinue|CheckPool

}

}

$global:IndexOfEnd=$global:nameofthepool.indexof('"')

$global:Old=$global:Old+1

$global:HotfixTime=$global:HotfixLog[0].TimeWritten

        $procid = $_.ProcessId

}

}

Write-Host "The application pool [ $global:shortNameOfThePool ] has not reset after the 'Hotfix' updated."

filter IISCK{

#将会有什么都有的w3wp程序运行,取最新的那个。

if($global:New -eq $global:Old){

Write-Host "Not all the application pool(s) has been reset or new created after the 'Hotfix' updated."

$global:W3WPStartTime=0

if($global:p -eq 0){

if($_.starttime -gt $global:HotfixTime){

if($_){

function global:get-apppools{

begin{

}

$global:p=0

感谢过程中得到的萌萌姐,Di Sun,Xue Pan在测试上的帮助;

process{

经历了一段时间的研究与学习,我终于完成了你你你这个为检查打Hotfix以前agent端Application/IIS算是重启过的自动化处理方案,怎么让通过了几轮针对性的测试。将会我们 在使用过程中遇到了什么的什么的问题 请联系我lync:tianyou lan

}

}

Write-Host "-----------------------"

if($global:NewOrOldProcess -ne 0){

if($global:W3WPSProcesses[$j].StartTime -gt $global:W3WPStartTime){

}

#判断IIS算是在打Hotfix以前重启过

$global:New=0

$global:HotfixLog=Get-EventLog avepoint|Where-Object {$_.Category -like "*Update Manager*"}

Hotfix Automatic Check,简称Hot Check,"火柴"。

Write-Host "All the application pool(s) has been reset or new created after the 'Hotfix' updated."

    [regex]$pattern="-ap ""(.+)"""

    gwmi win32_process -filter 'name="w3wp.exe"' | % {

$global:nameofthepool=(global:get-apppools|Where-Object {$_.pid -eq  $global:process.id}).apppoolid

另:感谢DL的Dora Liu强力打包的俩个针对性测试patch和Zhenpeng Liu的各种支持。

}

if($global:New -lt $global:Old){

if($global:p -ne 0){

#获取w3wp程序运行所对应的Application pool(你你你这个函数是在网上搜的)

        $cmd = $pattern.Match($_.commandline).Groups[1].Value

1.右键tool,run as admin;都要联系我​:Tianyou.Lan

}

下载地址:

$global:p=$global:p+1

#最新W3Wp程序运行开启的时间

Write-Host "Through the analysis from 'HotCheck':"

            Add-Member -MemberType noteproperty -PassThru PID $procid

if($global:HotfixTime){

if($_.TimeWritten -gt $global:HotfixTime){

}

}else{

}

$global:New=$global:New+1

}

}

$global:process=$_

$global:HotfixTime=$global:HotfixLog.TimeWritten

for($j=0;$j -lt $global:W3WPSProcesses.length;$j++){

}

}

Write-Host "The application pool [ $global:shortNameOfThePool ] has reset or the w3wp process of it is new created after the 'Hotfix' updated."

$global:nameofthepool=(global:get-apppools|Where-Object {$_.pid -eq  $global:process.id}).apppoolid

#最近一有有俩个 多Hotfix开始英文英文的时间

if($global:i -eq 0){

$global:shortNameOfThePool=$global:nameofthepool.substring(0,$global:IndexOfEnd)

}

#filter,判断每四根日志,总的结果输出为i或p。

2.自动检测完成。

$global:i=0

if($_){

$global:shortNameOfThePool=$global:nameofthepool.substring(0,$global:IndexOfEnd)

}

#0位为最新的Hotfix时间

}

$global:Old=0

$global:W3WPStartTime=$global:W3WPSProcesses.StartTime

#只一有有俩个 多多w3wp程序运行时,获取到w3wp程序运行的starttime。

$global:i=$global:i+1

}

经历了:

#i和p都是IISReset标记,0代表那么重启过,怎么让代表重启过。i代表那么Hotfix,p代表有Hotfix。

    }

#判断结果

$global:IISLogs=Get-EventLog system| where-object {$_.source -like "*IIS*"}

$global:W3WPSProcesses=Get-Process -Name w3wp -ErrorAction SilentlyContinue

$global:process=$_

Read-Host "Press any key to quit"

function CheckPool{

}

}

$global:NewOrOldProcess=$global:NewOrOldProcess+1

#$global:IISLogs=Get-EventLog system -After ((get-date).addhours(-5))| where-object {$_.source -like "*IIS*"}

热门

热门标签