def orion_init():
""" Prompts for Orion credentials and returns a SwisClient object
"""
global orion_server
global orion_username
global orion_password
if not orion_username:
default_username = getuser()
orion_username = raw_input('Orion username [' + default_username + ']: ') or default_username
if not orion_password:
orion_password = getpass('Orion password: ')
# SolarWinds-Orion is a special hostname in /etc/hosts
# This was necessary to implement SSL checking
# https://github.com/solarwinds/orionsdk-python#ssl-certificate-verification
# this disables the SubjectAltNameWarning
urllib3.disable_warnings()
# TODO: Need a better/more resilient way of referencing server cert.
return orionsdk.SwisClient('SolarWinds-Orion', orion_username, orion_password, verify='server.pem')
评论列表
文章目录