Combine metrics with dynamic names

I have developed a plugin that analyzes the buffer pool usage of each database within an MSSQL instance.

This plugin provides individual metrics for each database.

I would like to create a consolidated view that combines these metrics on a graph. However, it appears that in checkmk, the database names need to be hardcoded in order to combine metrics on a graph. This approach is not suitable for me because I intend to run this plugin on instances that frequently change.

Could this be something checkmk can add to future releases?

This is the desired view that I want to achieve.

I manually created this custom graph by summing up the metrics of the databases, but this approach becomes impractical when the instance has over 100 databases and new ones can be added at any moment.

Is there any way to programmatically generate a custom graph like this?

Any ideas how i can accomplish what i want?

If I understand your request correctly - and if you are using the enterprise (or free/cloud) edition you can use: How to combine all same metrics of a series of hosts into a custom graph in one go - #2 by gstolz

thank you for the reply, i tried that and it seems to comebine services that yield a metric with a matching name. but i want to combine metrics by service

ah. ok, so you got multiple services

Service with name “metric DB_A” and the metric is called “db_a_io_percent”
Service with name “metric DB_B” and the metric is called “db_b_io_percent”

is that correct?

Or are db_b_io_percent and db_a_io_percent both metrics of the same service?

if you have multiple services: use the same logic that checkmk uses for all their plugins:
metrics don’t include the item (i.e. filesystem, db, interface) name - hence allowing the grouping

if you want all your metrics for different databases to be in the same service, I think you’ll need to dive into the metric definitions to see if you can group metrics with wildcards. It might be possible, but I guess it’s more complicated. Also, I think you’re possibly creating huge rrd files if you have a single service potentially collecting metrics for tens of databases. So I’d suggest: make you check split the results for each Database into a separate check item.

if you want all your metrics for different databases to be in the same service

my plugin generates 4 services, i want each service to generate a single graph where all the databases are listed like this:

right now each database has to be on its own graph like this:

I think you’ll need to dive into the metric definitions to see if you can group metrics with wildcards

do you know if anyone has got this working with wildcards?