Having issues getting script to run via nsclient++

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Having issues getting script to run via nsclient++

Post 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%
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

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

Post 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?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

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

Post by avandemore »

Again you should ask the author of the plugin, but here is some information:

http://stackoverflow.com/questions/1615 ... -of-a-file
Previous Nagios employee
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

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

Post 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.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

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

Post by avandemore »

Works here:
cscript_logo.png
You do not have the required permissions to view the files attached to this post.
Previous Nagios employee
Locked