Beispiel #1
0
    def __init__(self, config, id, libvirt_iface):
        threading.Thread.__init__(self, name="guest:%s" % id)
        self.config = config
        self.logger = logging.getLogger('mom.GuestMonitor')
        self.libvirt_iface = libvirt_iface
        self.guest_domain = self.libvirt_iface.getDomainFromID(id)
        info = self.get_guest_info()
        if info is None:
            self.logger.error("Failed to get guest:%s information -- monitor "\
                    "can't start", id)
            return

        self.setName("GuestMonitor-%s" % info['name'])
        Monitor.__init__(self, config, self.getName())
        self.setDaemon(True)
        
        self.data_sem.acquire()
        self.properties.update(info)
        self.properties['id'] = id
        self.properties['libvirt_iface'] = libvirt_iface
        self.data_sem.release()
        collector_list = self.config.get('guest', 'collectors')
        self.collectors = Collector.get_collectors(collector_list,
                            self.properties, self.config)
        if self.collectors is None:
            self.logger.error("Guest Monitor initialization failed")
            return
        self.start()
Beispiel #2
0
 def __init__(self, config):
     threading.Thread.__init__(self, name="HostMonitor")
     Monitor.__init__(self, config, self.getName())
     self.setDaemon(True)
     self.config = config
     self.logger = logging.getLogger("mom.HostMonitor")
     collector_list = self.config.get("host", "collectors")
     self.collectors = Collector.get_collectors(collector_list, self.properties, self.config)
     if self.collectors is None:
         self.logger.error("Host Monitor initialization failed")
         return
     self.start()
Beispiel #3
0
    def __init__(self, config, info, hypervisor_iface):
        self.config = config
        self.logger = logging.getLogger('mom.GuestMonitor')
        self.interval = self.config.getint('main', 'guest-monitor-interval')

        Monitor.__init__(self, config, info['name'])
        self.data_sem.acquire()
        self.properties.update(info)
        self.properties['hypervisor_iface'] = hypervisor_iface
        self.data_sem.release()

        collector_list = self.config.get('guest', 'collectors')
        self.collectors = Collector.get_collectors(collector_list,
                            self.properties, self.config)
        if self.collectors is None:
            self.logger.error("Guest Monitor initialization failed")
Beispiel #4
0
 def __init__(self, config):
     threading.Thread.__init__(self, name="HostMonitor")
     Monitor.__init__(self, config, self.getName())
     self.setDaemon(True)
     self.config = config
     self.logger = logging.getLogger("mom.HostMonitor")
     self.interval = self.config.getint("main", "host-monitor-interval")
     # Append monitor interval to properties because HostKSM needs it
     # to calculate ksmd cpu usage.
     self.properties["interval"] = self.interval
     collector_list = self.config.get("host", "collectors")
     self.collectors = Collector.get_collectors(collector_list, self.properties, self.config)
     if self.collectors is None:
         self.logger.error("Host Monitor initialization failed")
         return
     self.start()
Beispiel #5
0
 def __init__(self, config):
     threading.Thread.__init__(self, name="HostMonitor")
     Monitor.__init__(self, config, self.getName())
     self.setDaemon(True)
     self.config = config
     self.logger = logging.getLogger('mom.HostMonitor')
     self.interval = self.config.getint('main', 'host-monitor-interval')
     # Append monitor interval to properties because HostKSM needs it
     # to calculate ksmd cpu usage.
     self.properties['interval'] = self.interval
     collector_list = self.config.get('host', 'collectors')
     self.collectors = Collector.get_collectors(collector_list,
                         self.properties, self.config)
     if self.collectors is None:
         self.logger.error("Host Monitor initialization failed")
         return
     self.start()
Beispiel #6
0
    def __init__(self, config, info, hypervisor_iface):
        threading.Thread.__init__(self, name="guest:%s" % id)
        self.config = config
        self.logger = logging.getLogger('mom.GuestMonitor')

        self.setName("GuestMonitor-%s" % info['name'])
        Monitor.__init__(self, config, self.getName())
        self.setDaemon(True)
        self.data_sem.acquire()
        self.properties.update(info)
        self.properties['hypervisor_iface'] = hypervisor_iface
        self.data_sem.release()

        collector_list = self.config.get('guest', 'collectors')
        self.collectors = Collector.get_collectors(collector_list,
                            self.properties, self.config)
        if self.collectors is None:
            self.logger.error("Guest Monitor initialization failed")
            return
        self.start()
Beispiel #7
0
    def __init__(self, config, info, hypervisor_iface):
        threading.Thread.__init__(self, name="guest:%s" % id)
        self.config = config
        self.logger = logging.getLogger('mom.GuestMonitor')

        self.setName("GuestMonitor-%s" % info['name'])
        Monitor.__init__(self, config, self.getName())
        self.setDaemon(True)
        self.data_sem.acquire()
        self.properties.update(info)
        self.properties['hypervisor_iface'] = hypervisor_iface
        self.data_sem.release()

        collector_list = self.config.get('guest', 'collectors')
        self.collectors = Collector.get_collectors(collector_list,
                                                   self.properties,
                                                   self.config)
        if self.collectors is None:
            self.logger.error("Guest Monitor initialization failed")
            return
        self.start()