Class MCollective::Application::Inventory
In: lib/mcollective/application/inventory.rb
Parent: MCollective::Application

Methods

Public Instance methods

Writes a crude DOT graph to a file

Prints a report of all known sub collectives

Helpers to create a simple DSL for scriptlets

Use the ruby formatr gem to build reports using Perls formats

It is kind of ugly but brings a lot of flexibility in report writing without building an entire reporting language.

You need to have formatr installed to enable reports like:

   formatted_inventory do
       page_length 20

       page_heading <<TOP

               Node Report @<<<<<<<<<<<<<<<<<<<<<<<<<
                           time

   Hostname:         Customer:     Distribution:
   -------------------------------------------------------------------------
   TOP

       page_body <<BODY

   @<<<<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   identity,    facts["customer"], facts["lsbdistdescription"]
                                   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                   facts["processor0"]
   BODY
   end

Get all the known collectives and nodes that belong to them

Expects a simple printf style format and apply it to each node:

   inventory do
       format "%s:\t\t%s\t\t%s"

       fields { [ identity, facts["serialnumber"], facts["productname"] ] }
   end

[Validate]