Skip to content

Instantly share code, notes, and snippets.

@froztbyte
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save froztbyte/84567bc895121152f16e to your computer and use it in GitHub Desktop.
Save froztbyte/84567bc895121152f16e to your computer and use it in GitHub Desktop.
checks:
https_alive:
command: curl -s -kLI https://localhost/
interval: 30
subscribers: [https]
handlers: [flapjack]
type: metric
root@monitor:/etc/sensu/conf.d# cat https.json
{'checks': {'https_alive': {'type': 'metric', 'interval': 30, 'command': 'curl -s -kLI https://localhost/', 'subscribers': ['https'], 'handlers': ['flapjack']}}}
include:
- sensu.server
{% set role = 'https' %}
{% set components = ["monitoring/files/maps/", role] %}
{% set ifilepath = components|join('') %}
{% import_yaml ifilepath as contents %}
{{ role }} sensu role subscriptions:
file.managed:
- name: /etc/sensu/conf.d/{{ role }}.json
- contents: {{ contents | json }}
- watch_in:
- service: sensu-server
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment