How can i extract the maintenance history for a particular hosts (when it start/ends and so on)? I've just search on database but the maintenances tables only who info about actual maintenances.
Ad Widget
Collapse
Maintenance History
Collapse
X
-
You can create, update, and read maintenance info via the API, if you're comfortable doing JSON RPC programming. -
I think there is no such history of "being under maintenance". Server acts upon maintenance records, but it will not be reflected somewhere in DB, that this or that host was in maintenance mode from X to Y... I suppose you can pull maintenance records and just assume, that everything, that matches it, was in maintenance at that moment.. In hosts data it reflects only if it is currently under maintenance.Comment
-
I was thinking more along the lines of what cyber explained.
When you look at a host, the "in maintenance" boolean only tells you if that host is currently considered in maintenance.
If you use the API to get all of the historical maintenance periods, though, you can examine them and see what hosts and host groups were included in any particular maintenance period.
As cyber explained, that's not perfect though, for many reasons- someone can modify expired maintenance periods and add or remove hosts, which makes it look like a host was (or wasn't) in maintenance as some time in the past, when it actually was
- many sites delete their old maintenance data, so you may not have historical data for some hosts, if the person that typically handled maintenance for them "cleaned up" the maintenance period after it was over
- probably worst of all, with recurring maintenance periods, you would have to effectively do the same time calculations that Zabbix's maintenance code does, to decide if a host was in maintenance at a particular date and time.
TimComment
Comment