feat: Report whether a managed host is waiting on a reboot
This commit is contained in:
@@ -450,6 +450,16 @@ func runInventory(ctx context.Context, cfg *config.Config) {
|
||||
r := inventory.Collect(static)
|
||||
r.ServerId = cfg.ServerID
|
||||
r.AgentToken = cfg.AgentToken
|
||||
// Static snapshots only — every 15 minutes, not every 30 seconds. On
|
||||
// Windows this spawns a PowerShell process, which is not something to
|
||||
// do twice a minute forever, and a host rebooted by hand clearing the
|
||||
// flag within a quarter of an hour is soon enough.
|
||||
//
|
||||
// Computed here rather than inside inventory.Collect so the inventory
|
||||
// package gains no dependency on updates.
|
||||
if static {
|
||||
r.RebootRequired = updates.RebootRequired()
|
||||
}
|
||||
if err := client.ReportInventory(r); err != nil {
|
||||
log.Printf("report inventory: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user