Update index.py

This commit is contained in:
Mr Chen 2024-07-19 14:58:18 +08:00
parent 2da9b59ae9
commit 15096e7954
1 changed files with 10 additions and 1 deletions

View File

@ -110,10 +110,18 @@ def initDreplace():
init_file = getServerDir() + '/init.pl'
if not os.path.exists(init_file):
initAgentConf()
openPort()
mw.writeFile(init_file, 'ok')
return True
def openPort():
try:
import firewall_api
firewall_api.firewall_api().addAcceptPortArgs('10050', 'zabbix-agent', 'port')
return port
except Exception as e:
return "Release failed {}".format(e)
return True
def zOp(method):
@ -126,6 +134,7 @@ def zOp(method):
def start():
return zOp('start')