Page 1 of 1

Having issues getting script to run via nsclient++

Posted: Wed Nov 16, 2016 10:25 am
by snapon_admin
Using NSClient++ to try and run a script via NRPE and getting the following error:

Code: Select all

C:\Program Files\NSClient++\scripts\check_iis_apppool_state.vbs(25, 1) (null): 0x8004100E
Any ideas on why this isn't working? We do have the following settings in the nsclient ini file:

Code: Select all

[/settings/external scripts]
allow arguments = 1
allow nasty characters = 1
timeout = 90

[/settings/external scripts/wrapped scripts]
check_iis_apppool_state=cscript.exe scripts\\check_iis_apppool_state.vbs $ARG1$

[/settings/external scripts/wrappings]
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
exe = cmd /c %SCRIPT% %ARGS%

Re: Having issues getting script to run via nsclient++

Posted: Wed Nov 16, 2016 11:10 am
by rkennedy
I have a feeling it has something to do with the variables passed not being correct, or something with permissions / WMI - I just tested on my end, and no luck either. (though I do not have any app pools on this machine / IIS)

This link seems to indicate a similar error too - http://forums.nsclient.org/t/how-to-get ... -iis7/2741 - I would reach out to the author of the plugin.

Re: Having issues getting script to run via nsclient++

Posted: Wed Nov 16, 2016 1:40 pm
by snapon_admin
Ok we got it working but now the ouput looks like this:

Code: Select all

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.



OK! MSExchangeAutodiscoverAppPool: STARTED
So the main line of the out put on all of them is the usless copyright info at the top there. I looked a tthis particular script and it doesn't appear to be apart of that Do you know how I'd go about making the output just be the bottom part, which is the output from this script?

Re: Having issues getting script to run via nsclient++

Posted: Wed Nov 16, 2016 4:09 pm
by avandemore
Again you should ask the author of the plugin, but here is some information:

http://stackoverflow.com/questions/1615 ... -of-a-file

Re: Having issues getting script to run via nsclient++

Posted: Thu Nov 17, 2016 4:55 pm
by snapon_admin
There is already a solution posted on that plugin's page that I tried and did not work. I also found that same link you linked and tried that, which also did not work.

Re: Having issues getting script to run via nsclient++

Posted: Thu Nov 17, 2016 5:18 pm
by avandemore
Works here:
cscript_logo.png