Multi dot value as metric showing up wrong

CMK version: Checkmk Raw Edition 2.2.0p21
OS version: Debian

Hey, I am not able to show a multidot value in my graph:
root@gitlab:/usr/lib/check_mk_agent/local# ./check_version.sh
0 “GitLab version” version=16.8.1 GitLab version of gitlab.company.local is 16.8.1-ee

I would expect the graph to show “16.8.1”, instead its showing “16.8”. Why?

Checkmk graphs show numbers - 16.8.1 is not really a mathematical number and more a string that we humans read as a number.

I would suggest adapting your local check and removing the second dot while padding the minor release + patch version would be best, i.e…

16.8.1 → 160801 or 16.0801

if you just removed the dot, you wouldn’t be able to tell
16.81.0 apart from 16.8.1

1 Like

Fuck, it doesnt work, it does not show more than one digit behind the dot.

peterge@thinkpadt14s:~/git/checkmk/custom-checks/gitlab-health-api$ ./check_version.sh 
0 "GitLab version" version=16.81 GitLab version of gitlab.company.local is 16.8.1-ee

160801 is a bad idea too:
image

ah… scientific notation… I think there are some discussions about this going on, but I didn’t follow them to closely.

What would happen if you apply the same logic that you have for the last dot, to the first? i.e. use 160801 as a number? I’d hope that is short enough to be shown completely.

Hm I ended up with deleting the dot:

version_without_ee="${gitlab_version%-ee}"
version_without_dots=$(echo "$version_without_ee" | tr -d '.')

The graphs may look weird when the version goes from 16.8.1 to 16.9 and to 16.9.1, but at least its easy to see that version jumps happened. Because this is the reason why I am doing this, I am setting up an automation with ansible & ci to auto update applications for my company.

A version number is not a metric.

2 Likes

the first version 160801 would prevent the weird graphs… the update would then go to 160900 (on the other hand, that would probably mean the graph is almost a straigt line :smiley:

2 Likes

image

I prefer this way :slight_smile: