Ejemplo n.º 1
0
    def manage_initial_host_status_brok(self, b):
        data = b.data
        h_id = data['id']

        #print 'DBG: Creacting host with with brok :', b.id
        #print "Creating host:", h_id, b.__dict__


        h = Host({})
        for prop in data:
            setattr(h, prop, data[prop])

        #add instance_id to the host, so we know in which scheduler he is
        h.instance_id = b.instance_id

        h.check_period = self.get_timeperiod(h.check_period)
        h.notification_period = self.get_timeperiod(h.notification_period)

        h.contacts = self.get_contacts(h.contacts)

        #Escalations is not use for status_dat
        del h.escalations

        #print "H:", h
        # We need to rebuild Downtime and Comment relationship
        for dtc in h.downtimes + h.comments:
            dtc.ref = h
        self.hosts[h_id] = h
        self.number_of_objects += 1
Ejemplo n.º 2
0
 def manage_initial_host_status_brok(self, b):
     data = b.data
     h_id = data['id']
     #print "Creating host:", h_id, data
     h = Host({})
     self.update_element(h, data)        
     self.set_schedulingitem_values(h)
     
     h.service_ids = []
     h.services = []
     self.hosts[h_id] = h
     self.hostname_lookup_table[h.host_name] = h_id
     self.number_of_objects += 1
Ejemplo n.º 3
0
    def manage_initial_host_status_brok(self, b):
        data = b.data
        h_id = data['id']
        #print "Creating host:", h_id, data
        h = Host({})
        self.update_element(h, data)
        self.set_schedulingitem_values(h)

        h.service_ids = []
        h.services = []
        self.hosts[h_id] = h
        self.hostname_lookup_table[h.host_name] = h_id
        self.number_of_objects += 1
Ejemplo n.º 4
0
 def manage_initial_host_status_brok(self, b):
     data = b.data
     
     host_name = data['host_name']
     inst_id = data['instance_id']
     #print "Creating host:", h_id, b
     h = Host({})
     self.update_element(h, data)        
     self.set_schedulingitem_values(h)
     
     h.service_ids = []
     h.services = []
     h.instance_id = inst_id
     # We need to rebuild Downtime and Comment relationship
     for dtc in h.downtimes + h.comments:
         dtc.ref = h
     self.hosts[host_name] = h
     self.number_of_objects += 1
Ejemplo n.º 5
0
    def manage_initial_host_status_brok(self, b):
        data = b.data
        h_id = data['id']

        #print 'DBG: Creacting host with with brok :', b.id
        #print "Creating host:", h_id, b.__dict__

        h = Host({})
        for prop in data:
            setattr(h, prop, data[prop])

        #add instance_id to the host, so we know in which scheduler he is
        h.instance_id = b.instance_id

        h.check_period = self.get_timeperiod(h.check_period)
        h.notification_period = self.get_timeperiod(h.notification_period)

        h.contacts = self.get_contacts(h.contacts)

        #Escalations is not use for status_dat
        del h.escalations

        #print "H:", h
        self.hosts[h_id] = h
        self.number_of_objects += 1