|
|
@ -36,4 +36,27 @@ def install(): |
|
|
|
|
|
|
|
|
|
|
|
def uninstall(): |
|
|
|
def uninstall(): |
|
|
|
print('Removing firewall rule') |
|
|
|
print('Removing firewall rule') |
|
|
|
run_notfatal('netsh advfirewall firewall del rule name="Zabbix Agent"') |
|
|
|
run_notfatal('netsh advfirewall firewall del rule name="Zabbix Agent"') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_package(): |
|
|
|
|
|
|
|
import requests, re |
|
|
|
|
|
|
|
from waptpackage import PackageEntry |
|
|
|
|
|
|
|
print('Updating Zabbix Agent package') |
|
|
|
|
|
|
|
page = requests.get('https://www.suiviperf.com/zabbix/',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text |
|
|
|
|
|
|
|
version = re.search('zabbix_agent-(\d+(\.\d+)*)_x64.msi', page).group(1) |
|
|
|
|
|
|
|
for arch in ['86', '64']: |
|
|
|
|
|
|
|
if not isfile('zabbix_agent-%s_x%s.msi' % (version, arch)): |
|
|
|
|
|
|
|
filename ='zabbix_agent-%s_x%s.msi' % (version, arch) |
|
|
|
|
|
|
|
url = 'http://www.suiviperf.com/zabbix/%s' % filename |
|
|
|
|
|
|
|
print('Downloading %s from %s' % (filename, url)) |
|
|
|
|
|
|
|
wget(url, filename) |
|
|
|
|
|
|
|
for old in glob.glob(r'zabbix_agent-*_x%s' % arch): |
|
|
|
|
|
|
|
if not old == filename: |
|
|
|
|
|
|
|
remove_file(old) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pe = PackageEntry() |
|
|
|
|
|
|
|
control = pe.load_control_from_wapt(os.getcwd()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Version(version) > Version(control['version'].split('-',1)[0]): |
|
|
|
|
|
|
|
pe.version = version + '-0' |
|
|
|
|
|
|
|
pe.save_control_to_wapt(os.getcwd()) |
|
|
|