Skip to content

Instantly share code, notes, and snippets.

@greenmoss
Created July 30, 2010 20:15
Show Gist options
  • Save greenmoss/501235 to your computer and use it in GitHub Desktop.
Save greenmoss/501235 to your computer and use it in GitHub Desktop.
search(:node, 'nagios_monitor_removal:[* TO *]') do |monitoring_node|
if(monitoring_node[:nagios][:monitor_removal].include?(node[:hostname]))
node[:reclamation][:was_shut_down] = true
ruby_block "shutdown" do
block do
node.save
end
end
execute 'halt' do
command 'halt &'
end
else
node[:reclamation][:was_shut_down] = false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment