diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Reporting/templates/config_items/common.html | 1 | ||||
-rw-r--r-- | src/lib/Bcfg2/Reporting/urls.py | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Reporting/views.py | 10 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Reporting/templates/config_items/common.html b/src/lib/Bcfg2/Reporting/templates/config_items/common.html index b39957a2e..57191ec39 100644 --- a/src/lib/Bcfg2/Reporting/templates/config_items/common.html +++ b/src/lib/Bcfg2/Reporting/templates/config_items/common.html @@ -9,6 +9,7 @@ {% block pagebanner %}Common configuration problems{% endblock %} {% block content %} + {% filter_navigator %} <div id='threshold_box'> <form method='post' action='{{ request.path }}'> <span>Showing items with more then {{ threshold }} entries</span> diff --git a/src/lib/Bcfg2/Reporting/urls.py b/src/lib/Bcfg2/Reporting/urls.py index b8f242b01..8330fef7b 100644 --- a/src/lib/Bcfg2/Reporting/urls.py +++ b/src/lib/Bcfg2/Reporting/urls.py @@ -27,6 +27,8 @@ urlpatterns += patterns('Bcfg2.Reporting', *timeviewUrls( (r'^summary/?$', 'views.display_summary', None, 'reports_summary'), (r'^timing/?$', 'views.display_timing', None, 'reports_timing'), + (r'^common/group/(?P<group>[^/]+)/(?P<threshold>\d+)/?$', 'views.common_problems', None, 'reports_common_problems'), + (r'^common/group/(?P<group>[^/]+)+/?$', 'views.common_problems', None, 'reports_common_problems'), (r'^common/(?P<threshold>\d+)/?$', 'views.common_problems', None, 'reports_common_problems'), (r'^common/?$', 'views.common_problems', None, 'reports_common_problems'), )) diff --git a/src/lib/Bcfg2/Reporting/views.py b/src/lib/Bcfg2/Reporting/views.py index 0e9bd6502..9191c1f27 100644 --- a/src/lib/Bcfg2/Reporting/views.py +++ b/src/lib/Bcfg2/Reporting/views.py @@ -224,7 +224,7 @@ def entry_status(request, entry_type, pk, timestamp=None, **kwargs): @timeview -def common_problems(request, timestamp=None, threshold=None): +def common_problems(request, timestamp=None, threshold=None, group=None): """Mine config entries""" if request.method == 'POST': @@ -243,7 +243,13 @@ def common_problems(request, timestamp=None, threshold=None): except: threshold = 10 - current_clients = Interaction.objects.recent_ids(timestamp) + if group: + group_obj = get_object_or_404(Group, name=group) + current_clients = [inter[0] for inter in \ + Interaction.objects.recent(timestamp)\ + .filter(groups=group_obj).values_list('id')] + else: + current_clients = Interaction.objects.recent_ids(timestamp) lists = [] for etype in ActionEntry, PackageEntry, PathEntry, ServiceEntry: ldata = etype.objects.exclude(state=TYPE_GOOD).filter( |