Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
fix(state) fix update last_state_change and last_hard_state_change on… (
Browse files Browse the repository at this point in the history
#480)

* fix(state) fix update last_state_change and last_hard_state_change on host
* chore(doc): release note updated.
REFS: MON-6732
  • Loading branch information
rem31 authored Apr 9, 2021
1 parent db17837 commit 3b108bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if they have no meaning, they are replaced by a default value.

They could be sent twice. This new version fixes that.

fix update last_state_change and last_hard_state_change on host with no service

*Notification macros*

The url encode action is removed from macros $HOSTACTIONURL*$, $HOSTNOTESURL*$,
Expand Down
6 changes: 6 additions & 0 deletions src/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,12 @@ int host::handle_async_check_result_3x(check_result* queued_check_result) {
return OK;
}

/* initialize the last host state change times if necessary */
if (get_last_state_change() == (time_t)0)
set_last_state_change(get_last_check());
if (get_last_hard_state_change() == (time_t)0)
set_last_hard_state_change(get_last_check());

/* was this check passive or active? */
set_check_type((queued_check_result->get_check_type() == check_active)
? check_active
Expand Down

0 comments on commit 3b108bb

Please sign in to comment.