O'Reilly logo

Nagios, 2nd Edition by Wolfgang Barth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required