Skip to content

Instantly share code, notes, and snippets.

@quantonganh
Last active January 3, 2016 10:29
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 quantonganh/8449903 to your computer and use it in GitHub Desktop.
Save quantonganh/8449903 to your computer and use it in GitHub Desktop.
{%- macro passive_check(state, service) -%}
{%- set state_checks = salt['monitoring.discover_checks_passive'](state) -%}
{%- for host in pillar['shinken_pollers'] -%}
*/{{ state_checks[service]['passive_interval'] }} * * * * nagios output=$({{ state_checks[service]['check_command'] }}); return_code=$?; printf "%s\t%s\t%s\t%s\n" "{{ grains['id'] }}" "{{ service }}" "$return_code" "$output" | /usr/local/nagios/bin/py_send_nsca -H {{ host }} -c /etc/send_nsca.conf
{%- endfor -%}
{%- endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment