2020-07-15 04:16:31 +00:00
{% extends "base.html" %}
2023-09-17 09:42:39 +00:00
{% block title %}{{ lang.menu_links.monitoring.smon.admin }}{% endblock %}
{% block h2 %}{{ lang.menu_links.monitoring.smon.admin }}{% endblock %}
2020-07-15 04:16:31 +00:00
{% block content %}
{% from 'include/input_macros.html' import input, checkbox, select %}
2023-09-17 09:42:39 +00:00
< script src = "/inc/smon.js" > < / script >
2020-07-15 04:16:31 +00:00
< script src = "/inc/users.js" > < / script >
< script src = "/inc/fontawesome.min.js" > < / script >
< script src = "/inc/jquery.timeago.js" type = "text/javascript" > < / script >
2024-01-06 08:42:32 +00:00
{% if user_subscription['user_status'] == 0 %}
2022-04-29 10:28:48 +00:00
{% include 'include/no_sub.html' %}
2024-01-06 08:42:32 +00:00
{% elif smon_status in ('failed', 'inactive', 'ERROR') %}
2021-07-15 03:14:13 +00:00
< div style = "text-align: center;" >
2020-10-02 12:39:00 +00:00
< br / >
2023-02-13 14:45:45 +00:00
< h3 > {{lang.smon_page.desc.smon_is_not_run}}< / h3 >
2023-09-17 09:42:39 +00:00
< img src = "{{ url_for('static', filename='images/no_servers.png')}}" alt = "There is no server" >
< h4 > {{lang.smon_page.desc.run_smon}} < a href = "/app/users/services" title = "Roxy-WI services" target = "_blank" > {{lang.words.here}}< / a > {{lang.smon_page.desc.before_use}}< / h4 >
2021-07-15 03:14:13 +00:00
< / div >
2020-07-15 04:16:31 +00:00
{% else %}
2023-06-03 15:04:22 +00:00
< table class = "overview overview-overflow" id = "ajax-smon-http" >
2020-07-15 04:16:31 +00:00
< thead >
2023-06-03 15:04:22 +00:00
< caption > < h3 > HTTP {{lang.words.checking}}< / h3 > < / caption >
2020-07-15 04:16:31 +00:00
< tr class = "overviewHead" >
2023-06-03 15:04:22 +00:00
< th class = "padding10 first-collumn" style = "width: 200px;" > {{lang.words.name|title()}}< / th >
< th style = "width: 15%;" > URL< / th >
2023-02-13 14:45:45 +00:00
< th style = "width: 5%;" > {{lang.words.enabled|title()}}< / th >
< th style = "width: 20%;" > {{lang.words.body|title()}}< / th >
2023-09-03 08:40:42 +00:00
< th style = "width: 20%;" > HTTP {{lang.words.method}}< / th >
2023-05-03 05:46:32 +00:00
< th style = "width: 11%;" > Telegram< / th >
< th style = "width: 11%;" > Slack< / th >
< th style = "width: 11%;" > PagerDuty< / th >
2023-02-13 14:45:45 +00:00
< th style = "width: 10%;" > {{lang.words.group|title()}}< / th >
< th style = "width: 100%;" > {{lang.words.desc|title()}}< / th >
2021-08-02 08:19:22 +00:00
< th > < / th >
2020-07-15 04:16:31 +00:00
< th > < / th >
< / tr >
< / thead >
< tbody >
{% for s in smon %}
2023-06-03 15:04:22 +00:00
{% if s.check_type == 'http' %}
{% for s_service in smon_http %}
{% if s_service.smon_id|string() == s.id|string() %}
< tr id = "smon-http-{{s.id}}" >
2023-07-17 06:15:55 +00:00
{% include 'include/smon/smon_http_server.html' %}
2023-06-03 15:04:22 +00:00
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
< / tbody >
< / table >
< br / > < span class = "add-button" title = "{{lang.words.add|title()}} {{lang.words.w_a}} {{lang.words.new}} {{lang.words.server}}" id = "add-smon-button-http" > + {{lang.words.add|title()}}< / span >
< br / > < br / >
< table class = "overview overview-overflow" id = "ajax-smon-tcp" >
< thead >
< caption > < h3 > TCP/UDP {{lang.words.checking}}< / h3 > < / caption >
< tr class = "overviewHead" >
< th class = "padding10 first-collumn" style = "width: 200px;" > {{lang.words.name|title()}}< / th >
< th style = "width: 15%;" > {{lang.words.Hostname}}< / th >
2023-09-17 09:42:39 +00:00
< th style = "width: 5%;" > {{lang.words.port|title()}}< / th >
2023-06-03 15:04:22 +00:00
< th style = "width: 5%;" > {{lang.words.enabled|title()}}< / th >
2023-11-06 17:47:27 +00:00
< th style = "width: 15%;" > Telegram< / th >
< th style = "width: 15%;" > Slack< / th >
< th style = "width: 15%;" > PagerDuty< / th >
2023-06-03 15:04:22 +00:00
< th style = "width: 10%;" > {{lang.words.group|title()}}< / th >
< th style = "width: 100%;" > {{lang.words.desc|title()}}< / th >
< th > < / th >
< th > < / th >
< / tr >
< / thead >
< tbody >
2024-02-04 07:28:17 +00:00
{% for s in smon %}
{% if s.check_type == 'tcp' %}
{% for s_service in smon_tcp %}
{% if s_service.smon_id|string() == s.id|string() %}
< tr id = "smon-tcp-{{s.id}}" >
{% include 'include/smon/smon_tcp_server.html' %}
{% endif %}
{% endfor %}
{% endif %}
2023-06-03 15:04:22 +00:00
{% endfor %}
2020-07-15 04:16:31 +00:00
< / tbody >
< / table >
2023-06-03 15:04:22 +00:00
< br / > < span class = "add-button" title = "{{lang.words.add|title()}} {{lang.words.w_a}} {{lang.words.new}} {{lang.words.server}}" id = "add-smon-button-tcp" > + {{lang.words.add|title()}}< / span >
< br / > < br / >
< table class = "overview overview-overflow" id = "ajax-smon-ping" style = "margin-bottom: 20px;" >
< thead >
< caption > < h3 > Ping {{lang.words.checking}}< / h3 > < / caption >
< tr class = "overviewHead" >
< th class = "padding10 first-collumn" style = "width: 200px;" > {{lang.words.name|title()}}< / th >
< th style = "width: 15%;" > {{lang.words.Hostname}}< / th >
2023-09-17 09:42:39 +00:00
< th style = "width: 5%; padding-right: 10px;" > {{lang.smon_page.desc.packet_size}}< / th >
2023-06-03 15:04:22 +00:00
< th style = "width: 5%;" > {{lang.words.enabled|title()}}< / th >
< th style = "width: 15%;" > Telegram< / th >
< th style = "width: 15%;" > Slack< / th >
< th style = "width: 15%;" > PagerDuty< / th >
< th style = "width: 10%;" > {{lang.words.group|title()}}< / th >
< th style = "width: 100%;" > {{lang.words.desc|title()}}< / th >
< th > < / th >
< th > < / th >
< / tr >
< / thead >
< tbody >
{% for s in smon %}
{% if s.check_type == 'ping' %}
{% for s_service in smon_ping %}
{% if s_service.smon_id|string() == s.id|string() %}
< tr id = "smon-ping-{{s.id}}" >
2023-07-17 06:15:55 +00:00
{% include 'include/smon/smon_ping_server.html' %}
2023-06-03 15:04:22 +00:00
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
< / tbody >
< / table >
< br / > < span class = "add-button" title = "{{lang.words.add|title()}} {{lang.words.w_a}} {{lang.words.new}} {{lang.words.server}}" id = "add-smon-button-ping" > + {{lang.words.add|title()}}< / span >
2020-07-15 04:16:31 +00:00
< br / > < br / >
2023-06-16 03:51:26 +00:00
< table class = "overview overview-overflow" id = "ajax-smon-dns" style = "margin-bottom: 20px;" >
< thead >
< caption > < h3 > DNS {{lang.words.checking}}< / h3 > < / caption >
< tr class = "overviewHead" >
< th class = "padding10 first-collumn" style = "width: 200px;" > {{lang.words.name|title()}}< / th >
< th style = "width: 15%;" > {{lang.words.Hostname}}< / th >
< th style = "width: 15%;" > Resolver {{lang.words.server}}< / th >
< th style = "width: 5%;" > {{lang.words.port|title()}}< / th >
< th style = "width: 10%;" > {{lang.phrases.resource_record_type}}< / th >
< th style = "width: 5%;" > {{lang.words.enabled|title()}}< / th >
< th style = "width: 15%;" > Telegram< / th >
< th style = "width: 15%;" > Slack< / th >
2023-09-17 09:42:39 +00:00
< th style = "width: 10%;" > PagerDuty< / th >
2023-06-16 03:51:26 +00:00
< th style = "width: 10%;" > {{lang.words.group|title()}}< / th >
< th style = "width: 100%;" > {{lang.words.desc|title()}}< / th >
< th > < / th >
< th > < / th >
< / tr >
< / thead >
< tbody >
{% for s in smon %}
{% if s.check_type == 'dns' %}
{% for s_service in smon_dns %}
{% if s_service.smon_id|string() == s.id|string() %}
< tr id = "smon-dns-{{s.id}}" >
2023-07-17 06:15:55 +00:00
{% include 'include/smon/smon_dns_server.html' %}
2023-06-16 03:51:26 +00:00
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
< / tbody >
< / table >
< br / > < span class = "add-button" title = "{{lang.words.add|title()}} {{lang.words.w_a}} {{lang.words.new}} {{lang.words.server}}" id = "add-smon-button-dns" > + {{lang.words.add|title()}}< / span >
< br / > < br / >
2020-07-15 04:16:31 +00:00
< div id = "ajax" > < / div >
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
2023-02-13 14:45:45 +00:00
{{lang.phrases.read_about_parameters}} < a href = "https://roxy-wi.org/services/smon" title = "SMON service description" target = "_blank" > {{lang.words.here}}< / a >
2020-07-15 04:16:31 +00:00
< / div >
2023-09-17 09:42:39 +00:00
< div id = "smon-add-table" style = "display: none;" >
2023-03-19 15:51:58 +00:00
< table class = "overview" id = "smon-add-table-overview" title = "{{lang.words.create|title()}} {{lang.words.w_a}} {{lang.words.new}} {{lang.words.server}} {{lang.words.for}} {{lang.words.monitoring}}" >
2021-07-15 03:14:13 +00:00
{% include 'include/tr_validate_tips.html' %}
2020-07-15 04:16:31 +00:00
< tr >
< td class = "padding20" >
2023-06-03 15:04:22 +00:00
{{lang.words.name|title()}}
2020-07-15 04:16:31 +00:00
< span class = "need-field" > *< / span >
< / td >
< td >
2023-06-03 15:04:22 +00:00
{{ input('new-smon-name') }}
2020-07-15 04:16:31 +00:00
< / td >
< / tr >
< tr >
2023-06-03 15:04:22 +00:00
< td class = "padding20" >
{{lang.words.checking|title()}}
< span class = "need-field" > *< / span >
< / td >
< td >
2023-06-16 03:51:26 +00:00
{% set check_types = {'dns': 'DNS', 'ping': 'Ping', 'tcp': 'TCP/UDP', 'http': 'HTTP(s)'} %}
2023-06-03 15:04:22 +00:00
{{ select('check_type', values=check_types, selected='http') }}
< / td >
< / tr >
< tr class = "new_smon_hostname" >
< td class = "padding20" >
{{lang.words.Hostname}}
< span class = "need-field" > *< / span >
< / td >
< td >
{{ input('new-smon-ip') }}
< / td >
< / tr >
2023-07-03 09:15:39 +00:00
< tr class = "smon_ping_check" >
< td class = "padding20" >
{{lang.smon_page.desc.packet_size}}
< span class = "need-field" > *< / span >
< / td >
< td >
2023-07-17 06:15:55 +00:00
{{ input('new-smon-packet_size', value='56', type='number', placeholder='56') }}
2023-07-03 09:15:39 +00:00
< / td >
< / tr >
2023-06-16 03:51:26 +00:00
< tr class = "smon_dns_check" >
2020-07-15 04:16:31 +00:00
< td class = "padding20" >
2023-06-16 03:51:26 +00:00
Resolver {{lang.words.server}}
2020-07-15 04:16:31 +00:00
< span class = "need-field" > *< / span >
< / td >
< td >
2023-06-16 03:51:26 +00:00
{{ input('new-smon-resolver-server', value='8.8.8.8') }}
2020-07-15 04:16:31 +00:00
< / td >
< / tr >
2023-06-16 03:51:26 +00:00
< tr class = "smon_tcp_check smon_dns_check" >
< td class = "padding20" >
{{lang.words.port|title()}}
< span class = "need-field" > *< / span >
< / td >
2020-07-15 04:16:31 +00:00
< td >
2023-06-16 03:51:26 +00:00
{{ input('new-smon-port', type='number', size='4') }}
2020-07-15 04:16:31 +00:00
< / td >
< / tr >
2023-06-03 15:04:22 +00:00
< tr class = "smon_http_check" >
2023-06-16 03:51:26 +00:00
< td class = "padding20" >
URL
< span class = "need-field" > *< / span >
< / td >
2023-06-03 15:04:22 +00:00
< td > {{ input('new-smon-url', value='https://', title='proto://url[:port]/') }}< / td >
2020-07-15 04:16:31 +00:00
< / tr >
2023-06-03 15:04:22 +00:00
< tr class = "smon_http_check" >
2023-02-13 14:45:45 +00:00
< td class = "padding20" > {{lang.words.body|title()}}< / td >
2021-07-15 03:14:13 +00:00
< td > {{ input('new-smon-body') }}< / td >
2020-07-15 04:16:31 +00:00
< / tr >
2023-09-03 08:40:42 +00:00
< tr class = "smon_http_check" >
< td class = "padding20" > HTTP {{lang.words.method}}< / td >
< td >
{% set http_methods = {'get': 'GET', 'post': 'POST', 'put': 'PUT', 'patch': 'PATCH', 'delete': 'DELETE',
'head': 'HEAD', 'options': 'OPTIONS'} %}
{{ select('new-smon-method', values=http_methods, selected='get') }}
< / td >
< / tr >
2023-06-16 03:51:26 +00:00
< tr >
< td class = "padding20" > {{lang.words.enable|title()}}< / td >
< td >
{{ checkbox('new-smon-enable', checked='checked') }}
< / td >
< / tr >
< tr class = "smon_dns_check" >
< td class = "padding20" >
{{lang.phrases.resource_record_type}}
< span class = "need-field" > *< / span >
< / td >
< td >
{% set check_types = {'a': 'A', 'aaa': 'AAA', 'caa': 'CAA', 'cname': 'CNAME', 'mx': 'MX', 'ns': 'NS',
'ptr': 'PTR', 'sao': 'SAO', 'srv': 'SRV', 'txt': 'TXT'} %}
{{ select('new-smon-dns_record_type', values=check_types, selected='a') }}
< / td >
< / tr >
2020-07-15 04:16:31 +00:00
< tr >
2021-07-15 03:14:13 +00:00
< td class = "padding20" > Telegram< / td >
2020-07-15 04:16:31 +00:00
< td >
< select id = "new-smon-telegram" >
2023-02-13 14:45:45 +00:00
< option value = "0" > {{lang.words.disabled|title()}}< / option >
2020-07-15 04:16:31 +00:00
{% for t in telegrams %}
2021-08-02 08:19:22 +00:00
< option value = "{{t.id}}" > {{t.chanel_name}}< / option >
2020-07-15 04:16:31 +00:00
{% endfor %}
< / select >
< / td >
< / tr >
2022-02-16 07:46:30 +00:00
< tr >
< td class = "padding20" > Slack< / td >
< td >
< select id = "new-smon-slack" >
2023-02-13 14:45:45 +00:00
< option value = "0" > {{lang.words.disabled|title()}}< / option >
2022-02-16 07:46:30 +00:00
{% for t in slacks %}
< option value = "{{t.id}}" > {{t.chanel_name}}< / option >
{% endfor %}
< / select >
< / td >
< / tr >
2023-05-03 05:46:32 +00:00
< tr >
< td class = "padding20" > PagerDuty< / td >
< td >
< select id = "new-smon-pd" >
< option value = "0" > {{lang.words.disabled|title()}}< / option >
{% for t in pds %}
< option value = "{{t.id}}" > {{t.chanel_name}}< / option >
{% endfor %}
< / select >
< / td >
< / tr >
2020-07-15 04:16:31 +00:00
< tr >
2023-02-13 14:45:45 +00:00
< td class = "padding20" > {{lang.words.group|title()}}< / td >
2021-07-15 03:14:13 +00:00
< td > {{ input('new-smon-group') }}< / td >
2020-07-15 04:16:31 +00:00
< / tr >
< tr >
2023-02-13 14:45:45 +00:00
< td class = "padding20" > {{lang.words.desc|title()}}< / td >
2021-07-15 03:14:13 +00:00
< td > {{ input('new-smon-description') }}< / td >
2020-07-15 04:16:31 +00:00
< / tr >
< / table >
{% include 'include/del_confirm.html' %}
< / div >
{% endif %}
2023-09-17 09:42:39 +00:00
{% endblock %}