Scheduling a weekly check
Posted: Mon Nov 18, 2013 6:05 pm
Got a problem configuring a check: I'm not sure how to implement it.
A file arrives on the server on Friday, some time between 4 and 6 PM. What I need to do is as follows:
* Look for the file's presence. If it's not present, don't panic yet: it may arrive later.
* If the file is present, scan it for certain strings. If they're not present, panic.
* If the file isn't present by 6 PM, panic.
I can script most of the logic on the monitored server side, that's not an issue.
Running the script only on Friday between 4 and 6 PM is not an issue either, I can use the timeperiod definitions to do that.
The question is, how can I configure Nagios to keep checking, but only send out an alert if the file doesn't contain the right strings OR if it's not present by 6 PM?
One way to do it that I've thought of is to make my script that scans the file also check the time, and return a CRITICAL result if the file's not there by 6 PM. Any other ways anyone can think of?
A file arrives on the server on Friday, some time between 4 and 6 PM. What I need to do is as follows:
* Look for the file's presence. If it's not present, don't panic yet: it may arrive later.
* If the file is present, scan it for certain strings. If they're not present, panic.
* If the file isn't present by 6 PM, panic.
I can script most of the logic on the monitored server side, that's not an issue.
Running the script only on Friday between 4 and 6 PM is not an issue either, I can use the timeperiod definitions to do that.
The question is, how can I configure Nagios to keep checking, but only send out an alert if the file doesn't contain the right strings OR if it's not present by 6 PM?
One way to do it that I've thought of is to make my script that scans the file also check the time, and return a CRITICAL result if the file's not there by 6 PM. Any other ways anyone can think of?