O'Reilly logo

Django Project Blueprints by Asad Jibran Ahmed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing triggered alerts on the status page

As I said before, we want our users to see any nodes that have an alert triggered highlighted on the status page. Say that they defined an alert for when the disk usage on any node goes beyond 0.85 and the latest data point that we have for dbmaster disk usage has the value 0.9. When the user visits the status page, we would like the row showing the disk usage of the dbmaster node to be highlighted in red so that the user is immediately aware of the alert and is able to take actions to correct this.

Change StatusView in data_collector/view.py to match the following code. The changed bits are highlighted:

class StatusView(TemplateView): template_name = 'status.html' def get_context_data(self, **kwargs): ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required