Page 2 of 3
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 7:18 am
by jkinning
I tried that and now getting this
Code: Select all
./check_nrpe -H eas3t -t 30 -c check_ms_iis_application_pool -a '-A EasServices'
At C:\Program
Files\NSClient++\scripts\powershell\check_ms_iis_application_pool.ps1:229
char:2
+ }
+ ~
The Try statement is missing its Catch or Finally block.
At C:\Program
Files\NSClient++\scripts\powershell\check_ms_iis_application_pool.ps1:213
char:41
+ Function Invoke-CheckIISApplicationPool {
+ ~
Missing closing '}' in statement block.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingCatchOrFinally
I changed the file extension from ps1 to txt and attached. That is what I currently have.
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 7:46 am
by WillemDH
Hello,
I created this script. Not sure what might be your issue.
If it doesn't find your related w3wp.exe process, try executing
Code: Select all
Get-WmiObject -NameSpace 'root\WebAdministration' -class 'WorkerProcess' | Where-Object {$_.AppPoolName -match $IISStruct.ApplicationPool}
manually and replace $IISStruct.ApplicationPool with the name of your application pool? Are you sure it is running? Try putting start mode in advanced settings on your app pool on AlwyasOn and see if that helps? Maybe setting idle timeout to suspend instead of terminate? If you are not using the app pool, it might shut down..
Grtz
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 8:41 am
by jkinning
I am a Linux guy living in a Windows world right now and some of this is Greek to me. I attempted to just run the command and nothing came back. When I try the Application Pool name I get an error. Checking within IIS Manager the Application Pool is running.
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 10:37 am
by rkennedy
Try this -
Code: Select all
Get-WmiObject -NameSpace 'root\WebAdministration' -class 'WorkerProcess' | Where-Object {$_.AppPoolName -match "EasServices"}
Let us know the output from Powershell.
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 10:44 am
by mcapra
jkinning wrote:I tried that and now getting this
Here is the full script I am running. My environment is running IIS 7.5:
http://pastebin.com/BaDCSnew
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 11:04 am
by WillemDH
I'm using it on 8.x. What version are you on?
Checking within IIS Manager the Application Pool is running.
It does not mean that if the application pool is running it has a corresponding w3wp.exe process. Please check you advanced settings of your application pool. Check idle timeout and Start mode.
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 12:24 pm
by jkinning
Ok, so the Start Mode was onDemand and I changed it to AlwaysRunning. The Idle Time-out (minutes) is set at 900 and the Idle Time-out Action is Terminate.
Once I changed the Start mode to AlwaysRunning I got the correct data again. Is there anything else I should or need to change?
Re: MS IIS Application Pool
Posted: Wed Jun 08, 2016 4:47 pm
by mcapra
Everything @WillemDH suggested makes perfect sense based on what I was observing. I defer to his expertise on this particular case, but things seem functional for my application pool after applying the suggested changes.
Re: MS IIS Application Pool
Posted: Thu Jun 09, 2016 12:04 pm
by WillemDH
Jkinning,
I've released a new version of the plugin, v0.05.160609
https://github.com/willemdh/check_ms_ii ... .05.160609
You can set --AppPoolOnDemand to 1 if you enabled On-Demand start mode, which will force the correct perfdata for your check.
Grtz
Re: MS IIS Application Pool
Posted: Thu Jun 09, 2016 4:35 pm
by mcapra
Thanks for the assistance Willem!