Page 1 of 1
Task Schedular with time
Posted: Wed Mar 12, 2014 1:08 pm
by cesar.garza
yo yo nagios guy !!
SO...i have setup a task scheduler and its doing what its supposed to do but I am trying to find a way to put exact time in the command so when my task scheduler don't run on that time, it send an alert.
Nsclient : alias_sched_all = CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title%: %exit_code%"
command.cfg: command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c alias_sched_all -a Run-sales-report
so above task scheduler should run everyday at 5pm and if it doesnt run so nagios send an alert.
Thanks guys
Re: Task Schedular with time
Posted: Wed Mar 12, 2014 4:32 pm
by sreinhardt
So you are looking to validate that a task did\is running at 5, with the nrpe command, or you are looking to make sure that a passive check gets run at 5? Also are you looking to add the time on the nsclient side or nagios side of things?
Re: Task Schedular with time
Posted: Thu Mar 20, 2014 11:57 am
by cesar.garza
So basically, I have a windows box that runs some task scheduler and i have setup a nagios to check the task scheduler(Run-sales-report) should run "status" all the time. this is how i setup it and working fine.
Code: Select all
Nsclient : alias_sched_all = CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title%: %exit_code%"
command.cfg: command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c alias_sched_all -a Run-sales-report
Now i want to add new thing in the above command/code that when task scheduler didn't run at the specific time so nagios trigger the alert.
Did i make sense ? Thanks for help
Re: Task Schedular with time
Posted: Fri Mar 21, 2014 10:23 am
by slansing
Okay, so it currently looks like you are returning an OK state on that check, the next step would be to implement a critical switch so that the check will return a critical to Nagios when what is required for an OK state is not met. I am not extremely well versed with the CheckTaskSched functionality of NSClient, but you would want to set up a MaxCrit range, based on the records being returned. Have a look at some of the examples posted here:
http://nsclient.org/nscp/wiki/CheckTask ... ed/samples
We'd be happy to help you through adding this to your command, and may be able to somewhat mirror what you are checking to do so.
Re: Task Schedular with time
Posted: Mon Mar 24, 2014 2:29 pm
by cesar.garza
Hey Slansing
I am not sure how we gonna use that MaxCrit in my command and how am i gonna pass the time as a argument. Let me know if you have questions.
Re: Task Schedular with time
Posted: Tue Mar 25, 2014 11:05 am
by lmiltchev
I don't believe this could be done, just by looking at the samples here:
http://nsclient.org/nscp/wiki/CheckTask ... ed/samples
I would recommend posting your question on the NSClient++ support page. I hope they have a solution that works "out of the box", however it seems that you may have to come up with some kind of custom script to achieve your goal.