Accessing metric data in check routine

Have you already tried CheckMK LQL? You should get all metrics from the particular Host & service with the following command.

lq "GET log\nFilter: host_name = HOSTNAME\nFilter: service_description = SERVICE\nFilter: time >= $$(date +%s)-3600\nColumns: Columns: host_name service_description time current_service_perf_data"

Of course, replace “HOSTNAME” & “SERVICE” with your with your particular settings.

Note: The metrics are structured as follows:

metric_name=value;warn;crit;min;max