Wednesday, April 11, 2012

How to make Nagios monitor its service at particular Time Period

I am considering that you already know how to add custom services. If not, please have a look at my previous post:  http://codebyte.blogspot.com/2012/03/adding-custom-services-for-windows-host.html

Suppose you want to monitor your service at 16:00 to 16:15 and 18:00 to 18:15 hours everyday.

First of all, you need to open your timeperiod.cfg file in your nagios server installation directory.
Add the following lines,
define timeperiod{
         timeperiod_name               24X7custom
         alias                                   24X7custom
         sunday                               16:00-16:15,18:00-18:15
         monday                             16:00-16:15,18:00-18:15
         tuesday                             16:00-16:15,18:00-18:15
         wednesday                        16:00-16:15,18:00-18:15
         thursday                           16:00-16:15,18:00-18:15
         friday                                16:00-16:15,18:00-18:15
         saturday                           16:00-16:15,18:00-18:15
}