General help with using metric definitions with a plugin

As I am doing a couple of plugins, I started messing with the metric definitions to create the combined graphs for like bandwidth. Two things I am wondering about is

CheckMK moved to this color wheel for defining a color for your metrics and I get how to use that but… I would like for example my bandwidth graph to look consistent with all the CheckMK generated ones, and for the life of me none of the colors on their wheel whether I use the a/b don’t come out to the same green and blue they use. So, I looked at their metric definitions and they don’t seem to be using their own color wheel. am I missing something about their predefined color wheel that can allow me to duplicate and make the same green and blue they use, or do you have to use the hex values which they are claiming will go away.

Secondly, I am not sure how to force the combined bandwidth graph to use a mirrored area like the standard bandwidth graph they produce uses where input is above and ouput is below. In the documentation for writing your own metric definition they say line, area, stack, but no mirrored versions of those. I have done mirrored in CheckMK’s gui when creating custom graphs but obviously I want this in my plugin. Can you do the mirroring in the metric definition file so that output or whatever I want can be mirrored on the axis?

for the mirror versions prefix them with a minus - (-line, -stack, -area)

It might be easiest to just use the built-in metrics

Well, that was super easy. I wish this stuff was in the documentation. How would you or I find this out on our own? Sometimes feel silly asking these questions but I don’t seem to find the answer in documentation. where else would I look?

How would I accomplish this? would I have to name my metric the same as what they do for it to grab or is there another way of using it?

true :slight_smile:

As you did with the colors, by looking at the builtin stuff…

1 Like

by naming your metrics like the build in metrics. Ie. for bandwith in/out name them if_in_bps / if_out_bps or renaming them in your metrics definition (see ~/lib/check_mk/gui/plugins/metrics/ for examples).

1 Like

Ok using the built-in metric definition is genius. I didn’t need to re-invent the wheel. This piece of hardware just doesn’t use the normal interfaces / if / if64 oids, hence the need for the plugin. Appreciate the help.

1 Like