Pavel Loginov 2022-05-28 11:05:17 +03:00
parent 3c1dabda16
commit 2b74cb3e6a
2 changed files with 15 additions and 15 deletions

View File

@ -129,9 +129,9 @@ def default_values():
{'param': 'apache_container_name', 'value': 'apache', 'section': 'apache',
'desc': 'Docker container name for Apache service', 'group': '1'},
{'param': 'keepalived_config_path', 'value': '/etc/keepalived/keepalived.conf', 'section': 'keepalived',
'desc': 'Path to the main Keepalived configuration file', 'group': '1'},
'desc': 'Path to the main Keepalived configuration file', 'group': '1'},
{'param': 'keepalived_path_logs', 'value': '/var/log/keepalived/', 'section': 'keepalived',
'desc': 'The path for Keepalived logs', 'group': '1'},
'desc': 'The path for Keepalived logs', 'group': '1'},
]
try:
Setting.insert_many(data_source).on_conflict_ignore().execute()
@ -579,24 +579,24 @@ def update_db_v_5_3_0(**kwargs):
{'param': 'haproxy_container_name', 'value': 'haproxy', 'section': 'haproxy',
'desc': 'Docker container name for HAProxy service', 'group': g.group_id},
{'param': 'maxmind_key', 'value': '', 'section': 'haproxy',
'desc': 'License key for downloading GeoIP DB. You can create it on maxmind.com',
'group': g.group_id},
'desc': 'License key for downloading GeoIP DB. You can create it on maxmind.com',
'group': g.group_id},
{'param': 'apache_path_logs', 'value': '/var/log/httpd/', 'section': 'apache',
'desc': 'The path for Apache logs', 'group': g.group_id},
{'param': 'apache_stats_user', 'value': 'admin', 'section': 'apache',
'desc': 'Username for accessing Apache stats page', 'group': g.group_id},
{'param': 'apache_stats_password', 'value': 'password', 'section': 'apache',
'desc': 'Password for Apache stats webpage', 'group': g.group_id},
'desc': 'Password for Apache stats webpage', 'group': g.group_id},
{'param': 'apache_stats_port', 'value': '8087', 'section': 'apache', 'desc': 'Stats port for webpage Apache',
'group': g.group_id},
'group': g.group_id},
{'param': 'apache_stats_page', 'value': 'stats', 'section': 'apache', 'desc': 'URI Stats for webpage Apache',
'group': g.group_id},
'group': g.group_id},
{'param': 'apache_dir', 'value': '/etc/httpd/', 'section': 'apache',
'desc': 'Path to the Apache directory with config files', 'group': g.group_id},
'desc': 'Path to the Apache directory with config files', 'group': g.group_id},
{'param': 'apache_config_path', 'value': '/etc/httpd/conf/httpd.conf', 'section': 'apache',
'desc': 'Path to the main Apache configuration file', 'group': g.group_id},
'desc': 'Path to the main Apache configuration file', 'group': g.group_id},
{'param': 'apache_container_name', 'value': 'apache', 'section': 'apache',
'desc': 'Docker container name for Apache service', 'group': g.group_id},
'desc': 'Docker container name for Apache service', 'group': g.group_id},
{'param': 'keepalived_config_path', 'value': '/etc/keepalived/keepalived.conf', 'section': 'keepalived',
'desc': 'Path to the main Keepalived configuration file', 'group': g.group_id},
{'param': 'keepalived_path_logs', 'value': '/var/log/keepalived/', 'section': 'keepalived',

View File

@ -168,8 +168,8 @@ def add_setting_for_new_group(group_id):
{'param': 'haproxy_sock_port', 'value': '1999', 'section': 'haproxy', 'desc': 'Socket port for HAProxy',
'group': group_id},
{'param': 'maxmind_key', 'value': '', 'section': 'haproxy',
'desc': 'License key for downloading GeoIP DB. You can create it on maxmind.com',
'group': g.group_id},
'desc': 'License key for downloading GeoIP DB. You can create it on maxmind.com',
'group': g.group_id},
{'param': 'nginx_path_logs', 'value': '/var/log/nginx/', 'section': 'nginx',
'desc': 'NGINX error log', 'group': group_id},
{'param': 'nginx_stats_user', 'value': 'admin', 'section': 'nginx',
@ -224,9 +224,9 @@ def add_setting_for_new_group(group_id):
{'param': 'apache_container_name', 'value': 'apache', 'section': 'apache',
'desc': 'Docker container name for Apache service', 'group': group_id},
{'param': 'keepalived_config_path', 'value': '/etc/keepalived/keepalived.conf', 'section': 'keepalived',
'desc': 'Path to the main Keepalived configuration file', 'group': g.group_id},
'desc': 'Path to the main Keepalived configuration file', 'group': g.group_id},
{'param': 'keepalived_path_logs', 'value': '/var/log/keepalived/', 'section': 'keepalived',
'desc': 'The path for Keepalived logs', 'group': g.group_id},
'desc': 'The path for Keepalived logs', 'group': g.group_id},
]
try:
@ -2461,7 +2461,7 @@ def select_all_alerts_for_all():
sql = """ select level, message, `date`, user_group from alerts where `date` <= (now()+ INTERVAL 10 second) """
else:
sql = """ select level, message, `date`, user_group from alerts where `date` >= datetime('now', '-10 second', 'localtime')
and `date` <= datetime('now', 'localtime') ; """
and `date` <= datetime('now', 'localtime') ; """
try:
cursor.execute(sql)
except Exception as e: