Perf-o-meter to work with custom local checks

If you use a not already defined metric you need to define it. And then you can use this metric in a perf-o-meter.

This is a very easy example from one of my own checks.
The file must be placed inside “~/local/share/check_mk/web/plugins/metrics/”

metric_info["perc"] = {
    "color" : "#60f020",
    "unit"  : "%",
    "title" : _("Percent"),
    "help"  : _("Generic Percent usage"),
}

perfometer_info.append({
    "type"     : "linear",
    "metric"   : "perc",
    "segments" : ["perc"],
    "total"    : 100.0,
})

If you need some inspiration for your own definitions, you can look at the file
“~/lib/python/cmk/gui/plugins/metrics/check_mk.py” section “Metrics” and “Perf-O-Meters”
This is also advised to check if your metric is already defined and only the perf-o-meter is missing.

1 Like