Previously, the call to check_threshold would set the threshold on the Monitoring::Plugin object, if thresholds are defined, this means that these 2 snippets have different behaviour:
To us, this is unexpected. The first snippet, will have thresholds on the perfdata, whereas the second will not. This PR should change the behaviour so that $mp->threshold will exist from as early as possible, so need to run check_threshold before add_perfdata is no longer there.
Open to alternatives if this introduces some behaviour we're not aware of
Previously, the call to
check_threshold
would set the threshold on the Monitoring::Plugin object, if thresholds are defined, this means that these 2 snippets have different behaviour:To us, this is unexpected. The first snippet, will have thresholds on the perfdata, whereas the second will not. This PR should change the behaviour so that
$mp->threshold
will exist from as early as possible, so need to runcheck_threshold
beforeadd_perfdata
is no longer there.Open to alternatives if this introduces some behaviour we're not aware of