Problem with units in local check

CMK version: 2.4.0p3 CCE
OS version: Ubuntu 24.04

Hi there,

I have a problem with the metrics of my local check.
I built a script to get the size of my BORG backups and I wanted to show them as a graph in Checkmk. This works fine so far.
But I cannot get the graph to autoscale to MB / GB / TB. It just stays with bytes.

In the local check I put a “B” behind the output and the output looks like that:

0 "BORG: server.tld" number=17;5:;3:|this_original=16380000000B;;;;|this_compressed=14830000000B;;;;|this_deduplicated=35430000B;;;;|all_original=251370000000B;;;;|all_compressed=229120000000B;;;;|all_deduplicated=6070000000B;;;; 17 backups found, last backup made on 23.07.2025 04:00, size: 35.43 MB (dedup), 16.38 GB (original)\nListe der Backups:\n - 2025-01-31_00:22 (31.01.2025 00:22)\n - 2025-02-28_04:00 (28.02.2025 04:00)\n - 2025-03-31_04:00 (31.03.2025 04:00)\n - 2025-04-30_04:00 (30.04.2025 04:00)\n - 2025-05-31_04:00 (31.05.2025 04:00)\n - 2025-06-22_04:00 (22.06.2025 04:00)\n - 2025-06-29_04:00 (29.06.2025 04:00)\n - 2025-06-30_04:00 (30.06.2025 04:00)\n - 2025-07-06_04:00 (06.07.2025 04:00)\n - 2025-07-13_04:00 (13.07.2025 04:00)\n - 2025-07-17_04:00 (17.07.2025 04:00)\n - 2025-07-18_04:00 (18.07.2025 04:00)\n - 2025-07-19_04:00 (19.07.2025 04:00)\n - 2025-07-20_04:00 (20.07.2025 04:00)\n - 2025-07-21_04:00 (21.07.2025 04:00)\n - 2025-07-22_16:28 (22.07.2025 16:28)\n - 2025-07-23_04:00 (23.07.2025 04:00)

But my graph is looking like that:

What am I doing wrong?`

Looking forward for your help.

Regards,
Man-in-Black

I would say it stays with “count”. The “B” from the performance data is ignored inside CheckMK.
You need to define for your metric a definition.

Thanks for the answer.

Is this the right place to start with?

So I need to write a plugin, not a local check correct?

I am quite sure that you can find a matching existing metric that leads to correct graph legends:

1 Like

I’ve found that “bytes” are defined here ~/lib/python3/cmk/gui/plugins/metrics/unit.py but that didn’t seem to work.

I think here I need to dive in to create the right definition.

Not the units, the metrics in the graphing directory, for example: