Digitaldaz
(Darren Williams)
October 21, 2025, 7:48am
1
Hi all
I’m quite new to checkmk and am using the check http service to do a healthcheck on a URL I have.
The response contains some json and within it there is a line: “status”: “OK”
I have tried all sorts of different combinations to get this to match but so far have failed.
I have tried it with just a straight string and all sorts of different regex. I can get it to match until I reach the space.
Can anybody help please.
TIA
Daz
Dirk
October 21, 2025, 8:37am
2
Hi Daz and welcome to the forum.
I would assume that this would work (I omitted an endpoint in this example):
The pattern is
"status":\s*"OK"
The \s* means: an arbitrary amount of whitespace (including none). So this will match
"status": "OK"
"status": "OK"
"status":"OK"
1 Like
LaSoe
(Lars Sörensen)
October 21, 2025, 8:38am
3
Since Checkmk still doesn’t have a check for JSON responses, you might want to consider trying Bastian Kuhn’s check:
And vote for:
https://ideas.checkmk.com/suggestions/302561/add-a-generic-plugin-for-polling-of-json-status-apis
If you wish to continue using check_httpv2 , you can try one of the following:
"status":"OK",
"status":\s*"OK",
"status"\s*:"OK",
"status"\s*:\s*"OK"
"(?i)status.*?:.*?ok"
"status.*?OK"
or simply search only for "OK"
On https://regex101.com/ you can play around and test your regex.
Digitaldaz
(Darren Williams)
October 21, 2025, 8:57am
4
Dirk:
"status":\s*"OK"
Thank you, that matched perfectly, I had tried \s without the *
1 Like
Digitaldaz
(Darren Williams)
October 21, 2025, 8:59am
5
Thank you, I will look at these.
I did think to check for just the OK and that did worked but I know there will be more complex ones in the future. I will certainly check out the agent_json.