# Dummy service state not updating

**URL:** <https://community.icinga.com/t/dummy-service-state-not-updating/13250>\
**Category:** Service Monitoring\
**Tags:** icinga2\
**Created:** [February 12, 2024, 12:14am UTC](https://community.icinga.com/t/dummy-service-state-not-updating/13250 "2024-02-12T00:14:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robvan](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/858c86/32.png) [@robvan](https://community.icinga.com/u/robvan)\
**Post date:** [February 12, 2024, 12:14am UTC](https://community.icinga.com/t/dummy-service-state-not-updating/13250/1 "2024-02-12T00:14:59Z")

</div>

I have a dummy service set up to receive results of a daily cron job (runs at 02:00). It’s not a critical cron job, so I have the check\_period set to between 09:00-09:15. During this time period, I would expect the service state to change to unknown if the cron job has failed to report its results (no updates in 24 hours), and to send a notification if required if the cron job results are critical or warning. Below are my objects. It doesn’t seem to be performing as expected, so I’m thinking my understanding may be wrong:

```auto
object TimePeriod "0900to0915" {
  display_name = "Icinga 2 0900to0915 TimePeriod"
  ranges = {
    "monday" = "09:00-09:15"
    "tuesday" = "09:00-09:15"
    "wednesday" = "09:00-09:15"
    "thursday" = "09:00-09:15"
    "friday" = "09:00-09:15"
    "saturday" = "09:00-09:15"
    "sunday" = "09:00-09:15"
  }
}

template Service "generic-service" {
  max_check_attempts = 5
  check_interval = 1m
  retry_interval = 30s
  enable_perfdata = false
}

apply Service "check_something" {
  import "generic-service"
  check_command = "dummy"
  display_name = "Cron: check_something"
  enable_active_checks = true
  enable_passive_checks = true
  check_interval = 24h
  retry_interval = 24h
  max_check_attempts = 1
  check_period = "0900to0915"
  vars.notifications = ["someteam"]
  vars.dummy_state = 3
  vars.dummy_text = {{
    var service = get_service(macro("$host.name$"), macro("$service.name$"))
    var lastCheck = DateTime(service.last_check).to_string()

    return "No check results received." + "\n" + "\n" + "Check logs at `/var/log/icinga_send_result/`." + "\n" + "Check team email for any errors."
  }}

  assign where "role" in host.vars.roles
}

```

Any suggestions on correcting this?

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [February 12, 2024, 5:02am UTC](https://community.icinga.com/t/dummy-service-state-not-updating/13250/2 "2024-02-12T05:02:59Z")

</div>

change that from the service

> [@robvan](#):
>
> ```auto
> check_interval = 24h
> retry_interval = 24h
> 
> ```

to

```auto
  check_interval = 5m

```

that should do the trick
