Skip to content

Instantly share code, notes, and snippets.

@mmattice
Created September 17, 2014 14:44
Show Gist options
  • Save mmattice/6662c3539e5249999aad to your computer and use it in GitHub Desktop.
Save mmattice/6662c3539e5249999aad to your computer and use it in GitHub Desktop.
Monit configuration to kick puppet agent processes if they get stuck
check process puppet with pidfile /var/run/puppet/agent.pid
start program = "/etc/init.d/puppet start"
stop program = "/etc/init.d/puppet stop"
check file puppetdlock with path /var/lib/puppet/state/puppetdlock
if timestamp > 1 hour
then exec "/bin/bash -c '/etc/init.d/puppet stop ; rm -f /var/lib/puppet/state/puppetdlock'"
check file agent_catalog_run.lock with path /var/lib/puppet/state/agent_catalog_run.lock
if timestamp > 1 hour
then exec "/bin/bash -c '/etc/init.d/puppet stop ; rm -f /var/lib/puppet/state/agent_catalog_run.lock'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment