MS IIS Application Pool

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: MS IIS Application Pool

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: MS IIS Application Pool

Post 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
Nagios XI 5.8.1
https://outsideit.net
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: MS IIS Application Pool

Post 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.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: MS IIS Application Pool

Post 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.
Former Nagios Employee
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: MS IIS Application Pool

Post 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
Former Nagios employee
https://www.mcapra.com/
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: MS IIS Application Pool

Post 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.
Nagios XI 5.8.1
https://outsideit.net
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: MS IIS Application Pool

Post 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?
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: MS IIS Application Pool

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: MS IIS Application Pool

Post 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
Nagios XI 5.8.1
https://outsideit.net
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: MS IIS Application Pool

Post by mcapra »

Thanks for the assistance Willem!
Former Nagios employee
https://www.mcapra.com/
Locked