mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 08:46:09 +01:00
bug fix: show mysql status on cent7
This commit is contained in:
@@ -237,19 +237,33 @@ def servicesStatus(request):
|
||||
dockerStatus.append(getServiceStats('docker'))
|
||||
|
||||
# mysql status
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
result = s.connect_ex(('127.0.0.1', 3306))
|
||||
|
||||
if result == 0:
|
||||
sqlStatus.append(1)
|
||||
else:
|
||||
sqlStatus.append(0)
|
||||
s.close()
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
|
||||
|
||||
mysqlResult = ProcessUtilities.outputExecutioner('systemctl status mysql')
|
||||
|
||||
if mysqlResult.find('active (running)') > -1:
|
||||
sqlStatus.append(1)
|
||||
sqlStatus.append(getMemStats('mariadbd'))
|
||||
else:
|
||||
sqlStatus.append(0)
|
||||
sqlStatus.append(0)
|
||||
|
||||
|
||||
if getServiceStats('mysql'):
|
||||
sqlStatus.append(getMemStats('mysql'))
|
||||
else:
|
||||
sqlStatus.append(0)
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
result = s.connect_ex(('127.0.0.1', 3306))
|
||||
|
||||
if result == 0:
|
||||
sqlStatus.append(1)
|
||||
else:
|
||||
sqlStatus.append(0)
|
||||
s.close()
|
||||
|
||||
if getServiceStats('mysql'):
|
||||
sqlStatus.append(getMemStats('mysql'))
|
||||
else:
|
||||
sqlStatus.append(0)
|
||||
|
||||
dnsStatus.append(getServiceStats('pdns'))
|
||||
if getServiceStats('pdns'):
|
||||
|
||||
Reference in New Issue
Block a user