Change time range for automation of csv export via URL

Hello

I’m trying to create a script that returns the availability of a service for a given day. I’m using the “Availability timeline” view as it is closest to my needs. To obtain the URL that I need, I followed these steps:

  1. Navigate to Monitor > All hosts.
  2. Go to Hosts > Services of a host.
  3. Select the needed service.
  4. From the “Service” dropdown, select availability.
  5. From “Availability” dropdown, under “Display mode”, choose “Timeline”.
  6. From “Availability” dropdown, select “Change display options” and choose the “Date range” option from “Time range” dropdown.

For example purposes, let’s say I choose the date range from: 15/04/2024 to 15/04/2024

From the “Export” menu, I select “Export as CSV”, copy the link provided, and use it. So far, everything works correctly.

The problem arises when I try to change the dates in the link. Regardless of the dates I provide, the response I receive is from the last date I chose in the interface. I can change the host and service, and I receive data from the selected service/host, but the date remains the same as the last one selected in the interface (15/04/2024 in my case).

Is it possible that my automation user lacks permissions? Or am I doing something else wrong?

Below an example of the request I use:

curl -G \
--header "Content-Type: text/csv;charset=UTF-8" \
--header "Authorization: Bearer username secret"
"https://{server}/{site_name}/check_mk/view.py?
apply=Apply&
av_mode=timeline&
mode=availability&
view_name=service&
host={host_name}&
service={service_description}&
site={site_name}&
output_format=csv_export&
avo_rangespec_16_days=0&
avo_rangespec_16_hours=0&
avo_rangespec_16_minutes=0&
avo_rangespec_16_seconds=0&
avo_rangespec_17_0_day=19&
avo_rangespec_17_0_month=4&
avo_rangespec_17_0_year=2024&
avo_rangespec_17_1_day=19&
avo_rangespec_17_1_month=4&
avo_rangespec_17_1_year=2024&
avo_rangespec_sel=17&
avoptions=set"

I have tried removing apply=Apply, avoptions=set, avo_rangespec_16_* but there is no difference. My Checkmk version is “Checkmk Raw Edition 2.2.0p18”

Thank you,
Gabriela