Path : /proc/2/cwd/proc/3/root/proc/3/task/3/root/proc/3/root/var/lib/zabbix/ |
Current File : //proc/2/cwd/proc/3/root/proc/3/task/3/root/proc/3/root/var/lib/zabbix/license_expire_halon.py |
#!/usr/bin/env python import requests import json import sys HOST=sys.argv[1] USER=sys.argv[2] PASS=sys.argv[3] API_VERSION="1.0.0" r = requests.get('https://'+HOST+'/api/'+API_VERSION+'/license', auth =(USER,PASS)) data = r.json() subscriptions = data.get('subscriptions') for i in subscriptions: if i.get('name') == "commercial": seconds_left = i.get('expires') date = seconds_left / 3600 / 24 print(date)