Page 1 of 2

how to configure & Monitor Windows Schedule Tasks

Posted: Sun Jun 04, 2017 6:54 am
by cyient
Hi ,

I want to configure & Monitor Windows schedule Tasks in Nagios XI 5.4.3 tool .Please share the configuration procedure and suitable plugins .

Thanks in Advance

Sridhar

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Mon Jun 05, 2017 8:06 am
by mcapra
@WillemDH did a pretty good write-up of this topic:
https://outsideit.net/monitoring-window ... led-tasks/

You will need to leverage NSClient++ as the agent on the Windows-side of things for this. More on that topic here:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

The above documentation won't work for check_nrpe though. This documentation covers enabling the NRPE server on your NSClient++ setup:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Mon Jun 05, 2017 10:54 am
by avandemore
Thanks @mcapra!
@cyient, does that answer your question?

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Wed Jun 07, 2017 2:09 am
by cyient
Hi ,

As per your given url download powershell script check_ms_win_tasks.ps1 , installed NSClient++ agent in windows server 2008 R2 and configured NRPE settings also .

We configured command for checking schedule tasks

check_ms_win_tasks : $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -t 30 -c $ARG1$ $ARG2$ $ARG3$ $ARG4$

But we got some error message , please find the attached documents for your reference and give the proper solution for that .I think In our domain scripts are not running so , please provide any plugin for monitoring windows tasks.

Thanks in advance

Regards
Sridhar

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Wed Jun 07, 2017 8:24 am
by mcapra
You will need to change the Powershell settings on the remote machine to allow the script to run. These articles should help:
https://technet.microsoft.com/en-us/lib ... 76961.aspx
https://superuser.com/questions/106360/ ... ll-scripts

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Wed Jun 07, 2017 2:07 pm
by dwhitfield
Thanks for the assist @mcapra!

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Mon Jun 12, 2017 4:37 am
by cyient
HI Team,

We have followed below steps enabled the script to run on Remote machine. We could see the Uptime,Tasks,Ping and other services but we could not find the number of task Running,Succeeded,Failure of the Task. When we opened the task column we could not see the number of task Running,Succeeded,Failure for reference please find the attached screenshot1.

Regards,
Sridhar

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Mon Jun 12, 2017 9:53 am
by dwhitfield
It looks like you will need to modify the output of the script.

As a test, what's the output of the powershell script when you run it on Windows?

As far as editing the script, if you don't know Powershell, you could write your script in any language you have access to on Windows. Certainly there are community members that may be able to help you modify your script, but as a matter of policy, the support team doesn't write custom scripts.

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Tue Jun 13, 2017 4:52 am
by cyient
Hi ,

As per your request we have run powershell script in windows system , please find the attachment for output figure 1 .

and also attached documents are Powershell script and nsclient.ini .

Please check the files and give the correct configuration of nsclient.ini file for excute the powershell script in Nagios monitoring tool .


Thanking in Advance
Sridhar

Re: how to configure & Monitor Windows Schedule Tasks

Posted: Tue Jun 13, 2017 4:33 pm
by tgriep
I looks like the check command that is defined in XI is missing the NRPE command and it is just doing the version check.
Edit the service and add the following to the $ARG1$ field and see if that fixes the issue.

Code: Select all

check_ms_win_tasks
and add this to $ARG2$

Code: Select all

a '-H localhost -IF "\\"'