def get_env_macros(self, data):
        """Get all environment macros from data
        For each object in data ::

        * Fetch all macros in object.__class__.macros
        * Fetch all customs macros in o.custom

        :param data: data to get macro
        :type data:
        :return: dict with macro name as key and macro value as value
        :rtype: dict
        """
        env = {}

        for obj in data:
            cls = obj.__class__
            macros = cls.macros
            for macro in macros:
                if macro.startswith("USER"):
                    continue

                prop = macros[macro]
                value = self._get_value_from_element(obj, prop)
                env['%s%s' % (self.env_prefix, macro)] = value
            if hasattr(obj, 'customs'):
                # make NAGIOS__HOSTMACADDR from _MACADDR
                for cmacro in obj.customs:
                    new_env_name = '%s_%s%s' % (self.env_prefix,
                                                obj.__class__.__name__.upper(),
                                                cmacro[1:].upper())
                    env[new_env_name] = obj.customs[cmacro]

        return env
Get all environment macros from data
        For each object in data ::

        * Fetch all macros in object.__class__.macros
        * Fetch all customs macros in o.custom

        :param data: data to get macro
        :type data:
        :return: dict with macro name as key and macro value as value
        :rtype: dict