Hi ,
I have configured to monitor Scheduled task for a windows server , but the output expected is not proper .
I have followed this link ( https://support.nagios.com/kb/article/s ... s-788.html ) to set up the monitoring .
Im getting the same output even when the task is completed . Ill share the screenshot of the output im getting .
Command View :
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
$ARG1$ : check_tasksched
$ARG2$ : -a "filter=title eq 'PDI - Weekly Nexpose Metrics'" 'critical=most_recent_run_time < -30m' empty-state=critical 'empty-syntax=CRITICAL: PDI - Weekly Nexpose Metrics NOT found' 'detail-syntax=${title} is stale more than -30m'
Please let me know if there is any other filter that needs to be added in the command line .
Im also attaching nsclient file .
Windows Scheduled task monitoring
Windows Scheduled task monitoring
You do not have the required permissions to view the files attached to this post.
Re: Windows Scheduled task monitoring
Are you sure the job is running? The screenshot from the Windows system shows the last run time was 8/10 which is what is returned by the check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Windows Scheduled task monitoring
Hi ,
The task is completed and instead of showing a ok status it is in critical state .
Im attaching the screenshot below .
[nagios@abc ~]$ /usr/local/nagios/libexec/check_nrpe -H 172.**.***.*** -t 30 -c check_tasksched -a "filter=title eq 'PDI - Weekly Nexpose Metrics'" 'critical=most_recent_run_time < -30m' empty-state=critical 'empty-syntax=CRITICAL: PDI - Weekly Nexpose Metrics NOT found' 'detail-syntax=${title} is stale more than -30m'
CRITICAL: PDI - Weekly Nexpose Metrics is stale more than -30m|'PDI - Weekly Nexpose Metrics_exit_code'=1;0;0 'PDI - Weekly Nexpose Metrics_most_recent_run_time'=1601991437;0;1602234619
The task is completed and instead of showing a ok status it is in critical state .
Im attaching the screenshot below .
[nagios@abc ~]$ /usr/local/nagios/libexec/check_nrpe -H 172.**.***.*** -t 30 -c check_tasksched -a "filter=title eq 'PDI - Weekly Nexpose Metrics'" 'critical=most_recent_run_time < -30m' empty-state=critical 'empty-syntax=CRITICAL: PDI - Weekly Nexpose Metrics NOT found' 'detail-syntax=${title} is stale more than -30m'
CRITICAL: PDI - Weekly Nexpose Metrics is stale more than -30m|'PDI - Weekly Nexpose Metrics_exit_code'=1;0;0 'PDI - Weekly Nexpose Metrics_most_recent_run_time'=1601991437;0;1602234619
You do not have the required permissions to view the files attached to this post.
Re: Windows Scheduled task monitoring
You could also try https://github.com/OutsideIT/check_ms_win_tasks
It might produce better results (with the right parameters)
It might produce better results (with the right parameters)
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Windows Scheduled task monitoring
What time was the check done at? The -30 would check to see if the job was run withing the last 30 minutes. Try increasing it. For example, -1440m to see if it was run within the last day.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Windows Scheduled task monitoring
Thanks for the alternative @WillemDH!
Your command is checking if it hasn't been run in the last 30 minutes, it hasn't so the output is valid.
You would need to change it to something like this:
Your command is checking if it hasn't been run in the last 30 minutes, it hasn't so the output is valid.
You would need to change it to something like this:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H **.***.*** -t 30 -c check_tasksched -a "filter=title eq 'PDI - Weekly Nexpose Metrics'" 'critical=exit_code != 0' empty-state=critical 'empty-syntax=CRITICAL: PDI - Weekly Nexpose Metrics NOT found' 'detail-syntax=${title}: exit code: ${exit_code}'Re: Windows Scheduled task monitoring
Hi ,
Thanks to both of you for the information . Both the methods are amazing . I was able to get the output
Thanks to both of you for the information . Both the methods are amazing . I was able to get the output
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Windows Scheduled task monitoring
Great!deek wrote:Hi ,
Thanks to both of you for the information . Both the methods are amazing . I was able to get the output![]()
Locking thread