Creating a new time period

In this recipe, we'll add a new time period definition to the Nagios Core configuration to allow us to set up monitoring for hosts and services only during weekdays. There's a default configuration defined as workhours that would almost suit us, except that it doesn't include the evenings. We'll make a new one from scratch, and we'll make another one to cover the weekends too.

Getting ready

You should have a working Nagios Core 3.0 or better server running.

How to do it...

We can set up our new time period, which we'll call weekdays, as follows:

  1. Change to our Nagios Core configuration objects directory, and edit the file called timeperiods.cfg:
    # cd /usr/local/nagios/etc/objects
    # vi timeperiods.cfg
    
  2. Add the following definitions ...

Get Nagios Core Administration Cookbook 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.