From f65b16723b189196f419832681b963d91e9d69a2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 16 Jul 2024 00:45:42 +0800 Subject: [PATCH] Update index.py --- plugins/zabbix/index.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/plugins/zabbix/index.py b/plugins/zabbix/index.py index dd5253e6f..9613b5dd9 100755 --- a/plugins/zabbix/index.py +++ b/plugins/zabbix/index.py @@ -238,13 +238,7 @@ def initdStatus(): if current_os == 'darwin': return "Apple Computer does not support" - if current_os.startswith('freebsd'): - initd_bin = getInitDFile() - if os.path.exists(initd_bin): - return 'ok' - - shell_cmd = 'systemctl status ' + \ - getPluginName() + ' | grep loaded | grep "enabled;"' + shell_cmd = 'systemctl status zabbix-server | grep loaded | grep "enabled;"' data = mw.execShell(shell_cmd) if data[0] == '': return 'fail' @@ -256,17 +250,7 @@ def initdInstall(): if current_os == 'darwin': return "Apple Computer does not support" - # freebsd initd install - if current_os.startswith('freebsd'): - import shutil - source_bin = initDreplace() - initd_bin = getInitDFile() - shutil.copyfile(source_bin, initd_bin) - mw.execShell('chmod +x ' + initd_bin) - mw.execShell('sysrc ' + getPluginName() + '_enable="YES"') - return 'ok' - - mw.execShell('systemctl enable ' + getPluginName()) + mw.execShell('systemctl enable zabbix-server') return 'ok' @@ -275,13 +259,7 @@ def initdUinstall(): if current_os == 'darwin': return "Apple Computer does not support" - if current_os.startswith('freebsd'): - initd_bin = getInitDFile() - os.remove(initd_bin) - mw.execShell('sysrc ' + getPluginName() + '_enable="NO"') - return 'ok' - - mw.execShell('systemctl disable ' + getPluginName()) + mw.execShell('systemctl disable zabbix-server') return 'ok'