{% extends "layout.html" %} {% block content %}

System Health Check

System diagnostics and event monitoring

Back to Dashboard

System Status

{% if health_summary.health_status == 'healthy' %} {% elif health_summary.health_status == 'issues' %} {% else %} {% endif %}

Overall Health

{{ health_summary.health_status|title }}

{% if health_summary.health_status == 'healthy' %} All systems running normally {% elif health_summary.health_status == 'issues' %} Minor issues detected {% else %} Critical issues require attention {% endif %}
{% if db_healthy %}{% else %}{% endif %}

Database

{% if db_healthy %}Connected{% else %}Error{% endif %}

{% if db_healthy %} PostgreSQL connection active {% else %} {{ db_error }} {% endif %}

Uptime

{{ uptime_duration.days }}d {{ uptime_duration.seconds//3600 }}h {{ (uptime_duration.seconds//60)%60 }}m

Since first recorded event

Event Statistics

{{ health_summary.errors_24h }}

Errors (24h)

{{ health_summary.warnings_24h }}

Warnings (24h)

{{ today_events }}

Events Today

{{ health_summary.total_events_week }}

Events This Week

{% if errors %}

Recent Errors

{% for error in errors %}
{{ error.event_type }} {{ error.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ error.description }}
{% if error.user %}
User: {{ error.user.username }}
{% endif %} {% if error.company %}
Company: {{ error.company.name }}
{% endif %}
{% endfor %}
{% endif %} {% if warnings %}

Recent Warnings

{% for warning in warnings %}
{{ warning.event_type }} {{ warning.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ warning.description }}
{% if warning.user %}
User: {{ warning.user.username }}
{% endif %} {% if warning.company %}
Company: {{ warning.company.name }}
{% endif %}
{% endfor %}
{% endif %}

System Event Log (Last 7 Days)

{% for event in recent_events %}
{{ event.event_type }} {{ event.event_category }} {{ event.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ event.description }}
{% if event.user %}
User: {{ event.user.username }}
{% endif %} {% if event.company %}
Company: {{ event.company.name }}
{% endif %} {% if event.ip_address %}
IP: {{ event.ip_address }}
{% endif %}
{% endfor %}
{% if health_summary.last_error %}

🔍 Last Critical Error

{{ health_summary.last_error.event_type }}

{{ health_summary.last_error.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ health_summary.last_error.description }}
{% if health_summary.last_error.event_metadata %} {% endif %}
{% endif %}
{% endblock %}