diff --git a/recipes/compute-monitoring.rb b/recipes/compute-monitoring.rb new file mode 100644 index 00000000..1c2b55f0 --- /dev/null +++ b/recipes/compute-monitoring.rb @@ -0,0 +1,41 @@ +# +# Cookbook Name:: nova +# Recipe:: compute-monitoring +# +# Copyright 2009, Rackspace Hosting, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +######################################## +# BEGIN COLLECTD SECTION +# TODO(shep): This needs to be encased in an if block for the collectd_enabled environment toggle + +include_recipe "collectd-graphite::collectd-client" + +ks_service_endpoint = get_access_endpoint("keystone", "keystone","service-api") +nova = get_settings_by_role("single-compute", "nova") +if nova["libvirt"]["virt_type"] == "qemu" + virt_conn = "qemu:///system" +else + virt_conn = "kvm:///" +end + +collectd_plugin "libvirt" do + options( + "Connection"=>virt_conn, + "HostnameFormat"=>"name", + "RefreshInterval"=>60 + ) +end +######################################## diff --git a/recipes/compute.rb b/recipes/compute.rb index b3d039e7..4a1d00f7 100644 --- a/recipes/compute.rb +++ b/recipes/compute.rb @@ -47,3 +47,7 @@ service "nova-compute" do end include_recipe "nova::libvirt" + +# TODO(shep): this needs to be if blocked on env collectd toggle +# Include recipe(nova::compute-monitoring) +include_recipe "nova::compute-monitoring"