From 2a91ae6f91de99fa5283976939f1cf52382da972 Mon Sep 17 00:00:00 2001 From: galstrom21 Date: Fri, 8 Jun 2012 11:47:08 -0500 Subject: [PATCH] Adding in monit support for nova-compute --- attributes/default.rb | 8 ++++++++ recipes/compute-monitoring.rb | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index 88af56a7..05e543b1 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -117,6 +117,10 @@ when "fedora" "mysqld" => { "start" => "/usr/sbin/service mysqld start", "stop" => "/usr/sbin/service mysqld stop" + }, + "nova-compute" => { + "start" => "/usr/sbin/service openstack-nova-compute start", + "stop" => "/usr/sbin/service openstack-nova-compute stop" } } } @@ -151,6 +155,10 @@ when "ubuntu" "mysqld" => { "start" => "/usr/sbin/service mysql start", "stop" => "/usr/sbin/service mysql stop" + }, + "nova-compute" => { + "start" => "/usr/sbin/service nova-compute start", + "stop" => "/usr/sbin/service nova-compute stop" } } diff --git a/recipes/compute-monitoring.rb b/recipes/compute-monitoring.rb index 1c2b55f0..fb2527e0 100644 --- a/recipes/compute-monitoring.rb +++ b/recipes/compute-monitoring.rb @@ -39,3 +39,18 @@ collectd_plugin "libvirt" do ) end ######################################## + + +######################################## +# BEGIN MONIT SECTION +# TODO(shep): This needs to be encased in an if block for the monit_enabled environment toggle + +include_recipe "monit::server" +platform_options = node["nova"]["platform"] + +monit_procmon "nova-compute" do + process_name "nova-compute" + start_cmd platform_options["monit_commands"]["nova-compute"]["start"] + stop_cmd platform_options["monit_commands"]["nova-compute"]["stop"] +end +########################################