In order to avoid senseless notifications, Check_MK has the capability of making various settings dependent on both the time of day or day of the week.
So that the configuration is simple and clear, this is achieved in two stages. First, define the time periods. For example, one period could be called ‘Working hours’, and contain Monday to Friday and 8:00 to 17:00 (8 am to 5 pm). Thus every time period is either active or inactive at any particular point in time.
These time periods can then subsequently be used in the configuration. They are used in the following rules - among others. What these rules all have in common is that the application of time periods is optional, and that the time periods restrict the rules’ chronological operation range:
|Notification period for ...||A restriction to the times in which a notification will be generated for a host or service. No alarm will be triggered outside the defined times and the chain of notification rules will not be actioned.|
|Notification rules||Likewise in each notification rule you can define a specific time period as a condition. For example, the notification method (Email or SMS) can be made dependent on the time of day.|
|Check period for ...||With this the execution of checks can be restricted by time. The checks will not be executed outside the defined time period, and the status retains the same condition it had at the ast check execution. Please use this carefully. A service can be flagged as OK even though it may actually have been CRITICAL for hours.|
|Service period for ...||With the aid of a service period you can calculate the percentage of the time a service is available over a specified time period.|
|Event Console||The validity of rules in the Event Console can be dependent on a time period. For example, you can declare particular log messages to be unproblematic at certain times.|
|Alert handler rules||The execution of Alert handler rules can likewise be controlled using time periods.|
|Threshold values||Future versions of Check_MK may also enable time control of the threshold values from checks. For example, a server's threshold values for CPU load could be configured differently based on time of day.|
2. Configuring time periods
Time periods are managed with the Time periods WATO module. The implicit, ever-present Always period is not shown in the list and therefore can neither be altered nor deleted.
As usual in WATO, the time period definitions have an internal ID and a display name (Alias). Only the latter can be altered later, and this is the name which will be shown in selection lists, etc. For every weekday you can enter three time ranges for which the time period will be active. Use the 24-hour format for entries.
Important: to include a complete day up until midnight, enter 00:00 - 24:00, even though, the time 24:00 doesn't actually exist. If you wish to exclude a time, simply enter the times before and after - e.g., 00:00 - 8:00 and 17:00 - 24:00. Days on which the time period should never be active can simply be left empty.
2.2. Individual calendar days
With the aid of Add Exception you can enter single calendar days in the ‘International Date Format’ (YYYY-MM-DD) - for example, 2017-12-25. On these days only the values entered in the Exceptions menu (see below) are effective:
2.3. Excluding time periods from other time periods
A holiday calendar such as this can be excluded from another time period. The most common example is excluding the holidays from a time period for normal office hours. Simply check your 'holidays calendar' box in the Exclude field:
2.4. Importing a calendar from the internet
For vacation and holiday calendars importing calendar data in the iCal-format is conveniently available. Such files are easily found on the internet and spare you from having to enter dates laboriously by hand. For example, holidays for all German states can be found under www.ifeiertage.de. Maybe there is a similar source for your country, too.
Import such data with the button, and in the mask specify the range of future years for which the regular holidays should be entered into the time periods:
A pre-filled time period definition will then be opened, in which you only need to enter the ID and name - once completed you can then exclude this time period from other time periods, as described above.