Skip to content

Instantly share code, notes, and snippets.

@bahamat
Last active August 29, 2015 14:10
Show Gist options
  • Save bahamat/851c24b6d1a0de0e4f10 to your computer and use it in GitHub Desktop.
Save bahamat/851c24b6d1a0de0e4f10 to your computer and use it in GitHub Desktop.
CFEngine health check example
classes:
named_is_running::
"zone_data_is_healthy" expression => returnszero("/usr/bin/host -t soa digitalelf.net 127.0.0.1","noshell");
reports:
debian.named_is_running.zone_data_is_healthy::
"Zone data is healthy";
processes:
debian.bind_is_installed::
"named"
depends_on => { "bind_apt_get_install_bind9" },
handle => "named_is_running",
comment => "If bind isn't running, start it",
classes => if_ok("named_is_running"),
restart_class => "StartBind";
methods:
# If quagga is started before zone data is ready then name resolution will fail.
# Delay starting quagga until we know that zone data is healthy.
(debian.named_is_running.zone_data_is_healthy).!dns_master::
"quagga" usebundle => quagga;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment