如何获取icinga2警报数据

时间:2017-08-16 07:34:15

标签: monitoring icinga2

我已设置阈值以在icinga2中获取基础架构的警报。警报即将发布在Icinga2 UI上,但是如何使用JAVA或python通过API调用获取所有警报数据。我只需要提醒数据。

1 个答案:

答案 0 :(得分:1)

使用event Stream

以下是一个例子:

curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=america&types=CheckResult&filter=event.check_result.exit_status==2'

这意味着只要服务变得严重,您就会获得数据。如果您需要return codes,请点击此处了解更多信息。 Icinga2和Nagios一样使用。