Chapter 7. Writing Custom Reports with PuppetDB

In the previous chapter, we learned about the PuppetDB query API, what it can be used for, and how to leverage the power of its built-in query language. In this chapter, we're going to take that knowledge and use it to create a simple but effective reporting application written in Ruby. We're going to explore the following topics:

  • Creating a skeleton Ruby application
  • Connecting to PuppetDB using JSON
  • Retrieving facts
  • Retrieving events and reports using multiple endpoints

At the end of this chapter, you should be comfortable making use of the PuppetDB query API in your own applications and understand how to process the JSON output of the API.

Creating a basic query application

We're going to start with a ...

Get Puppet Reporting and Monitoring now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.