Three hosts, one service check?
Hi,
I have a datasource that uses a regex to pull values out of some JSON and graphs numerous values. This runs on multiple hosts and the host goes critical if a particular value hits 0.
I don't want the individual servers to go critical, I'd like a service/website check to go critical if two out of three sites return the zero value in their JSON response.
I can write a datasource to check the JSON from each site but then I have to apply it to a host, or multiple hosts, and that defeats the point as I don't care if a single one goes away.
Is it possible to create a website check that takes in the JSON, extracts the data required, then passes it on to be used in another step which checks the next site, can I alert on values within the response? Is this even the right way to do it?
It would be great if a datasource could be run from a collector group rather than tied to a specific host!
Tom_S-L
OP8 years agoThanks Kerry, this is a good start.
As stated I need to check datapoints from multiple servers and alert if, say, 2/3 had an issue. If I can pass the result on to more steps then this will work as a website check.
Kerry DeVilbiss
·8 years ago@Tom S-L - using our internal website checks (with multiple collectors as checkpoints,) you could check the JSON path for that specific datapoint to make sure that '0' is not present - and alert if it is in fact found (on a certain number of collectors of those you have specified.) For example:
I think that should work for the use case you've outlined. And just in case it's helpful, here's a set of links to the more advanced creation of scripted internal website checks:
Cheers,
Kerry