示例#1
0
    def save_file_system_data(agent=None, data=None):
        """Saves file system data.
        """

        if not data or not agent:
            return None

        new_data = []
        for fs in data:
            new_data.append(Monitor._totalfy(fs))

        result = _db._save_data_point(
            agent=agent, collection=Collection.FileSystem, data=new_data
        )

        return result
示例#2
0
文件: utils.py 项目: vFense/vFense
    def save_file_system_data(agent=None, data=None):
        """Saves file system data.
        """

        if not data or not agent:
            return None

        new_data = []
        for fs in data:
            new_data.append(Monitor._totalfy(fs))

        result = _db._save_data_point(agent=agent,
                                      collection=Collection.FileSystem,
                                      data=new_data)

        return result
示例#3
0
    def save_cpu_data(agent=None, data=None):
        """Saves cpu data.

        Args:

            agent: The agent id the data belongs to.

            data: Basic data type (str, int, list, dict, etc) to save as is.
        """

        if not data or not agent:

            return None

        result = _db._save_data_point(agent=agent, collection=Collection.Cpu,
                                      data=data)

        return result
示例#4
0
文件: utils.py 项目: vFense/vFense
    def save_cpu_data(agent=None, data=None):
        """Saves cpu data.

        Args:

            agent: The agent id the data belongs to.

            data: Basic data type (str, int, list, dict, etc) to save as is.
        """

        if not data or not agent:
            return None

        result = _db._save_data_point(agent=agent,
                                      collection=Collection.Cpu,
                                      data=data)

        return result
示例#5
0
    def save_memory_data(agent=None, data=None):
        """Saves memory data.

        Args:

            agent: The agent id the data belongs to.

            data: Basic data type (str, int, list, dict, etc) to save as is.
        """

        if not data or not agent:
            return None

        data = Monitor._totalfy(data)
        result = _db._save_data_point(
            agent=agent, collection=Collection.Memory, data=data
        )

        return result
示例#6
0
文件: utils.py 项目: vFense/vFense
    def save_memory_data(agent=None, data=None):
        """Saves memory data.

        Args:

            agent: The agent id the data belongs to.

            data: Basic data type (str, int, list, dict, etc) to save as is.
        """

        if not data or not agent:
            return None

        data = Monitor._totalfy(data)
        result = _db._save_data_point(agent=agent,
                                      collection=Collection.Memory,
                                      data=data)

        return result