View all the failed executions on Puppetdb

24 views
Skip to first unread message

Aditya S

unread,
Feb 14, 2019, 11:42:35 AM2/14/19
to Puppet Users
Hi,

Is there a way to see failed executions in PuppetDB? I can see all the successful  classes in "public.catalog_resources" but is there a way to see all failed executions. For example something like:
"Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find class"

If I were not using psql but trying the REST API like "/pdb/query/v4/reports"? 

Thanks!

Aditya S

unread,
Feb 14, 2019, 11:46:06 AM2/14/19
to Puppet Users
Sorry I forgot to add:
puppetserver version: 5.3.7
puppetdb version: 5.2.7
puppet agent version: 5.5.8

Austin Blatt

unread,
Feb 14, 2019, 4:52:21 PM2/14/19
to puppet...@googlegroups.com
If you want all information about all failed reports you can query for reports that have a status of failed. An example using curl would look like,

  -H 'Content-Type:application/json' \
  -d '{"query": "reports { status = \"failed\" }"}'

There are a few other options that might be of interest to you as well, for example you can query for just the certname of all agents whose most recent Puppet run failed with something like,

  -H 'Content-Type:application/json' \
  -d '{"query": "reports[certname] { status = \"failed\" and latest_report? = true}"}'

You can find more docs on querying the reports endpoint for PuppetDB 5.2.7 here. I hope this helps! 

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/14aa3fc7-1e85-4f2c-bfb3-aa2e1ed1b074%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Austin Blatt
Associate Software Engineer

Aditya S

unread,
Feb 14, 2019, 8:15:15 PM2/14/19
to Puppet Users
Thanks Austin,

The output didn't give me any information so I tried to look in the database. Is it coming from public.report_statuses or public.resource_events because they are both blank for me. Is that the right tabel?

Please let me know.

Thanks!

Aditya S

unread,
Mar 1, 2019, 2:42:34 PM3/1/19
to Puppet Users
I figured this out. I missed a step while setting up the PuppetDB. I did not add "reports = store,puppetdb" in the puppet.conf so it never really added the reports in the database. 

Adding the following and restarting it fixed the issues for me:

# vi /etc/puppetlabs/puppet/puppet.conf

[master]
storeconfigs = true
storeconfigs_backend
= puppetdb
reports
= store,puppetdb

Reply all
Reply to author
Forward
0 new messages