Check_MK exception: Unknown API action get_graph

Hi guys,

Firstly, my english is poor, sorry about it;

I’m using Check_MK for monitoring disk, ram and cpu around hundred machines, so, its so much work to do it manually. Then I found web-api, however, one of this actions does not work here.

  • action=get_graph

It keep returning the following message “Check_MK exception: Unknown API action get_graph”.

  • I’m using Check_MK v1.6
  • The automation user its admin

Thank you for your time

Hi @klinton.lee and welcome to the community,

Can you please provide the full API call you are using? (Please censor the sensible informations like username and secret, maybe hostnames)

The documentation to API calls:

Of course I can, and thanks for reply:

My first try was at Postman(API Client) with following url:

  • http://“host”/“my-site”/check_mk/webapi.py?action=get_graph&_username=“username”&_secret=“secret”

I tried with curl too, coping and pasting parameters as shown in the documentation.

You are missing the option about the information you want to get back, take a look after the -d option in the documentation.

It keep returning:
{
“result”: “Check_MK exception: Unknown API action get_graph”,
“result_code”: 1
}

I tried with cUrl:

curl “http://“myserver”/“my-site”/check_mk/webapi.py?action=get_graph&_username=“automation”&_secret=“myautomationsecret”” -d ‘request={“specification”:[“all_disk_utilization”],“data_range”:{“time_range”:[1609511772, 1611153372]}}’

I tried with this request too:

{“specification”:[“template”,{“service_description”:“Memory”,“site”:“dns-01”,“graph_index”:1,“host_name”:“dns-01”}],“data_range”:{“time_range”:[1609511772, 1611153372]}}

Hi,

the action is wrong. Please try “get_graph_recipes” or “get_metrics_of_host” depends what you need.

Cheers,
Christian

3 Likes

Thank u so much Christian!!!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.