Question about check_period working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mkot
Posts: 68
Joined: Tue Feb 25, 2014 1:47 am
Location: Poland

Question about check_period working

Post 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 ;)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Question about check_period working

Post by sreinhardt »

Yes that is exactly what you should have going on. Thank you for posting complete information, that helped a lot!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
mkot
Posts: 68
Joined: Tue Feb 25, 2014 1:47 am
Location: Poland

Re: Question about check_period working

Post by mkot »

Ok, thats all I wanted know. You may close this thread :) Thank you.
Locked