Git Product home page Git Product logo

puppetdb-grep's Introduction

puppetdb-grep

puppetdb-grep gives you the ability to for example get all puppetversions for active nodes running Linux.

This is just a quick evening hack I did, don't expect any magic unicorns!

Please note that some queries are expensive since puppetdb-grep asks all nodes matching your query for their --grep fact

Examples:

Give me all active nodes:

puppetdb-grep.py --query '["=", ["node", "active"], True]'

Give me all active nodes and their puppetversion

puppetdb-grep.py --query '["=", ["node", "active"], True]' --grep puppetversion

Query active nodes with kernel Linux with uptime greater then 30, grep for their memorytotal

puppetdb-grep.py --query '["and",
    ["=", ["node", "active"], True],
    ["=", ["fact", "kernel"], "Linux"],
    [">", ["fact", "uptime_days"], 30]]' --grep memorytotal

Example Output:

$ puppetdb-grep.py --query '
    ["and",["=", ["node", "active"], True],
    ["=", ["fact", "Linux"], "Darwin"],
    [">", ["fact", "uptime_days"], 30]]' --grep puppetversion
2.7.18:
- node1.example.com
- node.32.example.com
2.7.19:
- node139.example.com
- node75.example.com

puppetdb-grep's People

Contributors

jhaals avatar

Stargazers

Sébastien WENSKE avatar Chris Hufnagel avatar Daniel Pfile avatar

Watchers

 avatar James Cloos avatar Christoph Schug avatar Juan Sierra Pons avatar  avatar

puppetdb-grep's Issues

Change syntax

puppetdb-grep --query 'puppetdb-query' -fact --grep

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.