Example #1
0
    def __init__(self):
        """
        Init the stats
        """

        self._init_host()

        # Init the grab error tags
        # for managing error during stats grab
        # By default, we *hope* that there is no error
        self.network_error_tag = False
        self.diskio_error_tag = False

        # Init the fs stats
        try:
            self.glancesgrabfs = glancesGrabFs()
        except Exception as e:
            self.glancesgrabfs = {}
            LOG.warning(str(e))

        # Init the sensors stats (optional)
        if sensors_tag:
            try:
                self.glancesgrabsensors = glanceGrabSensors()
            except Exception as e:
                LOG.warning(str(e))
                self.sensors_tag = False

        # Init the hddtemp stats (optional)
        if hddtemp_tag:
            try:
                self.glancesgrabhddtemp = glanceGrabHDDTemp()
            except Exception as e:
                LOG.warning(str(e))
                self.hddtemp_tag = False
        if batinfo_lib_tag:
            self.glancesgrabbat = glanceGrabBat()

        self.process_list_refresh = True
        self.process_list_sortedby = ''
        self.glancesgrabprocesses = GlancesGrabProcesses()