Created
June 3, 2014 13:25
-
-
Save lsjostro/bed41eb3c61a12db6445 to your computer and use it in GitHub Desktop.
puppetdb event report shell function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# req: brew/yum install jq on MacOS X/Linux (install in .bashrc or global profile.d/) | |
export PUPPETDB_HOST="my.puppetdb.host.foo" | |
function puppet_report { curl -sG http://$PUPPETDB_HOST/v3/events --data-urlencode "query=[\"and\", [\"=\", \"latest-report?\", true],[\"~\", \"certname\", \"^$1\"]]" | jq -r '.[] | .certname+","+.["resource-type"]+"["+.["resource-title"]+"]" + "," +.status + "," + .message' | column -t -s,; } | |
export -f puppet_report |
Author
lsjostro
commented
Jun 3, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment