Automation - Grabbing data from service

Hi Everyone,

Hope you are well! I need to extract data for many services in my instance.
The services I am after are if64 checks. I have to import the data in python script for link capacity and maximum usage for the last 35 days. Is there a way I contact Check_MK via API or I have to do web scrapping?

Thanks in advance!

This depends on your used version - Enterprise or RAW?

Hi andreas,

Sorry for not specifying. The version I am using is Enterprise 1.6.0p10

Then it is possible to get performance data with livestatus.
In the following thread is a example.

1 Like

Thanks Andreas,

I have the following problem using your example:

lq "GET services\nFilter: host_name = EPUS-QAS01-0201-MX01-023\nFilter: service_description = Interface ae0\nColumns: rrddata:innucast.max,1,*:1592037600:1592066400:1\nOutputFormat: json"

and the result is [[null]].

When I type in lq “GET services\nFilter: host_name = EPUS-QAS01-0201-MX01-023\nFilter: service_description = Interface ae0\nOutputFormat: json”

I get very long output and I don’t know how to search for the maximum value for the last 35 days.

This is from my older post

Columns: rrddata:m1:<performance data name>.max,1,*:<start time>:<end time>:1

In your version the “m1” is missing
If this works you will also get a very long list of data. Now you have to search for the max value with your python script.

1 Like

Thanks, It was my bad!

Now I have the following problem-
This is the command I use:
lq “GET services\nFilter: host_name = EPUS-QAS01-0201-MX01-023\nFilter: service_description = Interface ae0\nColumns: rrddata:m1:in.max,1,*:1592037600:1592066400:1\nOutputFormat: json”

and the output is this:
[[[1592028000,1592071200,21600,1.59443e+09,1.95244e+09]]]

According to check_MK this is:
in=134278379.978686;7500000000;10000000000;0;12500000000 inucast=241499.992902;;;; innucast=19.949243;;;; indisc=0;;;; inerr=0;1;5;; out=141144677.100106;7500000000;10000000000;0;12500000000 outucast=241912.593909;;;; outnucast=19.962437;;;; outdisc=0;;;; outerr=0;1;5;; outqlen=0;;;; in_avg_5=85468998.956227;7500000000;10000000000;0;12500000000 out_avg_5=88315319.360875;7500000000;10000000000;0;12500000000

So now my question is how to read and understand the output provided, i.e . what shows this value? [[[1592028000,1592071200,21600,1.59443e+09,1.95244e+09]]]

P.S. The numbers should show link Input Utilisation.