From 872368f9c7951f58eaa96853f9ecdc82f040b14e Mon Sep 17 00:00:00 2001 From: jhelmich2 <54704425+jhelmich2@users.noreply.github.com> Date: Mon, 2 Sep 2019 14:17:19 +0200 Subject: [PATCH] Add files via upload Adjusted *.iteritems() to *.items() which will work for Python 3 aswell as Python 2 (since iteritems is outdated for python3 and breaks the salt-state). --- Alerts | 15 +++++++++++++++ Probes | 9 +++++++++ Targets | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Alerts create mode 100644 Probes create mode 100644 Targets diff --git a/Alerts b/Alerts new file mode 100644 index 0000000..f83242f --- /dev/null +++ b/Alerts @@ -0,0 +1,15 @@ +{%- from "smokeping/map.jinja" import smokeping with context -%} +*** Alerts *** + +to = {{ salt['pillar.get']('smokeping:alerts:to', 'alertee@address.somewhere') }} +from = {{ salt['pillar.get']('smokeping:alerts:from', 'smokealert@company.xy') }} + +{% for alert, options in smokeping.alerts.items() -%} +{% if options is mapping() %} ++ {{ alert }} +{% for key, value in options.items() -%} +{{ key }} = {{ value }} +{% endfor %} + +{% endif %} +{% endfor %} diff --git a/Probes b/Probes new file mode 100644 index 0000000..55dc96a --- /dev/null +++ b/Probes @@ -0,0 +1,9 @@ +{%- from "smokeping/map.jinja" import smokeping with context -%} +*** Probes *** + +{% for probe, settings in smokeping.probes.items() %} ++ {{ probe }} +{% for key, value in settings.items() %} +{{ key }} = {{ value }} +{% endfor %} +{% endfor %} diff --git a/Targets b/Targets new file mode 100644 index 0000000..4a37928 --- /dev/null +++ b/Targets @@ -0,0 +1,20 @@ +{%- from "smokeping/map.jinja" import smokeping with context -%} +{%- set targets = smokeping.targets -%} +*** Targets *** + +probe = {{ smokeping.targets.probe }} +menu = Top +title = {{ smokeping.targets.title }} +remark = {{ salt['pillar.get']('smokeping:targets:remark', '') }} +alerts = {{ salt['pillar.get']('smokeping:targets:alerts', '') }} + +{% for target, options in smokeping.targets.items() -%} +{% if options is mapping() -%} ++ {{ target }} + +{% for key, value in options.items() -%} +{{ key }} = {{ value }} +{% endfor %} + +{% endif %} +{% endfor %}