简体   繁体   中英

How to fetch sensu servers events data

I have set the threshold value to get the events in sensu server for infrastructure. Events are coming on sensu UI but how to fetch this all event data through API call either using JAVA or python. I need only event data.

You'll need to ensure you have a Sensu API up and running correctly, which I'm assuming you do if you're running the UI. At that point, you can use a simple HTTP client in Java to communicate with the Sensu API on the /events endpoint ( related documentation ).

For example, if you have a client called test-client and a check called check-test , you can do something like:

$ curl http://mysensu.com:4567/events/test-client/check-test

and that will follow the documented spec above to return the event information (or 404 if there is no event for that client/check combination).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM