Page 1 of 1

Question about check_period working

Posted: Fri Apr 11, 2014 1:39 am
by mkot
Hi,
I couldn't find answer for my question (searching google, nagios docs).

I've got host:

Code: Select all

define host{
        use                     linux-box
        host_name               domena-ld
        alias                   kontroler domeny TAILD
        address                 192.168.5.4
        icon_image              ubuntu.png
        statusmap_image         ubuntu.gd2
        parents                 3Com
        }
With uses linux-box directive where I've got:

Code: Select all

define host{
        use                     generic-host
        name                    linux-box
        register                0
        check_period            24x7
        max_check_attempts      1
        normal_check_interval   5
        retry_check_interval    1
        contact_groups          admins
        check_command           check-host-alive
        notification_interval   30
        notification_period     24x7
        }
with check_period 24x7

I've defined service:

Code: Select all

# Użycie procesora
define service{
        use                     local-service
        host_name          domena-ld
        service_description     CPU Usage
        check_command           check_nrpe!check_cpu
        check_period            samba
        notifications_enabled   1
        flap_detection_enabled  0
        active_checks_enabled   1
        passive_checks_enabled  0
        }
and check_period is samba (below definition for it):

Code: Select all

# 'samba' timeperiod definition
# Monitorowanie wykorzystania zasobów na kontrolerach domen
define timeperiod{
        timeperiod_name samba
        alias           Samba Work Hours
        monday          07:00-17:00
        tuesday         07:00-17:00
        wednesday       07:00-17:00
        thursday        07:00-17:00
        friday          07:00-17:00
        }
So does it mean that my host will be monitored 24h per 7 days (check-host-alive) but service(s) with samba period will be monitored from 7am to 5pm? Hope it's clear and you'll know what am I asking for ;)

Re: Question about check_period working

Posted: Fri Apr 11, 2014 11:30 am
by sreinhardt
Yes that is exactly what you should have going on. Thank you for posting complete information, that helped a lot!

Re: Question about check_period working

Posted: Fri Apr 11, 2014 2:49 pm
by mkot
Ok, thats all I wanted know. You may close this thread :) Thank you.