Disable freshness checking when outside certain timeperiod

Hi all,

I have been trying to set up freshness checking for all my passive services. I have some 3k+ passive services that I need to check for freshness that all run at during different timeperiods. The problem I keep running into is that freshness checking keeps running outside a corresponding timeperiod.

I have tried to set a check_period in my services as well as apply a notification period but I still get alerts outside me set timeperiod. Is there something I am missing/configuring this incorrectly?

My configs are templated through chef but here is a sample of one service:

from timeperiods.conf

object TimePeriod "market_hours" {
  import "legacy-timeperiod"

  display_name = "9:30am - 4:00pm (M-F) [ET] TimePeriod"

  ranges = {
    "monday"    = "09:30-16:00"
    "tuesday"   = "09:30-16:00"
    "wednesday" = "09:30-16:00"
    "thursday"  = "09:30-16:00"
    "friday"    = "09:30-16:00"
  }
}

from notifications.conf

apply Notification "freshness_check-market_hours-warnings" to Service{
  command = "notify-service-by-pagerduty"
  states = [ OK, Warning, Critical, Unknown ]
  types = [ Problem, Acknowledgement, Recovery, Custom ]
  period = "market_hours"
  users = [ "fake" ]

  assign where service.vars.passive_check_market_hours == true
}

from templates.conf

template Service "passive-service" {
  check_interval = 1h
  retry_interval = 1m

  enable_active_checks = true
  check_command = "passive"
  vars.dummy_state = 3
  vars.dummy_text = "No Passive Check Result Received."
}

from services.conf

apply Service "different timeperiods_market_hours_not_ops_market_hours" {
  import "passive-service"
  check_period = "market_hours"

  assign where host.vars.different_timeperiods_market_hours_not_ops_market_hours == "true"

  vars.warnings = false
  vars.pager_not_ops_market_hours = true
  vars.passive_check_market_hours = true
  max_check_attempts = 1
}

Any input would be appreciated!

Best,
Vinay