<commit_before>{% extends "base_status.html" %}

{% block title %}Error{% endblock %}
{% block smallheader %}{% endblock %}
{% block largeheader %}Oh no, something went wrong ☹{% endblock %}

{% block nav1 %}{{ block.super }}{% endblock %}
{% load adagiostags %}

{% block content %}

    <div id="friendly_livestatus_message" class=hide>
        {% if not nagios_running %}
            We can't find a running nagios instance. Make sure nagios is running and adagios can connect to it.
            <ul>
                <li>
                    check that nagios is in fact running, if sudoers.d is correctly configured, you can start it <a href="{% url misc.views.nagios_service %}">here</a>
                </li>
                <li>
                    Please verify your <a href="{% url misc.views.settings %}">settings</a> and check all paths are valid.
                </li>

            </ul>
        {% endif %}
        {% if nagios_running and not num_problems %}
            Adagios cannot connect to livestatus. Don't worry, you can still use the other parts of Adagios,
            but to get the status part to work check the following:
            <ul>
                <li>Is <a href="http://mathias-kettner.de/checkmk_livestatus.html">mk-livestatus</a> installed ?</li>
                <li>Does <a href="{% url objectbrowser.views.edit_nagios_cfg %}">nagios.cfg</a> have a broker_module= line that loads mk-livestatus ?</li>
                <li>Are there any errors related to livestatus in  <a href="{% url status.views.status_log %}?search=livestatus">nagios logfiles</a> ?</li>
            </ul>

            Install instructions for rpm-based systems:
            <pre>
yum --enablerepo=ok-testing install mk-livestatus
pynag config --append "broker_module=/usr/lib64/mk-livestatus/livestatus.o /var/spool/nagios/cmd/livestatus"
service nagios reload
            </pre>
            Install instructions for debian-based systems:
            <pre>
apt-get install check-mk-livestatus
pynag config --append "broker_module=/usr/lib/check_mk/livestatus.o /var/lib/nagios3/rw/livestatus"
service nagios3 reload
            </pre>
        {% endif %}
        <hr>
    </div>


    {% if exception %}
        <div id="error_message" class="alert alert-danger">
            <b>{{ exception_type }}</b>: {{ exception }}
        </div>
    {% endif %}


    <button id="debug_button" class="btn" onclick="$('#traceback').toggle(); $('#debug_button').toggle();">show debug information</button><commit_msg>Better error if nagios is not installed<commit_after>{% extends "base_status.html" %}

{% block title %}Error{% endblock %}
{% block smallheader %}{% endblock %}
{% block largeheader %}Oh no, something went wrong ☹{% endblock %}

{% block nav1 %}{{ block.super }}{% endblock %}
{% load adagiostags %}

{% block content %}

    <div id="friendly_livestatus_message" class=hide>
        {% if not nagios_running %}
            We can't find a running nagios instance. Make sure nagios is running and adagios can connect to it.
            <ul>
                <li>
                    check that nagios is in fact running, if sudoers.d is correctly configured, you can start it <a href="{% url misc.views.nagios_service %}">here</a>
                </li>
                <li>
                    Please verify your <a href="{% url misc.views.settings %}">settings</a> and check all paths are valid.
                </li>

            </ul>
        {% endif %}
        {% if nagios_running and not num_problems %}
            Adagios cannot connect to livestatus. Don't worry, you can still use the other parts of Adagios,
            but to get the status part to work check the following:
            <ul>
                <li>Is <a href="http://mathias-kettner.de/checkmk_livestatus.html">mk-livestatus</a> installed ?</li>
                <li>Does <a href="{% url objectbrowser.views.edit_nagios_cfg %}">nagios.cfg</a> have a broker_module= line that loads mk-livestatus ?</li>
                <li>Are there any errors related to livestatus in  <a href="{% url status.views.status_log %}?search=livestatus">nagios logfiles</a> ?</li>
            </ul>

            Install instructions for rpm-based systems:
            <pre>
yum --enablerepo=ok-testing install mk-livestatus
pynag config --append "broker_module=/usr/lib64/mk-livestatus/livestatus.o /var/spool/nagios/cmd/livestatus"
service nagios reload
            </pre>
            Install instructions for debian-based systems:
            <pre>
apt-get install check-mk-livestatus
pynag config --append "broker_module=/usr/lib/check_mk/livestatus.o /var/lib/nagios3/rw/livestatus"
service nagios3 reload
            </pre>
        {% endif %}
        <hr>
    </div>


    {% if exception %}
        <div id="error_message" class="alert alert-danger">
            <b>{{ exception_type }}</b>: {{ exception }}
        </div>
    {% endif %}

    {% if exception_type == "ConfigFileNotFound" %}
        <p>
        So! Adagios is up and running. But you need to install and configure a monitoring engine.
        </p>
        <p>
            If Nagios (or a compatible engine like Icinga, Shinken or Naemon) is already installed.
            You should head over to <a href="{% url adagios.misc.views.settings %}">settings page</a> and
            configure right paths.
        </p>
        <p>
            If you don't have a monitoring engine installed you should take a look at our
            <a href="http://adagios.org">installation instructions</a> to get started.
        </p>

        <hr>
    {% endif %}


    <button id="debug_button" class="btn" onclick="$('#traceback').toggle(); $('#debug_button').toggle();">show debug information</button>
{'fraction_non_alphanumeric': 0.12748864827104436, 'fraction_numerical': 0.0017464198393293748, 'mean_word_length': 2.3510825043885313, 'pattern_counts': {'":': 0, '<': 88, '<?xml version=': 0, '>': 88, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5439208', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1664, 'n_words': 524}