You could even use hammer with one of the output formatters, and loop over it.
Something like "hammer --csv host list --hostgroup GCE" would get you the starting list of hosts to loop, then a call to this API (don't think hammer has last-report): '/api/v2/hosts/<host-fqdn>/reports/last' | json_pp | grep "reported_at" would give you the last report date. You could compare those to $now and then call "hammer host delete --name <host-fqdn>" if it's too old. *OR* consider using the expire_hosts plugin, which if you're just concerned about cleanin up old hosts, might be exactly what you want. See https://github.com/theforeman/foreman_expire_hosts Greg -- You received this message because you are subscribed to the Google Groups "Foreman users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/foreman-users. For more options, visit https://groups.google.com/d/optout.
