Good Day
I made a few nagios codes to monitor trackers, but cant seem to get events to show:
import json
import sys
import requests
uid = (sys.argv[1])
url = 'http://myurl.co.za'
user = 'admin'
password = 'password'
payload = {'id': uid}
headers = {'content-type': 'application/json'}
response = requests.get(url + ':8082/api/events', auth=(user, password), params=payload, headers=headers, timeout=5.000)
data = json.loads(response.content)
print data
What am i doing wrong?
Thank You
Albertus Geyser
You should probably explain what uid
is.
Good Day
I made a few nagios codes to monitor trackers, but cant seem to get events to show:
#!/usr/bin/env python import json import sys import requests uid = (sys.argv[1]) url = 'http://myurl.co.za' user = 'admin' password = 'password' payload = {'id': uid} headers = {'content-type': 'application/json'} response = requests.get(url + ':8082/api/events', auth=(user, password), params=payload, headers=headers, timeout=5.000) data = json.loads(response.content) print data
What am i doing wrong?
Thank You
Albertus Geyser