Hello XI Support
Please help with configuring nsclient.ini (attached) for running this plugin:
https://exchange.nagios.org/directory/P ... te/details
We've followed instructions and got check configured, but getting strange response:
Our app pool names got spaces so we've inserted this one, but still no luck:
' for pool names with spaces
numargs = WScript.Arguments.Unnamed.length - 1
for i = 1 to numargs
'WScript.Echo(" " + WScript.Arguments.Unnamed.Item(i))
strArgAppPool = strArgAppPool & " " & WScript.Arguments.Unnamed.Item(i)
next
-------------------------------------------------------------------------------------------------------------------
OK Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
C:\\Program Files\\NSClient++\\scripts\\check_iisv7_apppool_state.vbs(25, 1) (null): 0x8004100E
-
IIS plugin for pool names with spaces troubles
IIS plugin for pool names with spaces troubles
You do not have the required permissions to view the files attached to this post.
Re: IIS plugin for pool names with spaces troubles
For this particular plugin, does your IIS setup include the "IIS Management Scripts and Tools" component?
You might also consider trying this PowerShell script (created by @WillemDH) which I've found to be a much better solution:
https://github.com/willemdh/check_ms_ii ... ation_pool
You might also consider trying this PowerShell script (created by @WillemDH) which I've found to be a much better solution:
https://github.com/willemdh/check_ms_ii ... ation_pool
Code: Select all
PS C:\Program Files\NSClient++\scripts> ./check_ms_iis_application_pool.ps1 -A DefaultAppPool
OK: Application Pool "DefaultAppPool" is Started.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: IIS plugin for pool names with spaces troubles
mcapra wrote:For this particular plugin, does your IIS setup include the "IIS Management Scripts and Tools" component?
You might also consider trying this PowerShell script (created by @WillemDH) which I've found to be a much better solution:
https://github.com/willemdh/check_ms_ii ... ation_pool
Code: Select all
PS C:\Program Files\NSClient++\scripts> ./check_ms_iis_application_pool.ps1 -A DefaultAppPool OK: Application Pool "DefaultAppPool" is Started.
Thank you, how to define this PS1 script in nsclient.ini and as a command ?
Re: IIS plugin for pool names with spaces troubles
Here's how i've configured mine (NSClient++ 0.4.4.19):
Be wary of pre-existing definitions for the scripts/wrappings section.
Executed from the Nagios XI CLI:
Code: Select all
[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
....
[/settings/external scripts/wrapped scripts]
check_ms_iis_application_pool=check_ms_iis_application_pool.ps1 $ARG1$
Executed from the Nagios XI CLI:
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.4.235 -c check_ms_iis_application_pool -a '-A DefaultAppPool'
OK: Application Pool "DefaultAppPool" is Started.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: IIS plugin for pool names with spaces troubles
mcapra wrote:Here's how i've configured mine (NSClient++ 0.4.4.19):
Be wary of pre-existing definitions for the scripts/wrappings section.Code: Select all
[/settings/external scripts/wrappings] ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command - .... [/settings/external scripts/wrapped scripts] check_ms_iis_application_pool=check_ms_iis_application_pool.ps1 $ARG1$
Executed from the Nagios XI CLI:
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.4.235 -c check_ms_iis_application_pool -a '-A DefaultAppPool' OK: Application Pool "DefaultAppPool" is Started.
We are now getting execution of the scripts disabled troubles:
File C:\Program Files\NSClient++\scripts\check_ms_iis_application_pool.ps1 cann
ot be loaded because the execution of scripts is disabled on this system. Pleas
e see "get-help about_signing" for more details.
At line:1 char:43
+ scripts\\\\check_ms_iis_application_pool.ps1 <<<< DefaultAppPool; exit($lastex
itcode)
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Re: IIS plugin for pool names with spaces troubles
You will need to allow the execution of remotely signed scripts on each system.
From powershell:
And type Y to confirm.
From powershell:
Code: Select all
Set-ExecutionPolicy RemoteSignedFormer Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: IIS plugin for pool names with spaces troubles
There is a Powershell section in this KB article which should help:
https://support.nagios.com/kb/article.php?id=528
https://support.nagios.com/kb/article.php?id=528
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: IIS plugin for pool names with spaces troubles
Box293 wrote:There is a Powershell section in this KB article which should help:
https://support.nagios.com/kb/article.php?id=528
Thank you (we've got IIS app pool checks working now / please close)