Script environment variable OBSERVIUM_DURATION always 0s
hi, another issue i am finding with script variables is OBSERVIUM_DURATION. i am including in script notifications but it always reports as 0s (current date). so in other words, the duration of the alert is always reported to be 0s.
this seems like a bug as well?? should i put in a ticket for this also?
thanks again for all your help!
Do you mean on recovery notifications?
This is because of some code path issues where the variables used to calculate this have already been reset, we'll need to juggle some stuff around to fix it.
adam.
Tony Guadagno via observium wrote on 26/02/2026 13:09:
hi, another issue i am finding with script variables is OBSERVIUM_DURATION. i am including in script notifications but it always reports as 0s (current date). so in other words, the duration of the alert is always reported to be 0s.
this seems like a bug as well?? should i put in a ticket for this also?
thanks again for all your help! _______________________________________________ observium mailing list -- observium@lists.observium.org To unsubscribe send an email to observium-leave@lists.observium.org
yes, the recovery notification. Thanks for your efforts on this. let me know if i can help.
btw, do you want me to put in a bug report?
nono, i'm seeing how it can be fixed now.
i'm even worse at dealing with the jira stuff than i am with mailing list stuff :D
Thanks, adam.
Tony Guadagno via observium wrote on 26/02/2026 15:18:
yes, the recovery notification. Thanks for your efforts on this. let me know if i can help.
btw, do you want me to put in a bug report? _______________________________________________ observium mailing list -- observium@lists.observium.org To unsubscribe send an email to observium-leave@lists.observium.org
I have a feeling this bug has been extant for over a decade but no one noticed. It's a leftover from a very old form of the alerting system.
last_ok is immediately reset to now() when the check returns OK, so it's never available to do the duration calculation later on. I suspect a very long time ago the duration calculation was done in a different location, but that must have been before the poller <> alerter code split, so a very very long time ago.
I've done a workaround by putting the previous_last_ok into the database in the json blob, rather than modifying the schema for it.
It should work now, if a little bit sub-optimally in terms of code/data path.
it's in r14636.
Thanks, adam.
Tony Guadagno via observium wrote on 26/02/2026 15:38:
LOL, ok, np
thanks _______________________________________________ observium mailing list -- observium@lists.observium.org To unsubscribe send an email to observium-leave@lists.observium.org
participants (2)
-
Adam Armstrong -
Tony Guadagno