rackspace-cookbooks / cookbook-cloudmonitoring Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED, use https://github.com/rackspace-cookbooks/rackspace_monitoring instead
DEPRECATED, use https://github.com/rackspace-cookbooks/rackspace_monitoring instead
Currently only supported action on bundled providers is create
.
I'm getting the following warnings while running this cookbook on Chef 11.16.4. This happens when you declare a resource with the same name multiple times.
14T00:00:09-05:00] WARN: Cloning resource attributes for template[/etc/rackspace-monitoring-agent.cfg] from prior resource (CHEF-3694)
[2014-10-14T00:00:09-05:00] WARN: Previous template[/etc/rackspace-monitoring-agent.cfg]: /var/chef/cache/cookbooks/cloud_monitoring/recipes/agent.rb:99:in from_file' [2014-10-14T00:00:09-05:00] WARN: Current template[/etc/rackspace-monitoring-agent.cfg]: /var/chef/cache/cookbooks/cloud_monitoring/recipes/agent.rb:132:in
from_file'
Hi
I cannot get this to do anything at all. I've got:
cloud_monitoring_entity "#{hostname}" do
ip_addresses 'default' => node[:ipaddress]
action :create
end
in my cookbook, but it stalls at
* cloud_monitoring_entity[my_host] action create
and in the logs, I see
DEBUG: Opscode::Rackspace::Monitoring.cm: creating new Fog connection
and then it sits there forever. I tracked it down to this
@@cm ||= Fog::Rackspace::Monitoring.new(
:rackspace_api_key => apikey,
:rackspace_username => username,
:rackspace_auth_url => auth_url
)
so I tried this
irb
2.0.0p0 :001 > require 'fog'
=> true
2.0.0p0 :002 > cm = Fog::Rackspace::Monitoring.new(
2.0.0p0 :003 > :rackspace_api_key => "herpaderpthisisnottherealkey",
2.0.0p0 :004 > :rackspace_username => "myusername",
2.0.0p0 :005 > :rackspace_auth_url => "https://lon.identity.api.rackspacecloud.com/v2.0",
2.0.0p0 :006 > :rackspace_region => "uk"
2.0.0p0 :007?> )
but that eventually craps out with SystemStackError: stack level too deep
.
I threw the auth_url in there because I thought maybe it was defaulting to DFW, but it doesn't work with or without it.
So, does this work at all for anybody else? Does it just not work for LON? Am I being dumb?
Please help, this is blocking me...
I am running the cloud_monitoring cookbook, and trying to enable monitoring on an entity that I host. here is the basic output code.
include_recipe "cloud_monitoring"
cloud_monitoring_entity "#{node.hostname}" do
ip_addresses 'default' => node[:ipaddress]
metadata 'environment' => 'dev', :more => 'meta data'
rackspace_username 'user_blah_blah'
rackspace_api_key 'thisisn'treal'
action :create
end
I am getting the following output, and I don't have enough knowledge of fog gem to debug the issue. Is this a bug or do you have a suggestion on where to fix it?
Recipe: cook_rack_monitoring::default
* cloud_monitoring_entity[rack-monitor-test1] action create
================================================================================
Error executing action `create` on resource 'cloud_monitoring_entity[rack-monitor-test1]'
================================================================================
Fog::Rackspace::Monitoring::BadRequest
--------------------------------------
[HTTP 400 | .rh-yWd6.h-dfw1-maas-prod-api1.r-9Dm9C2n3.c-82026845.ts-1425396706506.v-e476db8] Validation error for key 'ip_addresses' - Operation is not permitted
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/cloud_monitoring/providers/entity.rb:32:in `block in class_from_file'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/cook_rack_monitoring/recipes/default.rb
12: cloud_monitoring_entity "#{node.hostname}" do
13: ip_addresses 'default' => node[:ipaddress]
14: metadata 'environment' => 'dev', :more => 'meta data'
15: rackspace_username 'user_blah_blah'
16: rackspace_api_key 'thisisn'treal'
17: action :create
18: end
19: # case node['platform_version']
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/cook_rack_monitoring/recipes/default.rb:12:in `from_file'
cloud_monitoring_entity("rack-monitor-test1") do
action [:create]
retries 0
retry_delay 2
guard_interpreter :default
cookbook_name "cook_rack_monitoring"
recipe_name "default"
ip_addresses {"default"=>"23.253.172.82"}
metadata {"environment"=>"dev", :more=>"meta data"}
rackspace_username "user_blah_blah"
rackspace_api_key "thisisntreal"
label "rack-monitor-test1"
end
I have also tried passing the username and API as an attribute rather than string, but i can't seem to figure this one out. Is there something I am missing in the documentation?
Chef issues a warning about setting attributes when I run this cookbook, see below.
[Thu, 15 Nov 2012 20:07:33 +0000] DEBUG: Loading Recipe cloudmonitoring::agent via include_recipe
[Thu, 15 Nov 2012 20:07:33 +0000] DEBUG: Found recipe agent in cookbook cloudmonitoring
[Thu, 15 Nov 2012 20:07:33 +0000] WARN: Setting attributes without specifying a precedence is deprecated and will be
removed in Chef 11.0. To set attributes at normal precedence, change code like:
node["key"] = "value"
# Not this
to:
node.set["key"] = "value"
# This
Called from:
/tmp/chef-solo/cookbooks/cloudmonitoring/recipes/agent.rb:28:in from_file' /usr/lib/ruby/vendor_ruby/chef/cookbook_version.rb:558:in
load_recipe'
/usr/lib/ruby/vendor_ruby/chef/mixin/language_include_recipe.rb:46:in `load_recipe'
cookbook-cloudmonitoring/recipes/agent.rb uses deprecated yum_key resource on line 33:
$ grep yum_key recipes/agent.rb -n
33: yum_key "Rackspace-Monitoring" do
Per http://docs.opscode.com/lwrp_yum.html this is deprecated:
The The yum cookbook is used to manage the contents of the yum.conf
configuration file for global yum configurations and for individual yum repositories.
cookbook, version 3.0.0 (and above) contains breaking changes that are not
compatible with previous versions. The yum_repository resource is changed, the
yum_globalconfig resource is new, and the yum_key resource is deprecated.
Recipes have been moved into repository-specific cookbooks. If your organization is
using an older version of the The yum cookbook is used to manage the contents of
the yum.conf configuration file for global yum configurations and for individual yum
repositories. cookbook, lock yum to that cookbook version until all of the cookbooks
that may have a dependency on yum are updated to work with the newest version of
this cookbook."
This is causing the cookbook to fail on latest Chef:
[2014-01-03T17:19:23+00:00] ERROR: Cannot find a resource for yum_key on centos version 6.4
Currently you can't create multiple entities and checks in a single recipe because some functions have weird side effects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.