Pavel Loginov 2022-05-28 14:10:35 +03:00
parent bcb87c3d83
commit 384e6cc5fc
2 changed files with 16 additions and 15 deletions

View File

@ -157,7 +157,9 @@ def get_status(server_id, service):
data = return_dict_from_out(server_id, out[0])
elif service == 'nginx':
cmd = [
"/usr/sbin/nginx -v 2>&1|awk '{print $3}' && systemctl status nginx |grep -e 'Active' |awk '{print $2, $9$10$11$12$13}' && ps ax |grep nginx:|grep -v grep |wc -l"]
"/usr/sbin/nginx -v 2>&1|awk '{print $3}' && systemctl status nginx |grep -e 'Active' "
"|awk '{print $2, $9$10$11$12$13}' && ps ax |grep nginx:|grep -v grep |wc -l"
]
try:
out = funct.ssh_command(s[2], cmd)
out1 = out.split()
@ -265,12 +267,11 @@ def runtime(server_id):
def show_backends(server_id):
data = {}
try:
servers = check_permit_to_server(server_id)
for s in servers:
out = funct.show_backends(s[2], ret=1)
funct.show_backends(s[2], ret=1)
data = {server_id: out}
@ -292,7 +293,7 @@ def get_config(server_id, **kwargs):
for s in servers:
cfg = '/tmp/' + s[2] + '.cfg'
out = funct.get_config(s[2], cfg, service=service, config_file_name=kwargs.get('config_path'))
funct.get_config(s[2], cfg, service=service, config_file_name=kwargs.get('config_path'))
os.system("sed -i 's/\\n/\n/g' " + cfg)
try:
conf = open(cfg, "r")

View File

@ -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': 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': group_id},
]
try: