From 4279b71e3a0819138301edbda39281d152a1a53f Mon Sep 17 00:00:00 2001 From: Aidaho12 Date: Tue, 7 Aug 2018 00:08:52 +0600 Subject: [PATCH] v2.8 --- app/overview.py | 13 ++++++++ app/templates/ajax/table_metrics.html | 43 +++++++++++++++++++++++++++ app/templates/ovw.html | 38 +++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 app/templates/ajax/table_metrics.html diff --git a/app/overview.py b/app/overview.py index b1a73d03..9f950a15 100644 --- a/app/overview.py +++ b/app/overview.py @@ -20,6 +20,14 @@ try: users = sql.select_users() groups = sql.select_groups() token = sql.get_token(user_id.value) + cmd = "ps ax |grep checker_mas |grep -v grep |wc -l" + checker_master, stderr = funct.subprocess_execute(cmd) + cmd = "ps ax |grep checker_worker |grep -v grep |wc -l" + checker_worker, stderr = funct.subprocess_execute(cmd) + cmd = "ps ax |grep metrics_master |grep -v grep |wc -l" + metrics_master, stderr = funct.subprocess_execute(cmd) + cmd = "ps ax |grep metrics_worker |grep -v grep |wc -l" + metrics_worker, stderr = funct.subprocess_execute(cmd) except: pass @@ -30,5 +38,10 @@ template = template.render(h2 = 1, user = user, users = users, groups = groups, + metrics_master = ''.join(metrics_master), + metrics_worker = ''.join(metrics_worker), + checker_master = ''.join(checker_master), + checker_worker = ''.join(checker_worker), + error = stderr, token = token) print(template) \ No newline at end of file diff --git a/app/templates/ajax/table_metrics.html b/app/templates/ajax/table_metrics.html new file mode 100644 index 00000000..9e2a93cb --- /dev/null +++ b/app/templates/ajax/table_metrics.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + {% for state in table_stat %} + + + + + + + + + + + + + + + + {% endfor %} +
Metrics
ServerAverage sessionsPeak sessionsAverage connectionsPeak connections
60 minutes24 hours3 days60 minutes24 hours3 days60 minutes24 hours3 days60 minutes24 hours3 days
{{ state.1 }}{{ state.2 }}{{ state.3 }}{{ state.4 }}{{ state.5 }}{{ state.6 }}{{ state.7 }}{{ state.8 }}{{ state.9 }}{{ state.10 }}{{ state.11 }}{{ state.12 }}{{ state.13 }}
\ No newline at end of file diff --git a/app/templates/ovw.html b/app/templates/ovw.html index a7bb86bd..c6f17659 100644 --- a/app/templates/ovw.html +++ b/app/templates/ovw.html @@ -50,6 +50,44 @@ {% endif %} {% endfor %} + + + + + + + + + + + +
+ Tools status +
+ {% if metrics_master|int() >= 1 %} + UP Metrics master + {% else %} + DOWN running {{metrics_master }} master processes + {% endif %} + + {% if metrics_worker|int() >= 1 %} + UP Metrics workers + {% else %} + DOWN Metrics workers + {% endif %} + + {% if checker_master|int() >= 1 %} + UP Checker master + {% else %} + DOWN Checker master + {% endif %} + + {% if checker_worker|int() >= 1 %} + UP Checker workers + {% else %} + DOWN Checker workers + {% endif %} +
{% endif %}