1

I'm trying to set up a custom time period for some of my Nagios notifications.

I need to execute checks for the first weekday after EOM.

This would meet the following criteria:

  • day of month >1, day of month <8
  • day of week monday - friday
  • only apply to the first date meeting these criteria.

Is there any good way to state this in Nagios's time period? I don't see a way to make compound statements.

1 Answer 1

2

As you may have seen, there are examples of almost every possible combination in the time period definitions and on call rotation docs, except what you want.

While you can do "nth Monday of the month" (Tuesday, Wednesday, etc.) and "nth day of the month", you can't just do "first weekday of the month", unfortunately.

I initially thought this would be possible by starting with "first day of the month" and excluding a timeperiod that covers all of Saturday and Sunday, but I don't believe this works.

(There is a trick to doing a similar time period on per-month basis, though, which is as close as I could find.)

So the only way I can think of to do this is to generate (via script) a custom time period that explicitly includes the dates that you want. And then re-run that every year.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .