Page 1 of 1
Monitor Task Scheduler task
Posted: Thu Aug 31, 2017 2:55 pm
by aajewole
Any way to have nagios monitor a task, if it fails, restart or email?
Re: Monitor Task Scheduler task
Posted: Thu Aug 31, 2017 3:29 pm
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
Re: Monitor Task Scheduler task
Posted: Fri Sep 01, 2017 3:17 pm
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