def load_agent():

    try:

        process = subprocess.Popen(load_command, stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)

        raw_output, error_output = process.communicate()

        if raw_output == '' and error_output == '':

            logger.log('Agent loaded.')

        elif 'Already loaded' in error_output:

            logger.log('Agent is already loaded.')

        else:

            logger.log('Unknown output: "%s"' % error_output)

    except Exception as e:

        logger.log("Could not load agent.", logger.LogLevel.Error)
        logger.log_exception(e)