.. versionadded:: 2016.3.0

    Return monit unique id.

    reset : False
        Reset current id and generate a new id when it's True.

    CLI Example:

    .. code-block:: bash

        salt '*' monit.id [reset=True]

def id_(reset=False):
    '''
    .. versionadded:: 2016.3.0

    Return monit unique id.

    reset : False
        Reset current id and generate a new id when it's True.

    CLI Example:

    .. code-block:: bash

        salt '*' monit.id [reset=True]
    '''
    if reset:
        id_pattern = re.compile(r'Monit id (?P<id>[^ ]+)')
        cmd = 'echo y|monit -r'
        out = __salt__['cmd.run_all'](cmd, python_shell=True)
        ret = id_pattern.search(out['stdout']).group('id')
        return ret if ret else False
    else:
        cmd = 'monit -i'
        out = __salt__['cmd.run'](cmd)
        ret = out.split(':')[-1].strip()
    return ret