Using time periods with services checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Using time periods with services checks

Post by Frédéric GRANAT »

I'm sorry but, none of the 3 methods works.
For each test, I made the modifications on the time period and delete/create my service check.

Here are the services status for the 3 methods
Method 1 (tuesday 1 - wednesday 1 exlude tuesday) : Service check is pending... Check is scheduled for 2012-12-04 00:00:00
Method 2 (wednesday 1 - tuesday 1 exlude tuesday) : No check results for service yet...
Method 3 (day 2- day 8 exclude everyday but wednesday): Service check is pending... Check is scheduled for 2012-12-02 00:00:00

Thanks to propose a method that has been tested.

Rgds,

Frederic
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using time periods with services checks

Post by scottwilkerson »

Can you send copies of the time periods you used
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Using time periods with services checks

Post by Frédéric GRANAT »

Hi,

Here are un copy/paste of

1) TIME DEFINITIONS

define timeperiod {
timeperiod_name mercredi_suivant_premier_mardi_m1
alias Mercredi suivant le premier Mardi du mois
exclude mardi
tuesday 1 -wednesday 1 00:00-24:00
}

define timeperiod {
timeperiod_name mercredi_suivant_premier_mardi_m2
alias Mercredi suivant le premier Mardi du mois
exclude mardi
wednesday 1 - tuesday 1 00:00-24:00
}

define timeperiod {
timeperiod_name mercredi_suivant_premier_mardi_m3
alias Mercredi suivant le premier Mardi du mois
exclude jours_sauf_mercredi
day 2 - day 8 00:00-24:00
}

define timeperiod {
timeperiod_name mardi
alias mardi
tuesday 00:00-24:00
}

define timeperiod {
timeperiod_name jours_sauf_mercredi
alias Jours sauf Mercredi
thursday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
}

2) SERVICES TEMPLATES

define service {
name sauvegardes_premier_mardi_m1
service_description Supervise les sauvegardes du premier Mardi du mois
display_name sauvegardes_premier_mardi_m1
servicegroups Sauvegardes
use generic_sauvegardes
check_period mercredi_suivant_premier_mardi_m1
notifications_enabled 0
register 0

}

define service {
name sauvegardes_premier_mardi_m2
service_description Supervise les sauvegardes du premier Mardi du mois
display_name sauvegardes_premier_mardi_m2
servicegroups Sauvegardes
use generic_sauvegardes
check_period mercredi_suivant_premier_mardi_m2
notifications_enabled 0
register 0

}

define service {
name sauvegardes_premier_mardi_m3
service_description Supervise les sauvegardes du premier Mardi du mois
display_name sauvegardes_premier_mardi_m3
servicegroups Sauvegardes
use generic_sauvegardes
check_period mercredi_suivant_premier_mardi_m3
notifications_enabled 0
register 0

}

3) SERVICES

define service {
host_name W2K8-SRVBACKUP.cg.ahp
service_description export_system_state_m1
use sauvegardes_premier_mardi_m1
check_command check_nrpe!check_export_system_state!!!!!!!
register 1
}

define service {
host_name W2K8-SRVBACKUP.cg.ahp
service_description export_system_state_m2
use sauvegardes_premier_mardi_m2
check_command check_nrpe!check_export_system_state!!!!!!!
register 1
}

define service {
host_name W2K8-SRVBACKUP.cg.ahp
service_description export_system_state_m3
use sauvegardes_premier_mardi_m3
check_command check_nrpe!check_export_system_state!!!!!!!
register 1
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using time periods with services checks

Post by scottwilkerson »

Frédéric GRANAT wrote: define timeperiod {
timeperiod_name mercredi_suivant_premier_mardi_m1
alias Mercredi suivant le premier Mardi du mois
exclude mardi
tuesday 1 -wednesday 1 00:00-24:00
}
there should be a space between the - and wednesday

Code: Select all

define timeperiod {
        timeperiod_name                         mercredi_suivant_premier_mardi_m1
        alias                                   Mercredi suivant le premier Mardi du mois
        exclude                                 mardi
        tuesday 1 - wednesday 1                  00:00-24:00
        }
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Using time periods with services checks

Post by Frédéric GRANAT »

I corrected the bug : that doesn't work better.

Frederic
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using time periods with services checks

Post by scottwilkerson »

Provided you restarted nagios, what is the next check time set to for?
host_name W2K8-SRVBACKUP.cg.ahp
service_description export_system_state_m1
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Using time periods with services checks

Post by Frédéric GRANAT »

Last check : 2012-12-03 16:30:42
Status information : Job: [EXPORT]-System State, last result 7/11/2012 is older than 3 days
Same message from the three checks.

That's not normal, the check shouldn't have occured today but wednesday.
The backup job is planned for tomorrow.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using time periods with services checks

Post by scottwilkerson »

from the Status detail page I want to know what it says in the field for

Code: Select all

Next Check:
not last check, that could be from before it was changed...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: Using time periods with services checks

Post by Frédéric GRANAT »

Status Details
Service State: Critical
Duration: 16h 20m 55s
Service Stability: Unchanging (stable)
Last Check: 2012-12-04 08:29:40
Next Check: 2012-12-04 08:34:40
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using time periods with services checks

Post by scottwilkerson »

I am going to have to do some testing on this and get back to you.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked