Added default User-Agent header

This commit is contained in:
janrot 2016-06-17 15:16:16 +02:00
parent ed7bc7175b
commit 9c7465f8bb

View File

@ -407,6 +407,7 @@ if __name__ == "__main__":
# Attempt to reach the endpoint
try:
req = urllib2.Request(url)
req.add_header("User-Agent", "nagios-http-json")
if args.auth:
base64str = base64.encodestring(args.auth).replace('\n', '')
req.add_header('Authorization', 'Basic %s' % base64str)