We propose and experimentally demonstrate a novel cost-effective and distributed in-band optical signal-to-noise ratio (OSNR) monitoring method using a widely tunable optical bandpass filter and optical power measurements, which employs the Gaussian process regression and is proved to be insensitive to fiber nonlinearity, chromatic dispersion, and optical amplifier type. This method is verified in a 9-channel 10 Gbaud NRZ-QPSK coherent optical transmission system with 50-GHz channel intervals. When there are no add-drop filters or wavelength selective switches in the transmission link, the maximum OSNR deviation, the root-mean-squared error (RMSE), and the mean absolute error (MAE) are less than 0.21 dB, 0.041 dB, and 0.021 dB, respectively, in the OSNR range of 1-29 dB. Instead, when there exist the above optical filtering elements in the transmission link, the maximum OSNR deviation, the RSME, and the MAE are less than 0.24 dB, 0.041 dB, and 0.021 dB, respectively, in the OSNR range of 4-31 dB. Besides, the OSNR monitor based on the novel method can eliminate the necessity to know the transmission information and is more convenient to use because no calibration is required.