Oxygen is one of the most adverse gas that contaminates sterile drugs in glass medicine bottle, so it is of great significance to detect oxygen concentration for glass medicine bottle in order to ensure the asepsis of drug and the stability of ingredients. Wavelength modulation spectroscopy (WMS) is applied to achieve online oxygen concentration detection by the single-line spectrum analysis for the advantages of non-contact and high sensitivity.