Exemplo n.º 1
0
    "credentials": {
        "userName": "******",
        "password": "******",
    }
}

# # To run this sample you must define a the following resources for a Brocade Network Advisor
manager_host = None
manager_port = None
manager_username = None
manager_password = None

# Try load config from a file (if there is a config file)
config = try_load_from_file(config)

oneview_client = OneViewClient(config)

# Print default connection info for Brocade Network Advisor
print("Get {} default connection info".format(PROVIDER_NAME))
default_info = oneview_client.san_managers.get_default_connection_info(
    PROVIDER_NAME)
for property in default_info:
    print("   '{name}' - '{value}'".format(**property))

# Add a Brocade Network Advisor
provider_uri = oneview_client.san_managers.get_provider_uri(PROVIDER_NAME)
options = {
    'providerDisplayName':
    PROVIDER_NAME,
    'connectionInfo': [{
        'name': 'Host',
Exemplo n.º 2
0
from pprint import pprint
from hpOneView.oneview_client import OneViewClient
from hpOneView.exceptions import HPOneViewException

CONFIG = {
    "api_version": 500,
    "ip": "hpov7.doctors-lab.local",
    "credentials": {
        "userName": "******",
        "password": "******"
    }
}

# Initiate a connection to the appliance and instanciate a new OneViewClient class object
ONEVIEW_CLIENT = OneViewClient(CONFIG)

# These variables must be defined according with your environment
SERVER_PROFILE_TEMPLATE_NAME = "Big Data Node Template v1"
SERVER_PROFILE_NAME = "Prod-Swift-01"
SERVER_PROFILE_TEMPLATE_DESCRIPTION = "Corp standard big data node, version 1.0"

# Get infrastrucutre resource objects
ENCLOSURE_GROUP_OBJ = ONEVIEW_CLIENT.enclosure_groups.get_by('name', 'DCS Synergy Default EG')
SERVER_HARDWARE_TYPE_OBJ = ONEVIEW_CLIENT.server_hardware_types.get_by('name', 'SY 480 Gen10 1')
FIRMWARE_BUNDLE_OBJ = ONEVIEW_CLIENT.firmware_drivers.get_by('isoFileName', 'SPP_2017_10_20171215_for_HPE_Synergy_Z7550-96455.iso')
ETHERNET_NETWORK_OBJ = ONEVIEW_CLIENT.ethernet_networks.get_by('name', 'Management Network (VLAN1)')
NETWORK_SET_OBJ = ONEVIEW_CLIENT.network_sets.get_by('name', 'Prod NetSet')
FABRICA_NETWORK_OBJ = ONEVIEW_CLIENT.fc_networks.get_by('name', 'Prod Fabric A')
FABRICB_NETWORK_OBJ = ONEVIEW_CLIENT.fc_networks.get_by('name', 'Prod Fabric B')
Exemplo n.º 3
0
import os
import http.client
import logging
import requests
#import OpenSSL

config = {
    "ip": "10.10.10.10",
    "credentials": {
        "userName": "******",
        "password": "******"
    }
}
#connecttotheclient
ov_client = OneViewClient(config)

print("GetServer-hardware details")
try:
    server_hw = ov_client.server_hardware.get_all()

    print(
        'Name|Assettag|Manufacturer|Company|Serial number|ModelID|RAM|CPU manufacturer|CPU type|CPU speed(MHz)|CPU count|CPU core count'
    )

    for serv in server_hw:
        #print(json.dumps(serv, indent=4))
        print('%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s' %
              (serv['name'], serv['uuid'], 'Hewlett Packard Enterprise',
               'Hewlett Packard Enterprise', serv['serialNumber'],
               serv['model'], serv['memoryMb'], 'Intel', serv['processorType'],
Exemplo n.º 4
0
def main():
    global smhost, smhead, oneview_client

    if amqp.VERSION < (2, 1, 4):
        print("WARNING: This script has been tested only with amqp 2.1.4, "
              "we cannot guarantee that it will work with a lower version.\n")

    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-a',
                        '--appliance',
                        dest='host',
                        required=True,
                        help='HPE OneView Appliance hostname or IP')
    parser.add_argument('-u',
                        '--user',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='HPE OneView Username')
    parser.add_argument('-p',
                        '--pass',
                        dest='passwd',
                        required=True,
                        help='HPE OneView Password')
    parser.add_argument('-r',
                        '--route',
                        dest='route',
                        required=False,
                        default='scmb.alerts.#',
                        help='AMQP Routing Key')
    parser.add_argument('-g',
                        '--gen',
                        dest='gen',
                        required=False,
                        action='store_true',
                        help='Generate the Rabbit MQ keypair and exit')
    parser.add_argument('-d',
                        '--download',
                        dest='down',
                        required=False,
                        action='store_true',
                        help='Download the required keys and certs then exit')
    parser.add_argument('-s',
                        '--sm',
                        dest='sm',
                        required=True,
                        help='Service Manager Appliance hostname or IP')
    parser.add_argument('-i',
                        '--id',
                        dest='id',
                        required=True,
                        help='Service Manager Username')
    parser.add_argument('-x',
                        '--spass',
                        dest='spass',
                        required=False,
                        default='',
                        help='Service Manager Password')
    parser.add_argument('-l',
                        '--list',
                        dest='lst',
                        required=False,
                        action='store_true',
                        help='List all Service Manager incidents and exit')
    args = parser.parse_args()
    smcred = args.id + ':' + args.spass
    userAndPass = b64encode(str.encode(smcred)).decode('ascii')
    smhead = {
        'Content-Type': 'application/json;charset=utf-8',
        'Authorization': 'Basic %s' % userAndPass
    }
    smhost = args.sm + ':13080'

    if args.lst:
        get_incidents()
        sys.exit()

    config = {
        "ip": args.host,
        "credentials": {
            "userName": args.user,
            "password": args.passwd
        }
    }

    oneview_client = OneViewClient(config)
    acceptEULA(oneview_client)

    # Generate the RabbitMQ keypair (only needs to be done one time)
    if args.gen:
        genRabbitCa(oneview_client)
        sys.exit()

    if args.down:
        getCertCa(oneview_client)
        getRabbitKp(oneview_client)
        sys.exit()

    recv(args.host, args.route)
Exemplo n.º 5
0
def main():
    if amqp.VERSION < (2, 1, 4):
        print("WARNING: This script has been tested only with amqp 2.1.4, "
              "we cannot guarantee that it will work with a lower version.\n")

    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-a',
                        '--appliance',
                        dest='host',
                        required=True,
                        help='HPE OneView Appliance hostname or IP')
    parser.add_argument('-u',
                        '--user',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='HPE OneView Username')
    parser.add_argument('-p',
                        '--pass',
                        dest='passwd',
                        required=True,
                        help='HPE OneView Password')
    parser.add_argument('-r',
                        '--route',
                        dest='route',
                        required=False,
                        default='scmb.alerts.#',
                        help='AMQP Routing Key')
    parser.add_argument('-g',
                        '--gen',
                        dest='gen',
                        required=False,
                        action='store_true',
                        help='Generate the Rabbit MQ keypair and exit')
    parser.add_argument('-d',
                        '--download',
                        dest='down',
                        required=False,
                        action='store_true',
                        help='Download the required keys and certs then exit')
    args = parser.parse_args()
    config = {
        "ip": args.host,
        "credentials": {
            "userName": args.user,
            "password": args.passwd
        }
    }

    oneview_client = OneViewClient(config)
    acceptEULA(oneview_client)

    # Generate the RabbitMQ keypair (only needs to be done one time)
    if args.gen:
        genRabbitCa(oneview_client)
        sys.exit()

    if args.down:
        getCertCa(oneview_client)
        getRabbitKp(oneview_client)
        sys.exit()

    recv(args.host, args.route)
Exemplo n.º 6
0
def main():
    global input_data
    global config
    print("#" * 150)
    # input_file = os.getcwd() + os.sep + "inputs/failover_config.json"
    # Valid alert types sent by Oneview. This is used to compare the user input "alert_type" from oneview.json file
    alertTypes = ['Ok', 'Warning', 'Critical', 'Unknown']
    # try:
    # 	# Parsing for OneView arguments
    # 	fp = open(input_file, 'r')
    # 	data = json.loads(fp.read())

    # 	# Validate the data in the OneView config files.
    # 	config = data["oneview_config"]

    # except Exception as e:
    # 	print("\nError in config files. Check and try again. msg={}\n".format(e))
    # 	logging.error("Error in config files. Check and try again. msg={}".format(e))

    # 	sys.exit(1)

    # Get the logging level and init the logging module
    loggingLevel = input_data["logging_level"].upper()
    logfile = initialize_logging(config['host'], loggingLevel)

    config['fail_severity'] = config["fail_severity"].lower()

    alertTypes = [a.lower() for a in alertTypes]  # List of permissible alerts

    if not config['fail_severity'] in alertTypes:
        # print(alertType, alertTypes)
        logging.error("Fail severity  mismatch : " + config['fail_severity'] +
                      ". Kindly review and restart the plugin.")
        sys.exit(1)
    elif not config['fail_severity']:
        logging.error(
            "Enter the hardware fail severity  in config file. Exiting...")
        sys.exit(1)

    # Create certs directory for storing the OV certificates
    initialize_certs()

    ovConfig = {
        "ip": config["host"],
        "credentials": {
            "userName": config["user"],
            "authLoginDomain": config["authLoginDomain"],
            "password": config["passwd"]
        }
    }

    # print("attempting to connect OneView")
    try:
        oneview_client = OneViewClient(ovConfig)
        acceptEULA(oneview_client)

    except Exception as e:
        logging.error(
            "Error connecting to appliance. Check for OneView details in input json file."
        )
        logging.error(e)
        raise Exception(
            "Error connecting to appliance. Check for OneView details in input json file."
        )

    # print("Connected to OneView.")

    standby_hardwareUri = validate_hardwares(oneview_client, config)
    # exit()
    # Download the certificates
    getCertCa(oneview_client, config["host"])
    getRabbitKp(oneview_client, config["host"])

    # Start listening for messages.
    recv(oneview_client, "scmb.alerts.#")
    print("#" * 150)
Exemplo n.º 7
0
def main():

    global config

    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-i',
                        '--input_file',
                        dest='input_file',
                        required=True,
                        help='Json file containing oneview details')
    parser.add_argument('-p',
                        '--password',
                        dest='password',
                        required=False,
                        help='Password for OneView')

    # Check and parse the input arguments into python's format
    inputParser = parser.parse_args()

    ovPassword = inputParser.password
    # Parsing file for details
    with open(inputParser.input_file) as data_file:
        inputConfig = json.load(data_file)
    # get the logging level
    loggingLevel = inputConfig["logging_level"].upper()

    try:
        # Validate the data in the OneView config files.
        oneViewDetails = inputConfig["oneview_config"]

    except Exception as e:
        # We will not be able to log this message since logging is not yet initialized, hence printing
        print("Error in config files. Check and try again.")
        print(e)
        sys.exit(1)

    if inputParser.password:
        ovPassword = inputParser.password
        oneViewDetails['passwd'] = ovPassword

    else:
        # Get OneView Password
        oneViewDetails['passwd'] = getpass.getpass(
            "\nEnter password for OneView :")
        #oneViewDetails['passwd'] = ovPassword

    # Initialize logging
    initialize_logging(oneViewDetails['host'], loggingLevel)

    # Init splunk logging
    initialize_splunk_logging()

    # Valid alert types sent by Oneview. This is used to compare the user input "alert_type" from oneview.json file
    alertTypes = ['Ok', 'Warning', 'Critical', 'Unknown']
    hardwareTypes = [
        'server-hardware', 'enclosures', 'interconnects', 'sas-interconnects',
        'logical-interconnects'
    ]

    # validate OneView details
    ret = validate_oneview_details(oneViewDetails)
    if ret == 0:
        logging.info("Successfully validated input file")

    # validate hardware types entered
    ret = validate_hardware_category(oneViewDetails, hardwareTypes)
    if ret == 0:
        logging.info("Successfully validated input file")

    # validate alert types entered
    ret = validate_alert_types(oneViewDetails, alertTypes)
    if ret == 0:
        logging.info("Successfully validated input file")

    if not loggingLevel:
        logging.info(
            "\"logging_level\" is not provided, taken\"WARNING\" as default.")

    # append global dict with required values
    config['oneViewIP'] = oneViewDetails['host']
    config['alertHardwareTypes'] = oneViewDetails[
        "alert_hardware_category"].split(':')
    inputAlertTypes = oneViewDetails["alert_type"].split(':')
    config['inputAlertTypes'] = [x.lower() for x in inputAlertTypes
                                 ]  # User interested alert types

    # Logging input details.
    logging.info('OneView args: host = %s, alias = %s, route = %s, action = %s', \
     oneViewDetails["host"], oneViewDetails["alias"], oneViewDetails["route"], oneViewDetails["action"])

    # Esatblish connection to OneView
    if oneViewDetails["action"] == "start":
        logging.debug("Attempting to establish connection with OV SCMB")
        #logging.debug("Arguments: " + str(oneViewDetails))

        ovConfig = {
            "ip": oneViewDetails["host"],
            "credentials": {
                "userName": oneViewDetails["user"],
                "password": oneViewDetails["passwd"],
                "authLoginDomain": oneViewDetails['authLoginDomain']
            }
        }

        try:
            oneview_client = OneViewClient(ovConfig)
            acceptEULA(oneview_client)
            logging.info("Connected to OneView appliance : {}".format(
                oneViewDetails["host"]))
        #except HPOneViewException as e:
        except Exception as e:
            #logging.error("Error connecting to appliance: msg: %s", e.msg)
            logging.error(
                "Error connecting to appliance. Check for OneView details in input json file."
            )
            logging.error(e)
            sys.exit(1)

        # Create certs directory for storing the OV certificates
        initialize_certs()

        # Download the certificates
        getCertCa(oneview_client, oneViewDetails["host"])
        getRabbitKp(oneview_client, oneViewDetails["host"])

        # Start listening for messages.
        recv(oneViewDetails["host"], oneViewDetails["route"])

    elif oneViewDetails["action"] == "stop":
        # Stop SCMB connection for this appliance
        logging.info("TODO: stop action implementation")
        # stopSCMB(oneViewDetails.host)
    else:
        # Do nothing and exit
        logging.error(
            "Missing or invalid option for action in oneview.json; It should be start/stop."
        )
        print(
            "Missing or invalid option for action in oneview.json; It should be start/stop."
        )

    # Close the file which is used to write the splunk syslogs.
    print("Closing splunk log file.")
    fo.close()
Exemplo n.º 8
0
def get_oneview_client(session_id=None, is_service_root=False):
    """Establishes a OneView connection to be used in the module

        Establishes a OV connection if one does not exists.
        If one exists, do a single OV access to check if its sill
        valid. If not tries to establish a new connection.
        Sets the connection on the ov_conn global var

        Args:
            session_id: The ID of a valid authenticated session, if the
            authentication_mode is session. Defaults to None.

            is_service_root: Informs if who is calling this function is the
            ServiceRoot blueprint. If true, even if authentication_mode is
            set to session it will use the information on the conf file to
            return a connection.  This is a workaround to allow ServiceRoot
            to retrieve the appliance UUID before user logs in.

        Returns:
            OneViewClient object

        Exceptions:
            HPOneViewException if can't connect or reconnect to OV
    """

    config = globals()['config']

    auth_mode = config["redfish"]["authentication_mode"]

    if auth_mode == "conf" or is_service_root:
        # Doing conf based authentication
        ov_config = globals()['ov_config']
        ov_client = None

        # Check if connection is ok yet
        try:
            # Check if OneViewClient already exists
            if 'ov_client' not in globals():
                globals()['ov_client'] = OneViewClient(ov_config)

            ov_client = globals()['ov_client']
            ov_client.connection.get('/rest/logindomains')
            return ov_client
        # If expired try to make a new connection
        except Exception:
            try:
                logging.exception('Re-authenticated')
                if ov_client:
                    ov_client.connection.login(ov_config['credentials'])
                    return ov_client
            # if failed abort
            except Exception:
                raise
    else:
        # Auth mode is session
        oneview_config = dict(config.items('oneview_config'))
        oneview_config['credentials'] = {"sessionID": session_id}
        oneview_config['api_version'] = int(oneview_config['api_version'])
        try:
            oneview_client = OneViewClient(oneview_config)
            oneview_client.connection.get('/rest/logindomains')
            return oneview_client
        except Exception:
            logging.exception("Failed to recover session based connection")
            raise
Exemplo n.º 9
0
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# __author__ = "@netwookie"
# __credits__ = ["Rick Kauffman"]
# __license__ = "Apache2.0"
# __maintainer__ = "Rick Kauffman"
# __email__ = "*****@*****.**"

from hpOneView.oneview_client import OneViewClient
from st2common.runners.base_action import Action

class HpeOVBaseAction(Action):
    def __init__(self,config):
        super(HpeOVBaseAction, self).__init__(config)
        self.client = self._get_client()

        authx = {
            "ip": self.config['ipaddress'],
            "credentials": {
                "userName": username = self.config['username'],
                "password": password = self.config['password']
            }
        }


        client = OneViewClient(authx)

        return client
Exemplo n.º 10
0
def createClient(config):
    config = try_load_from_file(config)
    oneview_client = OneViewClient(config)
    return oneview_client
Exemplo n.º 11
0
def main():

    global config

    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-i',
                        '--input_file',
                        dest='input_file',
                        required=True,
                        help='Json file containing oneview and nagios details')

    # Check and parse the input arguments into python's format
    inputFile = parser.parse_args()
    # Parsing file for details
    with open(inputFile.input_file) as data_file:
        inputConfig = json.load(data_file)
    # get the logging level
    loggingLevel = inputConfig["logging_level"].upper()
    # get refresh duration
    refreshDuration = inputConfig['stats_refresh_duration']

    try:
        # Validate the data in the OneView config files.
        oneViewDetails = inputConfig["oneview_config"]
        # Validate the data in the Nagios config files.
        nagiosDetails = inputConfig["nagios_config"]

    except Exception as e:
        # We will not be able to log this message since logging is not yet initialized, hence printing
        print("Error in config files. Check and try again.")
        print(e)
        sys.exit(1)

    # Initialize logging
    initialize_logging(oneViewDetails['host'], loggingLevel)

    # Valid alert types sent by Oneview. This is used to compare the user input "alert_type" from oneview.json file
    alertTypes = ['Ok', 'Warning', 'Critical', 'Unknown']
    hardwareTypes = [
        'server-hardware', 'enclosures', 'interconnects', 'sas-interconnects',
        'logical-interconnects'
    ]

    # Validate input file
    ret = validate_input_config(oneViewDetails, nagiosDetails, hardwareTypes,
                                alertTypes)
    if ret == 0:
        logging.info("Successfully validated input file")

    if not loggingLevel:
        logging.info(
            "\"logging_level\" is not provided, taken\"WARNING\" as default.")
    if not refreshDuration:
        logging.info(
            "\"stats_refresh_duration\" is not provided, taking 120s as default."
        )
        refreshDuration = '120'

    # append global dict with required values
    config['oneViewIP'] = oneViewDetails['host']
    config['nagiosDetails'] = nagiosDetails
    config['alertHardwareTypes'] = oneViewDetails[
        "alert_hardware_category"].split(':')
    inputAlertTypes = oneViewDetails["alert_type"].split(':')
    config['inputAlertTypes'] = [x.lower() for x in inputAlertTypes
                                 ]  # User interested alert types

    # Logging input details.
    logging.info('OneView args: host = %s, alias = %s, route = %s, action = %s, process_onetime_alerts = %s, events_dated_from = %s', \
     oneViewDetails["host"], oneViewDetails["alias"], oneViewDetails["route"], oneViewDetails["action"], \
     oneViewDetails["process_onetime_alerts"], oneViewDetails["events_dated_from"])

    logging.info('Nagios args: nagiosHost = %s ', nagiosDetails["nagiosHost"])

    # Esatblish connection to OneView
    if oneViewDetails["action"] == "start":
        logging.debug("Attempting to establish connection with OV SCMB")
        logging.debug("Arguments: " + str(oneViewDetails))

        ovConfig = {
            "ip": oneViewDetails["host"],
            "credentials": {
                "userName": oneViewDetails["user"],
                "password": oneViewDetails["passwd"]
            }
        }

        try:
            oneview_client = OneViewClient(ovConfig)
            acceptEULA(oneview_client)
            logging.info("Connected to OneView appliance : {}".format(
                oneViewDetails["host"]))
        #except HPOneViewException as e:
        except Exception as e:
            #logging.error("Error connecting to appliance: msg: %s", e.msg)
            logging.error(
                "Error connecting to appliance. Check for OneView details in input json file."
            )
            logging.error(e)
            sys.exit(1)

        # Create Infrastructure in Nagios server
        create_infra_in_nagios(oneview_client, oneViewDetails, nagiosDetails)
        logging.info(
            "Infra created if not present already. Processing alerts now.")
        sleep(1)

        # Process alerts onetime at the beginning based on user's input in json file
        ret = process_alerts_one_time(oneview_client, oneViewDetails,
                                      nagiosDetails, config['inputAlertTypes'],
                                      config['alertHardwareTypes'])
        if (ret != 0):
            print("One-time processing of alerts failed.")

        # Create certs directory for storing the OV certificates
        initialize_certs()

        # Download the certificates
        getCertCa(oneview_client, oneViewDetails["host"])
        getRabbitKp(oneview_client, oneViewDetails["host"])

        # Creating new process for polling processes
        pollProcess = mp.Process(target=process_threads,
                                 args=(
                                     oneview_client,
                                     nagiosDetails,
                                     config['alertHardwareTypes'],
                                     int(refreshDuration),
                                 ))
        pollProcess.start()

        # Start listening for messages.
        recv(oneViewDetails["host"], oneViewDetails["route"])

        # Join Process pollProcess.
        pollProcess.join()

        print("Closing Thread Pool!")
        mpThreadPool.close()
        # Join the Pool
        mpThreadPool.join()

    elif oneViewDetails["action"] == "stop":
        # Stop SCMB connection for this appliance
        logging.info("TODO: stop action implementation")
        # stopSCMB(oneViewDetails.host)
    else:
        # Do nothing and exit
        logging.error(
            "Missing or invalid option for action in oneview.json; It should be start/stop."
        )
        print(
            "Missing or invalid option for action in oneview.json; It should be start/stop."
        )
Exemplo n.º 12
0
def main():
    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-i', '--input_file',
                        dest='input_file',
                        required=False,
                        help='Json file containing oneview details')

    # Check and parse the input arguments into python's format
    inputParser = parser.parse_args()
    inputConfig = conf.getInputConfig(inputParser.input_file)
    oneviewDetails = inputConfig["oneview_config"]

    # Initialize logging
    ovlog.initialize_logging(syslogDir=oneviewDetails.get('syslogDir'),
                             syslogFile=oneviewDetails.get('syslog'))


    # get the logging level
    if inputConfig["logging_level"]:
        logLevel = logging.getLevelName(inputConfig["logging_level"].upper())
        logging.getLogger().setLevel(logLevel)

    # Get OneView Password
    if not oneviewDetails.get('passwd'):
        if "OV_PASSWORD" in environ:
            oneviewDetails["passwd"] = environ["OV_PASSWORD"]
        else:
            raise Exception("Missing oneview password. Please define " +
                            "the password in the input file or " +
                            "export OV_PASSWORD")
    else:
        password = base64.b64decode(oneviewDetails['passwd'].encode('utf-8'))
        oneviewDetails['passwd'] = password.decode('utf-8')

    conf.validate_input(oneviewDetails)

    # Logging input details.
    logging.info('OneView args: host = %s, alias = %s, route = %s', \
        oneviewDetails["host"], oneviewDetails["alias"], oneviewDetails["route"])

    ovConfig = {
        "ip": oneviewDetails["host"],
        "credentials": {
            "userName": oneviewDetails["user"],
            "password": oneviewDetails["passwd"],
            "authLoginDomain": oneviewDetails['authLoginDomain']
        },
        'api_version': 600
    }

    try:
        oneview_client = OneViewClient(ovConfig)
        acceptEULA(oneview_client)
        logging.info("Connected to OneView appliance : {}".format(oneviewDetails["host"]))
    except Exception as e:
        err = "Error connecting to appliance: {}\n Check for oneview details in the input file".format(e)
        logging.error(e)
        raise Exception(err)

    print("Connected to OneView appliance : {}".format(oneviewDetails["host"]))
    ovlog.create_server_map(oneview_client)

     # Create certs directory for storing the OV certificates
    #ovscmb.setupAmqpCerts(oneview_client, oneviewDetails["host"])
    ovscmb.setupAmqpCerts(oneview_client, oneviewDetails)


    if oneviewDetails['collect_stats']:
        # Creating new process for polling processes
        #pollProcess = mp.Process(target=process_threads, args=(oneview_client, conf['alertHardwareTypes'], int(refreshDuration), ))
        pollProcess = mp.Process(target=polling.process_threads,
                                 args=(oneview_client,
                                       oneviewDetails['alert_hardware_category'],
                                       oneviewDetails['refresh_interval'], ))
        pollProcess.start()

    if oneviewDetails['collect_hpeov_service_info']:
        # Creating new process for polling HPE OV Service tickets
        hpeTicketProcess = mp.Process(target=polling.collect_hpeov_service_info,
                                      args=(oneview_client, ))
        hpeTicketProcess.start()

    # Logging all active alerts to syslog
    ovlog.logAlerts(oneview_client, "activeAlerts")

    # Start listening for messages.
    ovscmb.recv(oneviewDetails["host"], oneviewDetails["route"])