Ad Widget

Collapse

Maintenance History

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • --dik--
    Junior Member
    • Feb 2022
    • 2

    #1

    Maintenance History

    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.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    You can create, update, and read maintenance info via the API, if you're comfortable doing JSON RPC programming.

    Comment

    • --dik--
      Junior Member
      • Feb 2022
      • 2

      #3
      Thank you Tim, as i can see from documentation i can only retrieve hosts that are currently in maintenance but not history, am i right? I'm using zabbix 5.0...

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        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

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          Originally posted by --dik--
          Thank you Tim, as i can see from documentation i can only retrieve hosts that are currently in maintenance but not history, am i right? I'm using zabbix 5.0...
          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.
          The historical maintenance data could potentially answer the question you asked, but it may not work for your site depending on the items (and probably others) I've outlined above. It's all available via the API, though, and if no one deletes old maintenance periods and you don't have people modifying the maintenance after it has expired, then the data is all there. It's just not in a very friendly format for answering the particular question you're asking.

          Tim

          Comment

          Working...