A Nagios check that connects to PuppetDB and determines the Puppet agent run health on a host.
- PuppetDB
- A puppetmaster configured to send reports to PuppetDB
The check will return an UNKNOWN state if there are no reports stored in PuppetDB for the specified host.
The check will return a CRITICAL state if there are resources in the latest report for the specified host that are failing to apply.
The check will return a WARNING state if there are resources that have applied the same change in the last two reports for the specified host (e.g. an Exec that isn't guarded by creates
, unless
or onlyif
).
$ check_puppet_run_health -d <puppetdb host> -p <puppetdb port> --[no-]ssl -h <host to check>
$ check_puppet_run_health -d localhost -p 8080 -s -h testnode.example.com
CRITICAL: 1 failing actions, 1 recurring actions
FAILING ACTIONS
---------------
Package[whatever]/ensure: changed from 'purged' to 'installed' failed
RECURRING ACTIONS
-----------------
Service[foo]/ensure: changed from 'stopped' to 'running'