Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin.EvaluateThreshold reduces severity of plugin exit status code on later perfdata evaluations #280

Open
atc0005 opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working performance data question Further information is requested range thresholds
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Oct 30, 2024

While working on #278 I reviewed the logic for this method:

func (p *Plugin) EvaluateThreshold(perfData ...PerformanceData) error {

and it appears that the current logic may have a bug.

From what I can tell the method:

  • does not sort the collection before evaluation
  • does not use a high-water mark check to determine if the highest exit code state has been reached

This can lead to a performance data metric warranting a CRITICAL exit code being ignored if a later performance data metric in the input collection is evaluated which indicates that a WARNING exit code should be set.

Whether a single plugin should support checking multiple separate thresholds, each of which can lead to having separate state evaluations is something to consider but is likely supported (unverified) by stock / standard plugins.

@atc0005 atc0005 added question Further information is requested performance data range thresholds labels Oct 30, 2024
@atc0005 atc0005 added this to the Future milestone Oct 30, 2024
@atc0005 atc0005 changed the title Plugin.EvaluateThreshold reduce severity of plugin exit status code on later perfdata evaluations Plugin.EvaluateThreshold reduces severity of plugin exit status code on later perfdata evaluations Oct 30, 2024
@atc0005 atc0005 added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance data question Further information is requested range thresholds
Projects
None yet
Development

No branches or pull requests

1 participant