Pavel Loginov 4 years ago
parent f2de51507a
commit bbda8db94a

@ -53,8 +53,10 @@ for s, v in services_name.items():
service_name = s service_name = s
cmd = "rpm --query haproxy-wi-" + service_name + "-* |awk -F\"" + service_name + "\" '{print $2}' |awk -F\".noa\" '{print $1}' |sed 's/-//1' |sed 's/-/./'" cmd = "rpm --query haproxy-wi-" + service_name + "-* |awk -F\"" + service_name + "\" '{print $2}' |awk -F\".noa\" '{print $1}' |sed 's/-//1' |sed 's/-/./'"
service_ver, stderr = funct.subprocess_execute(cmd) service_ver, stderr = funct.subprocess_execute(cmd)
try:
services.append([s, service_ver[0]]) services.append([s, service_ver[0]])
except Exception:
services.append([s, ''])
haproxy_sock_port = sql.get_setting('haproxy_sock_port') haproxy_sock_port = sql.get_setting('haproxy_sock_port')
servers_with_status1 = [] servers_with_status1 = []

@ -0,0 +1,12 @@
/var/log/haproxy.log {
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

@ -16,7 +16,7 @@ command+=" --non-interactive --agree-tos --email $email --http-01-port=8888"
bash -c "$command" bash -c "$command"
for i in $(ls -d */ |awk -F"/" '{print $1}'); do for i in $(ls -d */ |awk -F"/" '{print $1}'); do
bash -c "cat /etc/letsencrypt/live/$i/fullchain.pem /etc/letsencrypt/live/$i/privkey.pem > $path/$i.pem" bash -c "cat /etc/letsencrypt/live/$i/fullchain.pem /etc/letsencrypt/live/$i/private.pem > $path/$i.pem"
done done
# Reload HAProxy # Reload HAProxy

@ -7,6 +7,9 @@ import platform
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True) env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('admin.html') template = env.get_template('admin.html')
form = funct.form form = funct.form
openvpn_configs = ''
openvpn_sess = ''
openvpn = ''
print('Content-type: text/html\n') print('Content-type: text/html\n')
@ -21,9 +24,9 @@ try:
grafana, stderr = funct.subprocess_execute("service grafana-server status |grep Active |awk '{print $1}'") grafana, stderr = funct.subprocess_execute("service grafana-server status |grep Active |awk '{print $1}'")
services = [] services = []
services_name = {'checker_haproxy': 'Master backends checker service', services_name = {'checker_haproxy': 'Checker backends master service',
'keep_alive': 'Auto start service', 'keep_alive': 'Auto start service',
'metrics_haproxy': 'Master metrics service', 'metrics_haproxy': 'Metrics master service',
'prometheus': 'Prometheus service', 'prometheus': 'Prometheus service',
'grafana-server': 'Grafana service', 'grafana-server': 'Grafana service',
'smon': 'Simple monitoring network ports', 'smon': 'Simple monitoring network ports',
@ -39,10 +42,6 @@ try:
service_ver, stderr = funct.subprocess_execute(cmd) service_ver, stderr = funct.subprocess_execute(cmd)
services.append([s, status, v, service_ver[0]]) services.append([s, status, v, service_ver[0]])
openvpn_configs = ''
openvpn_sess = ''
openvpn = ''
try: try:
os_name = platform.linux_distribution()[0] os_name = platform.linux_distribution()[0]
except Exception: except Exception:

Loading…
Cancel
Save