docs: def _ows_check_services_running(services, ports):
      """Check that the services that should be running are actually running
      and that any ports specified are being listened to.
  
      @param services: list of strings OR dictionary specifying services/ports
      @param ports: list of ports
      @returns state, message: strings or None, None
      """
      messages = []
      state = None
      if services is not None:
          services = _extract_services_list_helper(services)
          services_running, running = _check_running_services(services)
          if not all(running):
              messages.append(
                  "Services not running that should be: {}"
                  .format(", ".join(_filter_tuples(services_running, False))))
              state = 'blocked'
          # also verify that the ports that should be open are open
          # NB, that ServiceManager objects only OPTIONALLY have ports
          map_not_open, ports_open = (
              _check_listening_on_services_ports(services))
          if not all(ports_open):
              # find which service has missing ports. They are in service
              # order which makes it a bit easier.
              message_parts = {service: ", ".join([str(v) for v in open_ports])
                               for service, open_ports in map_not_open.items()}
              message = ", ".join(
                  ["{}: [{}]".format(s, sp) for s, sp in message_parts.items()])
              messages.append(
                  "Services with ports not open that should be: {}"
                  .format(message))
              state = 'blocked'
  
      if ports is not None:
          # and we can also check ports which we don't know the service for
          ports_open, ports_open_bools = _check_listening_on_ports_list(ports)
          if not all(ports_open_bools):
              messages.append(
                  "Ports which should be open, but are not: {}"
                  .format(", ".join([str(p) for p, v in ports_open
                                     if not v])))
              state = 'blocked'
  
      if state is not None:
          message = "; ".join(messages)
          return state, message
  
      return None, None