[Satellite 6] How to make queries for failed Puppet reports to Satellite from API?
Environment
- Red Hat Satellite 6.x
Issue
- How to make queries for failed Puppet reports to Satellite from API ?
Resolution
- Red Hat Satellite API "/api/v2/hosts?search=last_report+>+"35+minutes+ago"+and+(status.failed+>+0+or+status.failed_restarts+>+0)+and+status.enabled+%3D+true" could help to retrieve the failed Puppet reports as below:
e.g.
# curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X GET -u admin:redhat 'https://satellite.lab.example.com/api/v2/hosts?search=last_report+>+"35+minutes+ago"+and+(status.failed+>+0+or+status.failed_restarts+>+0)+and+status.enabled+%3D+true' --insecure
{
"total": 2,
"subtotal": 0,
"page": 1,
"per_page": 20,
"search": "last_report \u003e \"35 minutes ago\" and (status.failed \u003e 0 or status.failed_restarts \u003e 0) and status.enabled = true",
"sort": {
"by": null,
"order": null
},
"results": []
}
Note: Above search query is an example and it could alter as require.
For more KB articles/solutions related to Red Hat Satellite 6.x Puppet Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Puppet Issues
SBR
Product(s)
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.