0
0
mirror of https://github.com/saltstack-formulas/smokeping-formula.git synced 2026-01-08 10:44:03 +01:00

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).
This commit is contained in:
jhelmich2 2019-09-02 14:17:19 +02:00 committed by GitHub
parent 1cfbec0d38
commit 872368f9c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

15
Alerts Normal file
View File

@ -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 %}

9
Probes Normal file
View File

@ -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 %}

20
Targets Normal file
View File

@ -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 %}