Module: check_mk
Branch: master
Commit: 2e75ea98d1d4b2ef4452c2181268273687aa6580
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e75ea98d1d4b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 13 17:05:12 2013 +0100
notify module: LASTHOSTSTATECHANGE and LASTSERVICESTATECHANGE are optional vars
---
modules/notify.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/notify.py b/modules/notify.py
index eb4bf17..14496dc 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -255,8 +255,9 @@ def do_notify(args):
set_fake_env('host', context)
sys.exit(call_notification_script(plugin, [], context))
- context['LASTHOSTSTATECHANGE_REL'] =
get_readable_rel_date(context['LASTHOSTSTATECHANGE'])
- if context['WHAT'] != 'HOST':
+ if 'LASTHOSTSTATECHANGE' in context:
+ context['LASTHOSTSTATECHANGE_REL'] =
get_readable_rel_date(context['LASTHOSTSTATECHANGE'])
+ if context['WHAT'] != 'HOST' and 'LASTSERVICESTATECHANGE'
in context:
context['LASTSERVICESTATECHANGE_REL'] =
get_readable_rel_date(context['LASTSERVICESTATECHANGE'])
if notification_logging >= 2: