The Overview will display a bar chart of daily runs, categorized by
report status (changed, unchanged, failed).
The chart data is loaded asynchronously from JSON so it doesn't provoke
a delay in the page load. The data is JSON enconded.
This feature was in the original Puppet Dashboard. The change was
proposed and discussed in issue #308 .
Application changes:
- app.py: New view daily_reports_chart to serve the chart data as JSON.
- dailychart.py: Submodule to query and format the chart data.
Template changes:
- layout.html: New block to add more elements to the HTML header.
- index.html, node.html: Add C3 CSS in header block, add DIV placeholder
for the chart in content block, add dailychart.js (and dependencies)
in script block.
Settings:
- DAILY_REPORTS_CHART_ENABLED: New setting to turn off the charts. By
default is on.
- DAILY_REPORTS_CHART_DAYS: Changes the range of days to display in the
charts.
Javascript changes:
- dailychart.js: New script that loads the JSON data for the chart and
calls C3 to generate a bar chart.
CSS changes:
- puppetboard.css: Set fixed height to the chart container to avoid a
page resize after the chart is loaded.
* Create a custom class to handle aborting 204 properly. If this isn't
covered the server will send a 500 due to a python exception
* Moved py.test configuration under tool:pytest, this was causing a
warning. This is new to 3.0.1 which is now the pinned version
* Unittest for puppetboard.utils
This resolves#276
Current behaviour of the Facts page would query the fact_names endpoint
regardless of environment. This update would query the Facts endpoint,
extracting each unique fact name known to the environment.
This fixed#290
To help make it more obvious for users to see what the current environment
is replacing the original text of the Environments dropdown menu from
'Environments' to the current environment.
The other suggestion was to make the active item stand out more but that
would require custom CSS that may conflict with the Sementic UI.
* puppetboard/app.py: Simplifying the code generating and rendering the Inventory
This resolves#275
This update eliminates one iteration over the resulting inventory facts
that generates a multidimensional dictionary keyed by the node's certname
to another dictionary of key-value pairs of the fact name and fact value.
* puppetboard/templates/inventory.html: Wrapping the fact values in links to the Node page
This comes as a request from #280
* puppetboard/app.py: Enhancing queries for Node and Report states
This resolves#264
On the Nodes and Reports tabs when the user adds a status query string
argument additional query clauses are generated based on its value.
Can be one of failed, changed, unchanged, noop or unreported (for Nodes
only)
No query clause is generated for noop on the Nodes tab. The query field
latest_report_noop was added in PuppetDB 4.1 and we do not want to break
compatability between minor or bug-fix versions.
* puppetboard/app.py: Simplifying the query logic in nodes()
The new logic starts with a blank `AndOperator()` object then proceeds
to build the query based on environment and status values. After all
after all checking if there are no operations declare the object as
None.
* puppetboard/app.py: Simplifying the query logic for reports()
Similar to the work done for nodes()
* puppetboard/app.py: Fixing pep8 formatting in nodes()
* Add pagination to reports/<node>
This fixes#258
URL quoting is now done in pypuppetdb >= 0.2.3 which contributed to the
metric URL being double-quoted by the time it reached PuppetDB, which
responds with a 404. Instead using the plain-text name to build the
link to metric()
This change is only useful for Docker image building, but for officially
supported packages in PIP this change will cause unnecessary breakage to
existing users. We will have to implement a different approach for configuring
settings in Docker images.
Adding a note to README.rst indicating that an officially supported Docker
image is planned.
Upgrading the following packages to the respected versions:
WTForms==2.1
Flask-WTF==0.12
Werkzeug==0.11.0
Passing newly required metadata to the QueryForm constructor in puppetboard/app.py
Apache >= 2.4 with mod_wsgi experienced a major issue where it would re-generate
the app's secret key on each request. The fix for this turned out to be placing
a permanent statis 'secret_key' value in the wsgi.py. Adding a block in README.rst
on how to implement the user's own secret_key
* puppetboard/app.py: Implementing and utilizing the new PyPuppetDB QueryBuilder
This fixes https://github.com/voxpupuli/puppetboard/issues/239
Replacing all the directly declared query strings with various objects
from the pypuppetdb.QueryBuilder sub-module. Using this Object-Oriented
functionality it is programmatically safer to construct large, complex
queries.
* puppetboard/app.py: Simplifying the environment logic in `node()`
The query in this function will now always be an `AndOperator()` object.
If a specific environment is queried then that constraint is added.
The resulting query difference will be:
env == 'production'
`["and",["=", "environment", "production"],["=", "certname", "puppet01.hammertime.local"]]`
env == '*'
`["and",["=", "certname", "puppet01.hammertime.local"]]`
* puppetboard/app.py: Minor code simplification for more accurate results.
In index() adding the configured OVERVIEW_FILTER query after adding the previous
constraints to num_nodes_query
In inventory() wrapping fact_query in an AndOperator() regardless of environment.
This update makes it more common with other endpoints that only add environment
constraints if an environment is selected.
* requirements.txt: Bumping the pypuppetdb version requirement
* requirements.txt: Bumping pypuppetdb version to new requirement.
* puppetboard/app.py: Fixing module load error.
* puppetboard/app.py: Refactoring the report event counts.
Writing the report event counts code in the node(), reports() and
reports_node() functions to iterate through report.events() instead
of querying the event counts endpoint for each report.
This solution is heavier than the original because we have to query
for all full event objects for each report and iterate through them
to interpret their statuses. I originally wanted to replace the
report.events() function with an events variable for the Report object
but that turned out to be not technically possible presently because
the report extended events' timestamps for in a different format which
python can't interpret. Specifically the timezone values contain ':',
there is no Python 2.x documentation that states timezones containing
colons is supported.
This does, however, lighten our dependency on the event-counts endpoint
which is marked as experimental. Which means that it may change or be
removed in a future release.
This also resolves a silent bug which may or may not include environment
filters on the event-counts queries. report.events() searches the Events
endpoint based on the report hash which eliminates the possibility of
mistaken relationships.
* puppetboard/app.py: Replacing url_for_* functions with a single url_for_field()
The url_for_pagination and url_for_environments functions only worked
with a single, fixed request argument, 'page' and 'env' respectively.
The new url_for_field() excepts 2 arguments, field: the name of the
argument to update, and value: its intended value.
Should consider adding a url_for_fields() function that accepts a
dict argument and updates all the request arguments using a dict.update().
There is currently no requirement for it so it will remain in the backlog.
* puppetboard/templates/reports.html: Adding a dropdown menu to limit the report count
This fixes https://github.com/voxpupuli/puppetboard/issues/202
This new dropdown allows users to select their desired number of reports
on the reports() and reports_node() pages. The available options are
app.config['REPORTS_COUNT'], 25, 50, 100 or All. The default value
is determined by the REPORTS_COUNT configuration value.
Had to modify url_for_field() to merge the request args to the view args
in order to generate the links that include the limit query string.
This (re-)fixes https://github.com/voxpupuli/puppetboard/issues/220
Corner cases where new installations or empty environments will return
zero resources and zero nodes, this will result in a ZeroDivisionError.
Now if this happens setting the average-resources-per-node to zero.
This fixes https://github.com/voxpupuli/puppetboard/issues/234
The report_latest() function was effectively deprecated when PuppetDB
introduced the latest_report_hash field in the Nodes endpoint response
format in version 3.2. With the breaking changes to PuppetDB 4.0.0
support this function can be safely removed.
This fixes https://github.com/voxpupuli/puppetboard/issues/229
This menu provides a very user friendly interface for rendering the pagination
section, which is available in version 2.1.8. Updating the render_pagination
macro use the new HTML classes.
This fixes https://github.com/voxpupuli/puppetboard/issues/230
If there are any connection issues between PuppetBoard and the PuppetDB
instance there wasn't any obvious evidence in log files. This additional
logging added to utils.py logs errors whenever there is an HTTPError,
ConnectionError or EmptyResponseError in get_or_abort.
* puppetboard/app.py: Adding Radiator view
Part 2 of https://github.com/voxpupuli/puppetboard/issues/70
This is a refactoring of the changes in https://github.com/voxpupuli/puppetboard/pull/100.
Adds a simple Heads-Up Display of the last run statuses of managed nodes,
either environment filtered or not.
* puppetboard/app.py: Fixing environment filters and metric strings.
* The names of the population metrics have changes in PuppetDB 4.0, the initial
commit used the metric names from PuppetDB 2.x.
* The main nodes query did not include a query string to filter on environments.