nezha 测试OK

This commit is contained in:
midoks
2023-06-28 01:02:58 +08:00
parent fe2df6cc8d
commit ced48bab47
3 changed files with 210 additions and 48 deletions
+15
View File
@@ -264,6 +264,21 @@ class App:
mw.execShell('systemctl disable nezha')
return 'ok'
def initd_status_agent(self):
cmd = 'systemctl status nezha-agent | grep loaded | grep "enabled;"'
data = mw.execShell(cmd)
if data[0] == '':
return 'fail'
return 'ok'
def initd_install_agent(self):
mw.execShell('systemctl enable nezha-agent')
return 'ok'
def initd_uinstall_agent(self):
mw.execShell('systemctl disable nezha-agent')
return 'ok'
def conf(self):
return self.getServerDir() + '/dashboard/data/config.yaml'