klinton.lee
(Klinton Sae Hyung Lee)
March 16, 2021, 12:08pm
1
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.
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
tosch
(Tobias Schönau)
March 16, 2021, 1:59pm
3
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:
klinton.lee
(Klinton Sae Hyung Lee)
March 16, 2021, 2:20pm
4
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.
tosch
(Tobias Schönau)
March 16, 2021, 2:26pm
5
You are missing the option about the information you want to get back, take a look after the -d option in the documentation.
klinton.lee
(Klinton Sae Hyung Lee)
March 16, 2021, 2:43pm
7
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]}}
ChristianM
(Christian Michaelski)
March 16, 2021, 3:49pm
8
Hi,
the action is wrong. Please try “get_graph_recipes” or “get_metrics_of_host” depends what you need.
Cheers,
Christian
3 Likes
klinton.lee
(Klinton Sae Hyung Lee)
March 16, 2021, 4:44pm
9
Thank u so much Christian!!!
system
(system)
Closed
March 16, 2022, 4:45pm
10
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.