Skip to content

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

@zstyblik

Description

@zstyblik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions