diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2599cbd..7beca0ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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*$, diff --git a/src/host.cc b/src/host.cc index bbdba0a74..51a335293 100755 --- a/src/host.cc +++ b/src/host.cc @@ -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