code restructure for zabbix with python