Closed sni closed 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.
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.
$HOSTPROBLEMID$
$HOSTNOTIFICATIONID$
$LASTHOSTPROBLEMID$
$SERVICENOTIFICATIONID$
This ensures that the IDs can be used as unique identifiers
thanks for the review
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:
$HOSTPROBLEMSTART$
start timestamp of problem$HOSTPROBLEMEND$
end timestamp of problem (or zero if problem still persists)$HOSTPROBLEMDURATIONSEC$
duration of problem$HOSTPROBLEMDURATION$
duration as human readable textthe same macros exist for services:
$SERVICEPROBLEMSTART$
$SERVICEPROBLEMEND$
$SERVICEPROBLEMDURATIONSEC$
$SERVICEPROBLEMDURATION$
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.