I'm creating an application that shows the current list of active alerts as reported by a few different alerting platforms. I'm running into difficulty with supporting Zabbix (7.0) via its JSON APIs, because I can't seem to find each type of data that I'm looking for. The main one is the time stamp of each last state change. I'd also love to fetch the domain name of a service as previously entered by a user (or a script) without making a reverse DNS lookup on its IP address. In other words, to have more than just the display name, which may not be a valid URL that can be followed.
One relevant detail is that my app tries to show all currently active alerts, and a user may go in and out of network coverage with their phone, so they can't always be subscribed to a feed of alerts. I don't want to set up a server that records people's Zabbix data and sends push notifications when they're back online. I'd like for old, or previously missed alerts to be displayed, so I'm looking at queries that show the current state of the network. If I should be looking at the `Alert` and `Event` APIs for that use case, please let me know.
Looking at the Version 7.0 "Host" API documentation, I see no parameter for getting the start time of a host up / down status via the JSON API. The Version 7.0 "Service" API has an `alarm` field that can be queried, but a date range is required, and I don't want all alarms, nor do I want a small window of them, because the first may cause too much server load and bandwidth, and the second may cause an artificial limit on reported alerts. Similarly, the Version 7.0 "Item" API seems to integrate with queries about hosts. It provides `lastclock`, which wraps to 0s after 1m, and `lastns`, which is hyper-precise, but by default, ages don't persist longer than a day.
In addition to the others mentioned above, I'm looking for the last time of a state change (up / down, ok / warning / disaster, etc), ideally in seconds since the epoch. Other host and service monitoring software provide this data in a way that is easy to access, which helps with building integrations with those services. Am I missing the right documentation? Are these features that can be added to the Zabbix `get` API? Thanks! : )
One relevant detail is that my app tries to show all currently active alerts, and a user may go in and out of network coverage with their phone, so they can't always be subscribed to a feed of alerts. I don't want to set up a server that records people's Zabbix data and sends push notifications when they're back online. I'd like for old, or previously missed alerts to be displayed, so I'm looking at queries that show the current state of the network. If I should be looking at the `Alert` and `Event` APIs for that use case, please let me know.
Looking at the Version 7.0 "Host" API documentation, I see no parameter for getting the start time of a host up / down status via the JSON API. The Version 7.0 "Service" API has an `alarm` field that can be queried, but a date range is required, and I don't want all alarms, nor do I want a small window of them, because the first may cause too much server load and bandwidth, and the second may cause an artificial limit on reported alerts. Similarly, the Version 7.0 "Item" API seems to integrate with queries about hosts. It provides `lastclock`, which wraps to 0s after 1m, and `lastns`, which is hyper-precise, but by default, ages don't persist longer than a day.
In addition to the others mentioned above, I'm looking for the last time of a state change (up / down, ok / warning / disaster, etc), ideally in seconds since the epoch. Other host and service monitoring software provide this data in a way that is easy to access, which helps with building integrations with those services. Am I missing the right documentation? Are these features that can be added to the Zabbix `get` API? Thanks! : )
Comment