def fetch_sys_var(server, var, **kwargs):

    """Function:  fetch_sys_var

    Description:  Returns the value for a variable.  Can set the level at
        which to return the variable from:  global|session.
        NOTE:  Will use 'session' level by default.

    Arguments:
        (input) server -> Server instance.
        (input) var -> Variable name.
        (Input) **kwargs:
            level - global|session - level at which command will run.
        (output) Variable returned in dictionary format (e.g. {name: value}).

    """

    cmd = "show " + kwargs.get("level", "session") + " variables like %s"

    return server.vert_sql(cmd, (var,))