Monitor Task Scheduler task

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Monitor Task Scheduler task

Post by aajewole »

Any way to have nagios monitor a task, if it fails, restart or email?
dwasswa

Re: Monitor Task Scheduler task

Post by dwasswa »

Yes,it can..you can configure nagios to monitor it as a service through service definition...https://assets.nagios.com/downloads/nag ... .html#host...

example:

Code: Select all

define service{
	host_name		linux-server
	service_description	check-disk-sda1
	check_command		check-disk!/dev/sda1
	max_check_attempts	5
	check_interval	5
	retry_interval	3
	check_period		24x7
	notification_interval	30
	notification_period	24x7
	notification_options	w,c,r
	contact_groups		linux-admins
   }
Then you can set up an event handler to perform a specific action command or script when a host or service state changes in your case,the event handler would 'restart or email'. Follow the link below..
https://assets.nagios.com/downloads/nag ... dlers.html
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitor Task Scheduler task

Post by tmcdonald »

It's worth noting, if you want to monitor a remote machine, you will likely need to install something like NRPE or NCPA to accomplish this:

https://github.com/NagiosEnterprises/nrpe
https://www.nagios.org/ncpa/help.php
Former Nagios employee
Locked