Hi have done something that may interest you. Let me know if this suits you env and needs if so I can provide you the interpreter.
# Monitor Windows Application Pools state
The alarm condition is to not have “Started” in state field - Valid until Windows Server 2012 - 2016 > Already brings new ways to administrate WebApplicationPools
Get All Pools to iterate later
$AppPools = Get-WebAppPoolState
Prints Check_MK Plugin Header
“<<>>”
Loop for each application pool
ForEach($Item in $AppPools)
{
$Name = ($Item.ItemXPath -Replace ‘(?:.?)name=’’([^’’])(?:.*)’, ‘$1’).Trim()
$Status = ($item.Value).Trim()
Write-Host " $Name $Status"
}