Metric for error/warning count

Is there any metric to detect (configuration) errors, just like in the dashboard?