Instead of querying PuppetDB for every fact that it knows about only
querying it for the fact names that it knows about. The result is a
much smaller result set that is more noticable on environments with
large numbers of nodes and/or facts.
On one environment with > 2500 fact-names and 35 nodes a curl test
to the facts endpoint without any query string returned in ~3.5 seconds.
Ran another curl test to the facts endpoint with the query string that
the code in this commit creates, the command finished in ~0.040 seconds.
This makes use of the available catalog endpoints in pypuppetdb and PuppetDB
and displays to administrators the last compiled catalog for a node,
if the variable ENABLE_CATALOG is True (defaults to False)
Added inventory page showing a table similar to the "Nodes" one,
but containing any customizable set of facts.
A setting INVENTORY_FACTS has been added. It controls the list
of facts to be displayed along with a description for the header
of the table.
Using multiprocessing is at least causing mod_wsgi to throw a hissy fit.
A few other WSGI servers seem to be able to deal with this correctly but
for now, back to serial requests.
* report/latest/<node_name> uses limit parameter in _query
to get just one report
* disable "Latest Report" button if there is no report
* HTTP Status 500 if there is no report on report/latest/<node_name>
This commit uses the new parameter with_status from nedap/pypuppetdb#18
Node status is now shown as text with the additional information of
failed/succeded events, unreported time
The statistics on Overview now show the *number of nodes*
that have status failed/changed/unreported
I broke things with 795d243e9d because I
forgot to remove it everywhere from functions and templates. Also
removed the old PUPPETDB_EXPERIMENTAL switching.
PUPPETDB_API is no longer configurable since we're now using features
that are v3 only. Limiting ourselves to v2 compatibility is far too
troublesome and people tend to update to newer versions of PuppetDB
fairly quickly.
* Don't pass unresponsive to the view, access config[] object instead
* Remove the statistics header, it only takes up space
* Lowercase a few things
* Change the descriptions for 'radiator' to make the math work: Because
of how PuppetDB's aggregate-events-count works nodes with both
successful and failed events count for both causing success + failure
+ unreported to not equal population, which is weird. Now we're simply
stating that they have failed events instead of saying that the node
is succesful/failed.
- the amount of hours is defined as `UNRESPONSIVE_HOURS` in default_settings.py
- small status layout improvement in nodes list
- latest report button in nodes list
- nedap/pypuppetdb repo as requirement ( new api was merged nedap/pypuppetdb#17 )
The following frontend features are implemented
- Number of failures, successes, noops/skips in overview
- Show latest reports with 1 or more events in overview
- Direct links to latest Report
- Number and types of events in nodes list