Skip to content

Schedule problem when scheduler-daemon not running prior to schedule time #171

@acp-jsz

Description

@acp-jsz

Describe the bug

The scheduler is not triggering reports not generated yet.
e.g. we do have configured to create some reports on first of month.
In case the scheduler-service is not active prior to the requested time, the reports will not get generated and send after starting the service.

Even updating the start-time of one schedule is not helping, as long as it keeps staying in the "past".
The Scheduler immediately schedules the report to the next month, without generating the missing reports.

*Workaround to regenerate the reports: *
Set the starttime of a schedule to the actual day of month one month ago, with a time of at least two minutes in the future.
e.g.
requested schedule: 01.01.2023 08:00
actual time: 03.01.2023 16:00
set starttime to: 03.12.2022 16:02

When the report is generated and send, update the starttime to the original requested schedule, so future reports get generated as needed.

To Reproduce

Steps to reproduce the behavior:

  1. Set one schedule with e.g. a monthly interval
  2. Stop the service "icinga-reporting" before reaching the time of report generation.
    (in our case the service had an exception on execution of one report, and died)
  3. Start the service "icinga-reporting" after the requested time of schedule (one second seem to be late enough)
  4. The Scheduler reports that the desired report (requested e.g. just one second ago) is scheduled to the next month.

Expected behavior

When restarting the scheduler daemon it should recognize that some reports were not executed on schedule and try to run those schedules.

Better it seems to me, that there is an additional field per schedule, indicating the last run or the next planned run.
When using the "next planned run" the schedule could be configured to the desired regular execution time
and additional one could trigger an immediate run.
Optional only the starttime of each schedule could be updated to the next execution time - so the scheduler and the user could see the next time of run.

Your Environment

  • Module version: v0.10.0
  • Dependent module versions:
  • Icinga Web 2 version and modules (System - About): v2.11.2
  • PHP version used (php --version): PHP 7.3.31-1~deb10u2
  • Server operating system and version: Debian 10 (Buster)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions