naemon / naemon-core

Networks, Applications and Event Monitor
http://www.naemon.io/
GNU General Public License v2.0
151 stars 63 forks source link

add problem timestamps and duration #447

Closed sni closed 7 months ago

sni commented 7 months ago

this PR makes hosts / services save the start and end timestamp of the current problem. Those values can then be used as macros, ex. in notification scripts. For this, there are several new macros available:

the same macros exist for services:

While there is a currently ongoing problem, the values point to this current problem and the end timestamp is zero. Once the problem is resolved, the values can still be used and won't change until a new problem starts.

This makes it possible to use the problem duration in recovery notifications which otherwise would not be possible.

Since this change affects the host/service structs, the neb api version has to be increased and NEB modules have to be rebuild. Once this is accepted, i will add PRs to add those columns to livestatus and the docs on the webpage.

sni commented 7 months ago

Adding the uuid commit here, since it overlaps a bit with the problem macros. If that's an issue, i can move it into a separate PR.

nook24 commented 7 months ago

This Pull Request also changes the behavior of the following macros to be UUID v4 strings (e.g. e79dedf8-97a5-4fe5-aaf4-68a0ca7fe396) instead of simple integer counters.

This ensures that the IDs can be used as unique identifiers

sni commented 7 months ago

thanks for the review