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

How to use thresholds in Check.AddPerfDatum() #11

Open
zstyblik opened this issue Mar 2, 2016 · 1 comment
Open

How to use thresholds in Check.AddPerfDatum() #11

zstyblik opened this issue Mar 2, 2016 · 1 comment

Comments

@zstyblik
Copy link

zstyblik commented Mar 2, 2016

Hello,

according to Nagios Plugin Dev Guidelines:

warn and crit are in the range format (see the Section called Threshold and ranges). Must be the same UOM

However, Check.AddPerfDatum() expects float64. What's the correct way to add warn and crit threshold to perf data then? I've tried something like:

check.AddPerfDatum(label, unit, value, 0, 0,
    warnRange.Start, warnRange.End, critRange.Start, critRange.End)

but the output doesn't seem to be correct, resp. it's something like:

CRITICAL: It's broken. | label=value;0;warn.End;0;0

where input values for warn and critical are -w 400000 -c 500000. I've also tried to pass different combinations to Check.AddPerfDatum(), but without success. However, it's possible I'm expecting something that cannot be :)

Thank you for clarification.

@olorin
Copy link
Owner

olorin commented Mar 5, 2016

warn and crit are in the range format (see the Section called Threshold and ranges).

Huh, I missed that, I always thought they were scalars - thanks for pointing that out. This is an example of how I've been using that function. I think current behaviour is a bug though; I'll leave this open until I get a chance to look at fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants