code: def get_overall_state(self, services):
          
          overall_state = 0
  
          if not self.monitored:
              overall_state = 5
          elif self.acknowledged:
              overall_state = 1
          elif self.downtimed:
              overall_state = 2
          elif self.state_type == 'HARD':
              if self.state == 'UNREACHABLE':
                  overall_state = 3
              elif self.state == 'DOWN':
                  overall_state = 4
  
          # Only consider the hosts services state if all is ok (or almost...)
          if overall_state <= 2:
              for service in self.services:
                  if service in services:
                      service = services[service]
                      # Only for monitored services
                      if service.overall_state_id < 5:
                          overall_state = max(overall_state, service.overall_state_id)
  
          return overall_state
docs: Get the host overall state including the host self status
          and the status of its services
  
          Compute the host overall state identifier, including:
          - the acknowledged state
          - the downtime state
  
          The host overall state is (prioritized):
          - an host not monitored (5)
          - an host down (4)
          - an host unreachable (3)
          - an host downtimed (2)
          - an host acknowledged (1)
          - an host up (0)
  
          If the host overall state is <= 2, then the host overall state is the maximum value
          of the host overall state and all the host services overall states.
  
          The overall state of an host is:
          - 0 if the host is UP and all its services are OK
          - 1 if the host is DOWN or UNREACHABLE and acknowledged or
              at least one of its services is acknowledged and
              no other services are WARNING or CRITICAL
          - 2 if the host is DOWN or UNREACHABLE and in a scheduled downtime or
              at least one of its services is in a scheduled downtime and no
              other services are WARNING or CRITICAL
          - 3 if the host is UNREACHABLE or
              at least one of its services is WARNING
          - 4 if the host is DOWN or
              at least one of its services is CRITICAL
          - 5 if the host is not monitored
  
          :param services: a list of known services
          :type services: alignak.objects.service.Services
  
          :return: the host overall state
          :rtype: int