def beacon(config):
    '''
    Monitor the memory usage of the minion

    Specify thresholds for percent used and only emit a beacon
    if it is exceeded.

    .. code-block:: yaml

        beacons:
          memusage:
            - percent: 63%
    '''
    ret = []

    _config = {}
    list(map(_config.update, config))

    _current_usage = psutil.virtual_memory()

    current_usage = _current_usage.percent
    monitor_usage = _config['percent']
    if '%' in monitor_usage:
        monitor_usage = re.sub('%', '', monitor_usage)
    monitor_usage = float(monitor_usage)
    if current_usage >= monitor_usage:
        ret.append({'memusage': current_usage})
    return ret
Monitor the memory usage of the minion

    Specify thresholds for percent used and only emit a beacon
    if it is exceeded.

    .. code-block:: yaml

        beacons:
          memusage:
            - percent: 63%