Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for expiring acknowledgements #391

Closed
wants to merge 19 commits into from

Commits on Aug 16, 2022

  1. Add support for expiring acknowledgements naemon#302

    Parts of this code were based on work done in Icinga v1 by Ricardo
    Bartels for Icinga/icinga-core#369.
    
    Closes naemon#302.
    
    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Aug 16, 2022
    Configuration menu
    Copy the full SHA
    188655c View commit details
    Browse the repository at this point in the history
  2. Add command definitions for expiring acknowledgements

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Aug 16, 2022
    Configuration menu
    Copy the full SHA
    e60e53b View commit details
    Browse the repository at this point in the history
  3. Add end_time argument to acknowledge_*_problem functions

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Aug 16, 2022
    Configuration menu
    Copy the full SHA
    b890f51 View commit details
    Browse the repository at this point in the history
  4. Register the new commands

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Aug 16, 2022
    Configuration menu
    Copy the full SHA
    efbcba1 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2022

  1. Support end_time in the broker

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    c0d7d56 View commit details
    Browse the repository at this point in the history
  2. Set acknowledgement_end_time in host and service structs

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    7d6af7d View commit details
    Browse the repository at this point in the history
  3. Ensure host and service comments know about expiry

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    079b85b View commit details
    Browse the repository at this point in the history
  4. Ensure acknowledgement_end_time is set (or cleared)

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    ebfe3a6 View commit details
    Browse the repository at this point in the history
  5. Read and write acknowledgement_end_time in retention data

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    c32e9a9 View commit details
    Browse the repository at this point in the history
  6. Create and handle host ack expire event

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    8b18dc5 View commit details
    Browse the repository at this point in the history
  7. Reschedule events when starting

    If neamon starts and the retention data contains expiring acks that
    still need to happen, ensure the expire events are properly scheduled.
    
    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    72b07a8 View commit details
    Browse the repository at this point in the history
  8. Add tests for ACKNOWLEDGE_HOST_PROBLEM_EXPIRE

    Signed-off-by: Roel van Meer <[email protected]>
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    6881dfa View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fad6c90 View commit details
    Browse the repository at this point in the history
  10. Separate clearing and destroying event queue

    In tests, we want to be able to remove all events but not destroy the
    queue.
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    ac16d0f View commit details
    Browse the repository at this point in the history
  11. Properly remove references to events when destroying

    After destroying the check events, references to those events must be
    cleared. If not, scheduling a new check event will try to destroy the
    event that is still referenced, which causes a segfault.
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    739690a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2d2e3d1 View commit details
    Browse the repository at this point in the history
  13. Add test for expiring acknowledgement

    This adds a test that checks if the acknowledgement expiry event does
    its work.
    
    It starts by removing all events from the event queue. We then run the
    command, with expiration set in two seconds. After waiting three
    seconds, we process a single event (we should have only one event in the
    queue at this point). After processing the event, the acknowledgement
    should be gone.
    roelvanmeer committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    9e0bb48 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. Configuration menu
    Copy the full SHA
    2512b35 View commit details
    Browse the repository at this point in the history
  2. Update test_commands.c

    fix number of tests
    sni committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    4e327e3 View commit details
    Browse the repository at this point in the history