PuppetDB 4.4 API - Getting ALL events (changes and no-changes)

35 views
Skip to first unread message

FE Williams

unread,
Jun 27, 2018, 6:51:12 PM6/27/18
to Puppet Users
I need to programmatically present all events for a given node from the latest report for audits of server Security Controls we're managing with Puppet - pretty much the way events look in the PE Console when looking at a report - whether the event was a success or not, and whether or not a resource property was changed or not.  Querying Events (on puppetca: curl -G http://127.0.0.1:8080/pdb/query/v4/events --data-urlencode 'query=["=", "report", "fa6dcbc36b69174178e1234561d4c6e461017327"]' )   seems to only send results of resource properties that were changed by puppet (and returns nothing at all if there were no changes.  Does anybody know how to get the events where there was no change?

Thomas Müller

unread,
Jun 28, 2018, 7:27:58 AM6/28/18
to Puppet Users


Am Donnerstag, 28. Juni 2018 00:51:12 UTC+2 schrieb FE Williams:
I need to programmatically present all events for a given node from the latest report for audits of server Security Controls we're managing with Puppet - pretty much the way events look in the PE Console when looking at a report - whether the event was a success or not, and whether or not a resource property was changed or not.  Querying Events (on puppetca: curl -G http://127.0.0.1:8080/pdb/query/v4/events --data-urlencode 'query=["=", "report", "fa6dcbc36b69174178e1234561d4c6e461017327"]' )   seems to only send results of resource properties that were changed by puppet (and returns nothing at all if there were no changes.  Does anybody know how to get the events where there was no change?


IMHO: a change generates an event. no change generates no event.

You might be looking after all the resources puppet tries to manage? https://puppet.com/docs/puppetdb/5.1/api/query/v4/resources.html

The report endpoint also has some hint regarding your question:

Note: The resources field is only offered in Puppet Enterprise (PE)


- Thomas


FE Williams

unread,
Jun 28, 2018, 4:10:48 PM6/28/18
to Puppet Users
Thanks for your quick response, Thomas!
I'll try grabbing all by node from the resources endpoint and merging the few events into that result.

Thanks,
Gene
Reply all
Reply to author
Forward
0 new messages