IIS App Pool monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

Yes, I would assume that's the reason. The pool is started, and ready to accept connections, but there's no one to serve right now, so there are no processes taking up CPU and memory.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: IIS App Pool monitoring

Post by rferebee »

Strange, when I attempt to create the same service check for a different Application Pool it tells me this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.xxx.xxx.xxx -p 5666 -t 60 -c check_ms_iis_application_pool -a '-A CASH'
CRITICAL: The term 'check_ms_iis_application_pool' 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.
I don't understand that at all.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

That's a Powershell error that's being returned. If you try running that same command, except against the PrePaid application pool, does it still return normally?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: IIS App Pool monitoring

Post by rferebee »

Yes, it's working fine for Prepaid.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

Can you manually invoke the Powershell script against that application pool?

And just to confirm, you are not creating a new NRPE command definition per app pool, correct? You just have the one command definition, and then specify the app pool.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: IIS App Pool monitoring

Post by rferebee »

I don't know how to manually invoke the script via Powershell, I don't know what the syntax would be to call it and check the Application Pool correctly.

Yes, we have one command definition and we are attempting to specifying different Application Pools in the service check.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

Okay, just hop on to the Windows machine, open up Powershell, and navigate to NSClient's scripts directory (usually C:\Program Files\NSClient++\scripts\). Then run this,

Code: Select all

.\check_ms_iis_application_pool.ps1 -A CASH
And let's see what it returns.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: IIS App Pool monitoring

Post by rferebee »

This is what is happening:

Code: Select all

PS C:\WINDOWS\system32> cd /
PS C:\> cd '.\Program Files\'
PS C:\Program Files> cd .\NSClient++\
PS C:\Program Files\NSClient++> cd .\scripts\
PS C:\Program Files\NSClient++\scripts> .\check_ms_iis_application_pool.ps1 -A CASH
CRITICAL: The term 'check_ms_iis_application_pool' 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 aga
in.

Suggestion [3,General]: The command check_ms_iis_application_pool was not found, but does exist in the current location.
 Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type
: ".\check_ms_iis_application_pool". See "get-help about_Command_Precedence" for more details.
PS C:\Program Files\NSClient++\scripts> ".\check_ms_iis_application_pool" -A CASH
At line:1 char:35
+ ".\check_ms_iis_application_pool" -A CASH
+                                   ~~
Unexpected token '-A' in expression or statement.
At line:1 char:38
+ ".\check_ms_iis_application_pool" -A CASH
+                                      ~~~~
Unexpected token 'CASH' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

Okay, so this is really interesting. It's actually running the script. We're getting "CRITICAL: " which is the script returning a message for Nagios to report back on. It's giving the name of the script because of the Catch at line 356. I'm going to have to come back to this on Monday with some additional testing using same-named application pools on my test environment. Then I can run the script through Powershell ISE and use the debugger to see what the heck is going on.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: IIS App Pool monitoring

Post by mbellerue »

Alright, I created two application pools on my Server 2016 environment, and I was able to reproduce this when I ran the Powershell script like so,

Code: Select all

".\check_ms_iis_application_pool.ps1" -A CASH
And that also failed when I ran against PrePaid.

However, it works when I run it like this,

Code: Select all

.\check_ms_iis_application_pool.ps1 -A CASH
The only difference being one doesn't have the script name in quotes. Can you try running the Powershell command again without the quotes? Also run it against both PrePaid and CASH. And if you could send in a fresh copy of your nsclient.ini file, that would be great. I'd like to see if there's something in that configuration that's adding quotes to the script name.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked