How to show two value in the same graph ( like default windows interface check up/down bandwidth )

Hi,
I’m building custom local check for checkmkv2 to make aspeedtest on top of iperf.
The script from the agents works fine, but I’m wondering how to create on checkmk a single graph to report both value. In most of the “built-in” check like interface bandwidth you can see the same. I would like to create the same with my custom local check.

My current local check output:
0 "SpeedTest iperf3" upload=18.6|download=65.1 Speed: UP: 18.6 DOWN: 65.1 Mbits/sec

I would like to make it in a single graph like:

You need a graph definition what looks like this.

    graph_info["up_down_data"] = {
        "title": _("Upload Download"),
        "metrics": [
            ("upload", "-area"),
            ("download", "area"),
        ],
    }

It would also be good to define your metrics what it is.
As you have Mbits in your output you should also define factors for the correct values in the graph. Normally all traffic values are in bits or bytes per second.

All the definition files should be inside “~/local/share/check_mk/web/plugins/metrics/”.

4 Likes