currently Im writing a plugin where I use the ‘metric()’ method. Now I have the issue if I use serveral ‘metric()’ methods it shows me 4 single graphs, each with 4 values. My goal is one graph with 4 values.
Well I think it has to do with 4x yield, but I dont know how to put all 4 values in one ‘metric()’ method. The API shows only metric for one value every time. I dont know but check_levels also see not right to me. So how can I fix this?
The checks always output single metrics. It is the graph system that then combines multiple metrics into one graph. You need to write a metric definition and a graph definition for this to work.
I do not know if there is any documentation about doing this available.
Hi r.sander,
I did write a metric definition in /web/plugins/metrics/, but did I have to include it into the code in the “register.check_plugin” section? My metric definition looks similar to your example, so I think its correct.
The problem is it is not really documented in the official API and on the website how to do it. Is there a event listener for the yield or where is the graph composed? I didnt understand what exactly where it goes wrong and what to do.
Ok, I now know where the bug is.
If you go to "/local/share/check_mk/web/plugins/metrics/{your script} and open it serveral times. Check_MK generates for each time you open it a graph. If you restart the apache he only shows one or you wait until a garbage collector collects some internal swap files.