Check_MK RAW Edition: How to enable min-values?

Hi guys,

at home i run an instance of Check_MK RAW 1.5.0p4 and in every diagram i see the current/average/maximum values, but never the minimum value.

Is this standard behavior for the raw edition ? Does a config switch exist, which enables logging of min-values system-wide ?


thanks in advance

EDIT: typo fixed, example pic attached

It depends on the performance data returned by the check. PNP, which is responsible for the visualisation, graphs everything returned. If you want the MIN value, you need to add it to the check. The data is from a temp sensor, so it’s probably obtained via SNMP, check if there is a OID for MIN value on your hardware and add it to the check.

I dont think so, because at work i use the same client plugins (its the default linux temp plugin) with Check_MK Enterprise and here the min values are also calculated and displayed (client output looks exact same on enterprise and raw edition). In my case i use SNMP at no point and if i watch at the raw client output, i can see no min/max/avg, just the actual values. Im pretty sure that min/max/avg is calculated and stored by the check_mk monitoring instance itself.

EDIT: typo fixed

Given that the min/avg/max values are calculated based on the values provided by the sensors I’d suspect that this calculation is done by the PNP template.
Please compare the templates used. Some details can be found here.

1 Like

As Wolfgang mentioned, the calculation is done in the pnp template which works together with the rrd files as datasource. I can’t explain it in detail but I can tell that check_mk RAW itself is NOT doing any calculation and storage of perfdata. In RAW the core (Nagios or Icinga), rrdtool and pnp4nagios is responsible for that. In EE the whole graphing is done a bit different, since they developed their own solution there.
What we also have to take into account are the metrics. Check_mk (RAW and EE) implemented dynamic pnp templates which get specific service info from the metric files of the cmk site. So what you have to do now is: find the pnp-template which is used for the temperature service, check if you can hard code the MIN value to the pnp template or search for a service that uses a MIN in its graph, check for this service in the metrics file (/omd/sites/yoursite/share/check_mk/web/plugins/metrics/ and use this entry for your temp service.


My hope was, that i dont have to manually edit files from check_mk, i thought it was just a config thing in the web gui. What happens to this changes, when i do the next update to the check_mk instance ?

Btw: By editing the file /omd/sites/mysite/share/check_mk/pnp-templates/check_mk-local.php i had successfully enabled displaying the min-values for local checks. I have inserted two lines:

#line 71:
$def[$i] .= "HRULE:$MIN[$i]#0000d0:\"Lower limit\" ";

#line 80:
$def[$i] .= "GPRINT:cnt:MIN:\"min\: %6.2lf\" ";

But i hope i dont have to edit every template after every update…

You can always store changes in new files in the ~/local/share/check_mk/… directories. On updates, ~/local/ files are not touched.
For naming your files you have to consider what the files are used for. E.g. metrics can be stored in any .py file. The naming doesn’t matter. Just for readability(?) I would suggest to give a filename that fits the service. For pnp templates you either have to name the file default.php or [service_name].php. Files in the local directory are processed before the files in ~/share.

As I wrote. Just copy check_mk-local.php to ~/local/share/check_mk/pnp-templates/ and you will be save on upgrades.

1 Like

And in the case the update brings a new version of the file ? Then i stay forever on the old (and modified) version of the file ?

The best way is to get the updates for every file and preserve the changes or i am wrong ?

I’d assume that you have very few files in the local directory so it’d be easy to check for file changes for these files when you’ve done an update.

Are there pnp_templates for e.g. lnx_thermal ? Cant find a template for this type.

Im not able to get MIN-values for basic types like lnx_thermal. Does these basis types also use the pnp-templates ? Im searching back and forth for days now, but i dont find anything. For every other check (like local and so on) it working very nice…

Please take a look at the documentation [in german] on how to determine the template used.

I have read the pnp4nagios article more than one time but that doesnt help me understand which template lnx_thermel uses. Maybe im just to stupid to get it …

Looking at the screenshot you have values for “Hostname” and “Service description”.
In the file system you should find a directory “<hostname>”, inside (at least) a file “<Service description>.xml” and “<Service description>.rrd”.
Editing the xml file there should be line “<TEMPLATE>template</TEMPLATE>”. Elsewhere in the file system you should find a file “template.php”.
This file should be edited to add the MIN value calculation/display.

If you don’t want to manually update the template file you changed you’re encouraged to send patches which might be added to Check_MK…

PNP will append .php to the string and therefore look for a template with the name check_http.php in the following sequence:

  1. templates/check_http.php
  2. templates.dist/check_http.php
  3. templates/default.php
  4. templates.dist/default.php

The template default.php takes an exceptional position as it is used every time no other applicable template is found.