code: def overall_state_id(self):
          
          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 == 'WARNING':
                  overall_state = 3
              elif self.state == 'CRITICAL':
                  overall_state = 4
              elif self.state == 'UNKNOWN':
                  overall_state = 3
              elif self.state == 'UNREACHABLE':
                  overall_state = 4
  
          return overall_state
docs: Get the service overall state.
  
          The service overall state identifier is the service status including:
          - the monitored state
          - the acknowledged state
          - the downtime state
  
          The overall state is (prioritized):
          - a service is not monitored (5)
          - a service critical or unreachable (4)
          - a service warning or unknown (3)
          - a service downtimed (2)
          - a service acknowledged (1)
          - a service ok (0)
  
          *Note* that services in unknown state are considered as warning, and unreachable ones
          are considered as critical!
  
          Also note that the service state is considered only for HARD state type!