import json


def discovery_json(names):
    """
        Returns bundle names in Zabbix autodiscovery JSON format
    """
    template = { "data" : [ ]}
    for bn in names:
        template["data"].append({ "{#PROCGROUP}": bn, })
    template["data"].append({ "{#PROCGROUP}": 'idle', })
    return json.dumps(template)