Changelog: https://roxy-wi.org/changelog.py#6
pull/321/head
Pavel Loginov 3 years ago
parent 6b9f93f1de
commit 1ca8aa3674

@ -8,6 +8,7 @@ log_path = ${fullpath}/log/
haproxy_save_configs_dir = ${main:fullpath}/configs/hap_config/ haproxy_save_configs_dir = ${main:fullpath}/configs/hap_config/
kp_save_configs_dir = ${main:fullpath}/configs/kp_config/ kp_save_configs_dir = ${main:fullpath}/configs/kp_config/
nginx_save_configs_dir = ${main:fullpath}/configs/nginx_config/ nginx_save_configs_dir = ${main:fullpath}/configs/nginx_config/
apache_save_configs_dir = ${main:fullpath}/configs/apache_config/
[mysql] [mysql]
# By default Sqlite DB is used # By default Sqlite DB is used

@ -278,6 +278,9 @@ def update_hapwi_server(server_id, alert, metrics, active, service_name):
elif service_name == 'keepalived': elif service_name == 'keepalived':
update_hapwi = Server.update(keepalived_alert=alert, keepalived_active=active).where( update_hapwi = Server.update(keepalived_alert=alert, keepalived_active=active).where(
Server.server_id == server_id) Server.server_id == server_id)
elif service_name == 'apache':
update_hapwi = Server.update(apache_alert=alert).where(
Server.server_id == server_id)
else: else:
update_hapwi = Server.update(alert=alert, metrics=metrics, active=active).where( update_hapwi = Server.update(alert=alert, metrics=metrics, active=active).where(
Server.server_id == server_id) Server.server_id == server_id)
@ -1888,6 +1891,22 @@ def select_nginx_alert(**kwargs):
return query_res return query_res
def select_apache_alert(**kwargs):
if kwargs.get("group") is not None:
query = Server.select(Server.ip).where(
(Server.apache_alert == 1) &
(Server.enable == 1) &
(Server.groups == kwargs.get('group')))
else:
query = Server.select(Server.ip).where((Server.apache_alert == 1) & (Server.enable == 1))
try:
query_res = query.execute()
except Exception as e:
out_error(e)
else:
return query_res
def select_keepalived_alert(**kwargs): def select_keepalived_alert(**kwargs):
if kwargs.get("group") is not None: if kwargs.get("group") is not None:
query = Server.select(Server.ip).where( query = Server.select(Server.ip).where(

Loading…
Cancel
Save