The invention provides, inter alia, automated medical methods and apparatus that test PD effluent in a flow path (e g, with an APD system or CAPD setup) to detect, for example, the onset of peritonitis, based on optical characteristics of the effluent resolved at cellular scales of distance For example, according to one aspect of the invention, an APD machine includes, in an effluent flow path, apparatus for early stage peritonitis detection comprising an illumination source and a detector The source is arranged to illuminate peritoneal effluent in a chamber that forms part of the flow path, and the detector is arranged to detect illuminant scattered by the effluent.