Skip to content

Commit

Permalink
set last_update broker_*_status
Browse files Browse the repository at this point in the history
the broker status is usually called when the object changes, so lets update
the last_update attribute as well.
This addresses an issue where last_update does not get updated when a downtime ends.
  • Loading branch information
sni committed Mar 16, 2022
1 parent 8357779 commit 60ab581
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/naemon/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ void broker_host_status(int type, int flags, int attr, host *hst)
ds.flags = flags;
ds.attr = attr;
get_broker_timestamp(&ds.timestamp);
hst->last_update = ds.timestamp.tv_sec;

ds.object_ptr = (void *)hst;

Expand All @@ -483,6 +484,7 @@ void broker_service_status(int type, int flags, int attr, service *svc)
ds.flags = flags;
ds.attr = attr;
get_broker_timestamp(&ds.timestamp);
svc->last_update = ds.timestamp.tv_sec;

ds.object_ptr = (void *)svc;

Expand Down

0 comments on commit 60ab581

Please sign in to comment.