Skip to content

Commit

Permalink
Add view with failures
Browse files Browse the repository at this point in the history
- first error on each node with the last
puppet run failed.
  • Loading branch information
gdubicki committed Feb 21, 2022
1 parent deec226 commit c6d791e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Other settings that might be interesting in no particular order:
to `False` gives performance benefits, especially in big Puppet environments (more than few hundreds of nodes).
Defaults to `True`.
- `DEV_LISTEN_HOST`: For use with dev.py for development. Default is localhost
- `DEV_LISTEN_PORT`: For use with dev.py for development. Default is 5000
- `DEV_LISTEN_PORT`: For use with dev.py for development. Default is 5555

## Getting Help

Expand Down
5 changes: 4 additions & 1 deletion puppetboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import puppetboard.views.radiator # noqa: F401
# noinspection PyUnresolvedReferences
import puppetboard.views.reports # noqa: F401
# noinspection PyUnresolvedReferences
import puppetboard.views.failures # noqa: F401


from puppetboard.core import get_app, get_puppetdb
Expand All @@ -41,14 +43,15 @@

menu_entries = [
('index', 'Overview'),
('failures', 'Failures'),
('nodes', 'Nodes'),
('facts', 'Facts'),
('reports', 'Reports'),
('metrics', 'Metrics'),
('inventory', 'Inventory'),
('catalogs', 'Catalogs'),
('radiator', 'Radiator'),
('query', 'Query')
('query', 'Query'),
]

if not app.config.get('ENABLE_QUERY'):
Expand Down
2 changes: 1 addition & 1 deletion puppetboard/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DEFAULT_ENVIRONMENT = 'production'
SECRET_KEY = os.urandom(24)
DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000
DEV_LISTEN_PORT = 5555
DEV_COFFEE_LOCATION = 'coffee'
UNRESPONSIVE_HOURS = 2
ENABLE_QUERY = True
Expand Down
2 changes: 1 addition & 1 deletion puppetboard/docker_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def coerce_bool(v, default):
DEFAULT_ENVIRONMENT = os.getenv('DEFAULT_ENVIRONMENT', 'production')
SECRET_KEY = os.getenv('SECRET_KEY', os.urandom(24))
DEV_LISTEN_HOST = os.getenv('DEV_LISTEN_HOST', '127.0.0.1')
DEV_LISTEN_PORT = int(os.getenv('DEV_LISTEN_PORT', '5000'))
DEV_LISTEN_PORT = int(os.getenv('DEV_LISTEN_PORT', '5555'))
DEV_COFFEE_LOCATION = os.getenv('DEV_COFFEE_LOCATION', 'coffee')
UNRESPONSIVE_HOURS = int(os.getenv('UNRESPONSIVE_HOURS', '2'))
ENABLE_QUERY = os.getenv('ENABLE_QUERY', 'True')
Expand Down
33 changes: 33 additions & 0 deletions puppetboard/templates/failures.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% extends 'layout.html' %}
{% import '_macros.html' as macros %}
{% block content %}
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
</div>
<table class='ui basic compact sortable fixed wrapped table'>
<thead>
<tr>
<th class="default default-sort">Certname</th>
<th class="date">Report time</th>
<th>Source</th>
<th >Error</th>
</tr>
</thead>
<tbody class="searchable">
{% for failure in failures %}
<tr>
<td><a href="{{url_for('node', env=current_env, node_name=failure.certname)}}">{{failure.certname}}</a></td>
<td rel="utctimestamp">{{failure.timestamp}}</td>
<td>{{failure.source}}</td>
<td>
{% if '\n' in failure.message %}
<pre>{{failure.message}}</pre>
{% else %}
{{failure.message}}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}
Empty file added puppetboard/views/failures.py
Empty file.

0 comments on commit c6d791e

Please sign in to comment.