So I have a host that is UP and running fine.
Suddenly, it goes down at 10:55:00 (example)
After that, the soft check goes 1/3…2/3…3/3 (1 minute delay during each soft check)
When it pings 3 times, the host is definitely down at 10:58:00.
When I receive the notification via e-mail, I’ll get the following:
Dummy is DOWN!
Info: PING CRITICAL - Packet loss = 100%
When: 2019-02-11 10:58:00 -0200
Host: Dummy
The “When” statement says : 10:58:00, but the host has been down since 10:55 (the first soft check). I know I can simply subtract three minutes on .sh, but what if different hosts have different soft checks delay? How can I change that time?
that timestamp refers to the last HARD state being a problem. The default notification scripts take that as longdatetime parameter.
passing it along from the NotificationCommand object
setting a default to the $icinga.long_date_time$ runtime macro.
You could also use host.last_state_change but that returns a unix timestamp. Either you’ll format that inside the notification script, or with something like that in your Notification apply rule.