Check mk 2.1 How get service status via http

**CMK version:2.1
**OS version:Linux RH 7.9
I’m using this command to get all service status and works fine
http://sgsvrwsnagc01lx.sistemi.group/mknagios/check_mk/view.py?_do_confirm=Yes&view_name=allservices&host=SGSVRVMVSPC24EX.sistemi.group&_username=automations&_secret=XXXXXXXX&output_format=json

I’m not able to find out the right sintax for get just on service status

Please , could you help me

thanks
Emilio

Hi Emilio,

if you create a new view that just shows Service Description and Service state, the json-Output will be correct.

Go to CustomizeViewsAdd view

Keep All services as Datasource and No restriction as Specific objects.
Set a new ID and Title and add Service description and Service state to your columns.

Click save and replace the allservices with your chosen ID from earlier.
Also you might need to add Hostname to the Columns, if there are multiple Hosts with the same Service Description.

Cheers Jeronimo

thanks for your answer

I wish to add a “filter” at the view
In the example I have just one filter and this is HOST
I like add another filter called service

and use it

Just for example
http://sgsvrwsnagc01lx/mknagios/check_mk/view.py?view_name=allservices&alias=SGSVRVMVSPC24EX&**Service=CPU%20Utilization**&_username=apinagios&_secret=XXXXXXX&output_format=json)

So I can create a Json file with the info of one server with only one service

I hope to explain well what I like to do
thanks
Emillio

Hi,

same thing, you just have to add a

&host_regex=name

to your url. If you want an exact match use ^name$

Cheers Jeronimo

I understood
thanks for your help

have you nice day !!!

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