Check_ms_iis_application_pool: "Cannot bind argument to..."

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Check_ms_iis_application_pool: "Cannot bind argument to..."

Post by jsharris »

I am using the check_ms_iis_application_pool plugin created by WillemDH (https://outsideit.net/check-ms-iis-application-pool/) but am running into the error: "Cannot bind argument to parameter 'Path' because it is null." I am trying to find a list of necessary parameters but the only one I have seen so far is the name of the application pool to monitor (-A <AppPoolName>). Running the script directly on the server results in the same message.

Does anyone know what the correct configuration here should be?

Running Nagios XI 5.2.2
Web server is Win2008R2.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by WillemDH »

I have this working for me:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H iisserver -p 5666 -t 180 -c check_ms_iis_application_pool -a '-A "SharePoint - projectenqa" '
Where "SharePoint - projectenqa" is the name of my application pool. You could try change SilentlyContinue to Continue for debug and verbose preference. and try debug if the above still doesnt work for you.

Hope it helps..

Willem
Nagios XI 5.8.1
https://outsideit.net
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by jsharris »

Here is mine:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nrpe -H tpwebpr1 -p 5666 -t 60 -c check_ms_iis_application_pool -a '-A Compliance'
OUTPUT: CRITICAL: Cannot bind argument to parameter 'Path' because it is null.
I tried it as you do with " around the app pool and it came back as this:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nrpe -H tpwebpr1 -p 5666 -t 60 -c check_ms_iis_application_pool -a '-A \"Compliance\"'
OUTPUT: Exception processing request: Request command contained illegal metachars!
Are there alterations made to the script you are running which specifies a path for something which is not included in the version available for download? Maybe something I am supposed to configure in the script as opposed to in the service check? Also, where would I make the other changes you suggested (debug and SilentlyContinue)?
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by WillemDH »

What is the version of your script? And what is the iis version? You should find the debug and verbose preferences at the top of the ps script..
Nagios XI 5.8.1
https://outsideit.net
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by jsharris »

Script version: v0.05.160609
IIS version: 7.5

I saw on the info page you had only tested on Win2012R2 but came across another thread on this forum in which someone was attempting to use this to monitor a Win2003 server (presumably running IIS6). Based on the information being returned it seems the script is trying to access a file location but does not have the necessary information to do so (the 'Path' parameter).
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by jsharris »

Changing the debug settings to 'Continue' results in display of all of the cmdlets, functions, and aliases being imported followed by the same "CRITICAL: Cannot bind argument to parameter 'Path' because it is null." error.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by WillemDH »

You will have to use breaks in PowerGUI or Powershell ISE to debug this and know where things go wrong. What Windows version are you using this?
Nagios XI 5.8.1
https://outsideit.net
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by jsharris »

Windows 2008 R2.

I am thinking I may just be SOL on this one. I tried running it on another server and, while I got an entirely different error there, it did return information about the app pool there.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by ssax »

In addition to WillemDH's post, [;ease change the debug settings to Continue, open up the powershell console as an admin, and run these commands:

Code: Select all

cd "c:\program files\nsclient++\scripts"
.\check_ms_iis_application_pool.ps1 -A Compliance
Send the entire output so we can see where in the code it's failing.

Thank you
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: Check_ms_iis_application_pool: "Cannot bind argument to.

Post by jsharris »

Output is attached.
You do not have the required permissions to view the files attached to this post.
Locked