Page 2 of 3

Re: IIS sites monitoring

Posted: Thu Dec 08, 2016 4:29 pm
by dwhitfield
What version of NSClient are you using?

Also, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the Download Profile (not Show Profile) button in the top right corner. If for whatever reason you cannot download the profile, please put the output of Show Profile in the thread (that will at least get us some info).

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

Re: IIS sites monitoring

Posted: Fri Dec 09, 2016 4:54 am
by Naveed
Thanks

I am using the most latest nsclient version, 0.5.0.62

Moreover profile is attached for further review.

Thanks

Re: IIS sites monitoring

Posted: Fri Dec 09, 2016 2:17 pm
by dwhitfield
Naveed wrote:All my windows services are monitoring fine with nrpe on it.

Can someone suggest the way to monitor these services?
Could you clarify this a bit? Are you saying you don't want to run NRPE or that NRPE works, but doesn't do what you want it to do?

Also, you posted a screenshot of the services you want to monitor. Are those literally the only services you want to monitor...or at least a complete list of the ones you have left to monitor? Thanks!

Re: IIS sites monitoring

Posted: Tue Dec 13, 2016 1:27 am
by Naveed
Yes please.

I am using NRPE which is working fine to monitor all my services.
I have added another script to monitor iis sites pool, modifications are made in nsclient.ini file and script is placed in nsclient\scripts directory as well.

My command on nagios server is as follows:

check_nrpe!check_iis_apppool_state!-a '-CheckType AppPool RealTimeService'!!!!!!

I am trying to check the state of RealTimeService pool, whether it is running or stopped.

But after all suggestions on this thread, I am getting service time checkout after 30 seconds error message.

Do let me know if need further clarification on it?

Thanks

Re: IIS sites monitoring

Posted: Tue Dec 13, 2016 5:38 pm
by tgriep
Couple of things you can try, run the script from the IIS server and see how long it takes to run, it if is around 30 seconds, then add -t 59 to the check_nrpe command on the Nagios server it increase the timeout.
If this doesn't work, can you post the nsclient.ini and the nsclient.log file from the IIS server.

Re: IIS sites monitoring

Posted: Wed Dec 14, 2016 8:29 am
by Naveed
script does not work for us on iis server..

I have attached output, nsclient.ini and log files for further analysis.

Thanks

Re: IIS sites monitoring

Posted: Wed Dec 14, 2016 12:30 pm
by tgriep
It looks like the command is defined incorrectly in the nsclient.ini file and that is causing the timeout.
Try editing your command in the nsclient.ini file and change it from

Code: Select all

check_iis_apppool_state=wscript.exe //nologo //T:60 "C:\Program Files\NSClient++\scripts\\check_iis.ps1" $ARG1$
to

Code: Select all

check_iis_apppool_state= cmd /c echo \scripts\check_iis.ps1 $ARG1$; exit $LastExitCode | powershell.exe -ExecutionPolicy Bypass -command -
Save the nsclient.ini file and restart the nsclient++ service on the windows host and see if the check passes on the Nagios server.

Re: IIS sites monitoring

Posted: Thu Dec 15, 2016 2:25 am
by Naveed
Thank you for help

Suggested change is made but did not get desired results yet.

log files entries are:

2016-12-14 23:05:34: error:c:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:396: Failed to find wrapping for type: exe
2016-12-14 23:09:28: error:c:\source\nscp\modules\CheckExternalScripts\CheckExternalScripts.cpp:396: Failed to find wrapping for type: exe

Re: IIS sites monitoring

Posted: Thu Dec 15, 2016 12:01 pm
by Naveed
Command in nslient.ini

check_iis= cmd /c echo scripts\check_iis.ps1 $ARG1$; exit $LastExitCode | powershell.exe -ExecutionPolicy Bypass -command -

Command in nagios:
$USER1$/check_nrpe -H $ARG1$ -t 30 -c $ARG2$ -a '-CheckType $ARG3$'

ARG1=IP address of server
ARG2=check_iis (Check command)
ARG3= Sites/AppPool

URL for above command:
https://exchange.nagios.org/directory/P ... ol/details

Error message is attached for further analysis.

Re: IIS sites monitoring

Posted: Thu Dec 15, 2016 2:20 pm
by rkennedy
I don't think your $ARG3$ is proper, the best place would be to test over the command line though. See below -

Code: Select all

So this command also work:
./check_nrpe -H IIS_IP_Address -t 30 -c check_iis -a 'Sites 0 sites01,oldsite'
This command mean:
check 1: iis sites 2: no debug, 3: exclude sites01,oldsite