Exemple #1
0
print()
print('\033[32m' +
      '#########################################################' +
      '\033[0;0m')
print('\033[32m' +
      '#              ZABBIX MANUTENÇÃO DE TRIGGERS            #' +
      '\033[0;0m')
print('\033[32m' +
      '#########################################################' +
      '\033[0;0m')

# Conexão API Zabbix
url = 'https://zabbix.com.br/api_jsonrpc.php'
zapi = ZabbixAPI(url)
zapi.validate_certs = False
print()

# Validação login Zabbix
while True:
    try:
        login = input('\033[36m' + 'Login: '******'\033[0;0m')
        senha = getpass.getpass('\033[36m' + "Senha: " + '\033[0;0m')
        zapi.login(login, senha)
        break
    except:
        print('\033[31m' + "Usuário e senha inválidos, digite novamente." +
              '\033[0;0m')
        continue

# Validação triggerid