2.10 Defining a Time Period with timeperiod

timeperiod objects describe time periods in which Nagios generates and/ or sends notifications. The included example files (Nagios 3.0: objects/timeperiods.cfg; Nagios 2.x: localhost.cfg) contain a number of definitions that can simply be copied to your own timeperiods.cfg file.

In this, the definition of 24×7 is stated as "Sundays to Saturdays, from 0 to 24 hours in each case:"

# -- /etc/nagios/mysite/timeperiods.cfg
define timeperiod{
   timeperiod_name 24×7
   alias           24 Hours A Day, 7 Days A Week
   Sunday              00:00-24:00
   Monday              00:00-24:00
   tuesday             00:00-24:00
   wednesday           00:00-24:00
   Thursday            00:00-24:00
   Friday              00:00-24:00
   Saturday            00:00-24:00
}

The times of day on individual weekdays can also be "cobbled together" ...

Get Nagios, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.