Did you follow this guide?
Code: Select all
https://outsideit.net/monitoring-iis-application-pools/Code: Select all
Get-ChildItem -Path IIS:\AppPoolsCode: Select all
https://outsideit.net/monitoring-iis-application-pools/Code: Select all
Get-ChildItem -Path IIS:\AppPoolsCode: Select all
PS C:\> C:\Windows\system32\inetsrv\appcmd list apppool
APPPOOL "DefaultAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL "Classic .NET AppPool" (MgdVersion:v2.0,MgdMode:Classic,state:Started)
APPPOOL "WebServices" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL "CASH" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "Collateral" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "Email" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "LGIP" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "Millennium" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "Passwords" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "Prepaid" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "UPSearch" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL "FinancialFitness" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "ASP.NET v4.0" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL "ASP.NET v4.0 Classic" (MgdVersion:v4.0,MgdMode:Classic,state:Started)
APPPOOL "wsSSTrackerMT" (MgdVersion:v4.0,MgdMode:Integrated,state:Started)Code: Select all
PS C:\> Get-ChildItem -Path IIS:\AppPools
Get-ChildItem : Cannot find drive. A drive with the name 'IIS' does not exist.
At line:1 char:14
+ Get-ChildItem <<<< -Path IIS:\AppPools
+ CategoryInfo : ObjectNotFound: (IIS:String) [Get-ChildItem], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Code: Select all
Get-IISAppPoolCode: Select all
Get-IISAppPoolCode: Select all
https://github.com/juangranados/nagios-plugins/blob/master/check_iis.ps1Code: Select all
PS C:\> Get-IISAppPool
The term 'Get-IISAppPool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:15
+ Get-IISAppPool <<<<
+ CategoryInfo : ObjectNotFound: (Get-IISAppPool:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptionCode: Select all
PS C:\Program Files\NSClient++\scripts> powershell ./check_iis.ps1
The term 'Get-WebsiteState' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
k the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:37 char:37
+ $WebsitesRunning = (Get-WebsiteState <<<< | Where-Object { ($_.value -eq "Started") }).Count
+ CategoryInfo : ObjectNotFound: (Get-WebsiteState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'Get-WebAppPoolState' is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:38 char:40
+ $AppPoolsRunning = (Get-WebAppPoolState <<<< | Where-Object { ($_.value -eq "Started") }).Count
+ CategoryInfo : ObjectNotFound: (Get-WebAppPoolState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'Get-WebsiteState' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
k the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:39 char:35
+ $WebsitesTotal = (Get-WebsiteState <<<< ).Count
+ CategoryInfo : ObjectNotFound: (Get-WebsiteState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'Get-WebAppPoolState' is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:40 char:37
+ $AppPoolTotal = (Get-WebAppPoolState <<<< ).Count
+ CategoryInfo : ObjectNotFound: (Get-WebAppPoolState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'Get-WebsiteState' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
k the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:80 char:36
+ $StoppedWebsites = Get-WebsiteState <<<< | Where-Object { ($_.value -ne "Started") } | % { return @{($_.itemxpath -s
plit ("'"))[1]="$($_.value)" } } | % getEnumerator
+ CategoryInfo : ObjectNotFound: (Get-WebsiteState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'Get-WebAppPoolState' is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_iis.ps1:85 char:39
+ $StoppedAppPools = Get-WebAppPoolState <<<< | Where-Object { ($_.value -ne "Started") } | % { return @{($_.itemxpath
-split ("'"))[1]="$($_.value)" } } | % getEnumerator
+ CategoryInfo : ObjectNotFound: (Get-WebAppPoolState:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
OK: All Websites and AppPools Running. C:\Users\ferebeer\Desktop\check_iis_output.txt| WebsitesRunning=;0;0;0; AppPools
Running=;0;0;0;Code: Select all
https://www.microsoft.com/en-us/download/details.aspx?id=15488