Module: check_mk
Branch: master
Commit: b26349e31a0d3307d8ca60036275b07b0da27a74
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b26349e31a0d33…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Dec 11 11:06:24 2014 +0100
#1660 notification plugin spectrum: now configurable via flexible notifications
---
.werks/1660 | 9 +++++++++
ChangeLog | 1 +
notifications/spectrum | 8 ++++++++
3 files changed, 18 insertions(+)
diff --git a/.werks/1660 b/.werks/1660
new file mode 100644
index 0000000..6be1695
--- /dev/null
+++ b/.werks/1660
@@ -0,0 +1,9 @@
+Title: notification plugin spectrum: now configurable via flexible notifications
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418292351
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index ae3ff56..7b6083b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -269,6 +269,7 @@
* 1512 Bulk notification can now be grouped according to custom macro values...
* 1650 Enabled rule based notifications by default (for new installations)...
* 1749 Allow title of notifiation script to be in third line if second line is
encoding: utf-8...
+ * 1660 notification plugin spectrum: now configurable via flexible notifications
* 1168 FIX: HTML mails can now be configured to display graphs among each other...
* 1514 FIX: Try harder to detect previous hard state in notification when using
Nagios as core...
* 1582 FIX: Fixed missing graphs in mails when sending notifications to
non-contacts...
diff --git a/notifications/spectrum b/notifications/spectrum
index dee63b2..28ea1e2 100755
--- a/notifications/spectrum
+++ b/notifications/spectrum
@@ -41,6 +41,14 @@ def main():
(var[7:], value.decode("utf-8"))
for (var, value)
in os.environ.items()])
+
+ # check if configured via flexible notifcations
+ if "PARAMETER_1" in context:
+ context["PARAMETER_COMMUNITY"] = context["PARAMETER_1"]
+ context["PARAMETER_DESTINATION"] = context["PARAMETER_2"]
+
+ # adjust these oids to your needs
+ # Note: HOSTCONTACTGROUPNAMES is only available via cmc
oids = {
"1.3.6.1.4.1.13424.10.5.2.1.1.1" : context['MONITORING_HOST'],
"1.3.6.1.4.1.13424.10.5.2.1.1.2" : context['HOSTNAME'],