{%- extends "_layout.html" %} {%- block content %}
{%- if mentat_status and mentat_modules and mentat_cronjobs and mentat_runlogs %}

{{ _('Overall status:')}} {{ mentat_status['result'][1] }}

{{ _('Information gathered at:') }} {{ babel_format_datetime(mentat_status['dt']) }}


{{ _('Real-time message processing modules') }}

{{ _('Overall status:')}} {{ mentat_status['resultm'][1] }}

    {%- for modname, moddata in mentat_modules.items() %}
  • {{ modname }}: {{ mentat_status['modules'][modname][1] }}
  • {%- endfor %}

{{ _('Cronjob message post-processing modules') }}

{{ _('Overall status:')}} {{ mentat_status['resultc'][1] }}

    {%- for modname, moddata in mentat_cronjobs.items() %}
  • {{ modname }}: {{ mentat_status['cronjobs'][modname][1] }}
  • {%- endfor %}
{%- if mentat_status['messages']['error'] or mentat_status['messages']['info'] or mentat_status['messages']['notice'] or mentat_status['messages']['warning'] %}

{{ _('Messages:') }}

{%- for msgtype in ['error', 'warning', 'notice', 'info'] %} {%- for msg in mentat_status['messages'][msgtype] %} {%- call macros_site.render_alert(msgtype) %} {{ msg[0] }} {%- endcall %} {%- endfor %} {%- endfor %} {%- endif %}

{{ _('Real-time message processing modules') }}

{%- for modname, moddata in mentat_modules.items() %}
{{ modname }}

{{ _('Module status:')}}
{{ mentat_status['modules'][modname][1] }}

{%- if modname in mentat_status['runlog_files'] %} {%- for rlf_key, rlf_data in mentat_status['runlog_files'][modname].items() %}

{{ _('Module runlog file:')}}
{{ _('PID:') }} {{ rlf_data['data']['pid'] }} | {{ _('File:') }} {{ rlf_data['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(rlf_data['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(rlf_data['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - rlf_data['mtime'])) }}) {%- for component_stats in rlf_data['data']['statistics']['components']|dictsort %} {%- for stats_counter in component_stats[1]|dictsort %} {%- if stats_counter[1] is number %} {%- endif %} {%- endfor %} {%- endfor %}
{{ component_stats[0] }}.{{ stats_counter[0] }}   {{ stats_counter[1] }}

{%- endfor %} {%- endif %} {%- if modname in mentat_status['pid_files'] %}

{{ _('Module PID files:')}}
{%- for pid, piddata in mentat_status['pid_files'][modname].items() %} {{ _('PID:') }} {{ piddata['pid'] }} | {{ _('File:') }} {{ piddata['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(piddata['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(piddata['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - piddata['mtime'])) }}) {%- if not loop.last %}
{%- endif %} {%- endfor %}

{%- endif %} {%- if modname in mentat_status['processes'] %}

{{ _('Module processes:')}}
{%- for pid, psdata in mentat_status['processes'][modname].items() %} {{ _('PID:') }} {{ psdata['pid'] }} | {{ _('Process:') }} {{ psdata['process'] }} {{ psdata['exec'] }}{% if psdata['args'] %}{{ psdata['args'] }}{% endif %} {%- if not loop.last %}
{%- endif %} {%- endfor %}

{%- endif %} {%- if modname in mentat_status['log_files'] %}

{{ _('Module log file:')}}
{{ _('File:') }} {{ mentat_status['log_files'][modname]['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(mentat_status['log_files'][modname]['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(mentat_status['log_files'][modname]['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - mentat_status['log_files'][modname]['mtime'])) }})

{%- endif %} {%- if not loop.last %}
{%- endif %} {%- endfor %}

{{ _('Cronjob message post-processing modules') }}

{%- for modname, moddata in mentat_cronjobs.items() %}
{{ modname }}

{{ _('Module status:')}}
{{ mentat_status['cronjobs'][modname][1] }}

{%- if modname in mentat_status['log_files'] %}

{{ _('Module log file:')}}
{{ _('File:') }} {{ mentat_status['log_files'][modname]['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(mentat_status['log_files'][modname]['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(mentat_status['log_files'][modname]['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - mentat_status['log_files'][modname]['mtime'])) }})

{%- endif %} {%- if modname in mentat_status['cron_files'] %}

{{ _('Module cron file:')}}
{{ _('File:') }} {{ mentat_status['cron_files'][modname]['path'] }} | {{ _('Link:') }} {{ mentat_status['cron_files'][modname]['link'] }} | {{ _('Size:') }} {{ babel_format_bytes(mentat_status['cron_files'][modname]['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(mentat_status['cron_files'][modname]['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - mentat_status['cron_files'][modname]['mtime'])) }})

{%- endif %} {%- if modname in mentat_status['processes'] %}

{{ _('Module processes:')}}
{%- for pid, psdata in mentat_status['processes'][modname].items() %} {{ _('PID:') }} {{ psdata['pid'] }} | {{ _('Process:') }} {{ psdata['process'] }} {{ psdata['exec'] }}{% if psdata['args'] %}{{ psdata['args'] }}{% endif %} {%- if not loop.last %}
{%- endif %} {%- endfor %}

{%- endif %} {%- if not loop.last %}
{%- endif %} {%- endfor %}

    {%- for modname, moddata in mentat_status['log_files'].items() %}
  • {{ modname }}

    {{ _('File:') }} {{ moddata['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(moddata['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(moddata['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - moddata['mtime'])) }})

  • {%- endfor %}

    {%- for modname, moddata in mentat_status['pid_files'].items() %}
  • {{ modname }}

    {%- for pid, piddata in moddata.items() %}

    {{ _('PID:') }} {{ piddata['pid'] }} | {{ _('File:') }} {{ piddata['path'] }} | {{ _('Size:') }} {{ babel_format_bytes(piddata['size'], 'B') }} | {{ _('Last modification at:') }} {{ babel_format_datetime(piddata['mtime']) }} ({{ _('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - piddata['mtime'])) }})

    {%- endfor %}
  • {%- endfor %}

    {%- for modname, moddata in mentat_status['processes'].items() %}
  • {{ modname }}

    {%- for pid, psdata in moddata.items() %}

    {{ _('PID:') }} {{ psdata['pid'] }} | {{ _('Process:') }} {{ psdata['process'] }} {{ psdata['exec'] }}{% if psdata['args'] %}{{ psdata['args'] }}{% endif %}

    {%- endfor %}
  • {%- endfor %}
{%- if permission_can('developer') %}

Mentat status:

{% highlight 'json' %}{{ mentat_status | tojson_pretty }}{% endhighlight %}
{%- endif %} {%- else %}

{{ _('Unable to display system status information.') }} {%- endif %}

{%- endblock content %}