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
Task Schedular with time
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Task Schedular with time
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
cesar.garza
- Posts: 80
- Joined: Mon Aug 19, 2013 3:14 pm
Re: Task Schedular with time
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.
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
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
Did i make sense ? Thanks for help
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Task Schedular with time
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.
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.
-
cesar.garza
- Posts: 80
- Joined: Mon Aug 19, 2013 3:14 pm
Re: Task Schedular with time
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.
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
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.
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!