instana / instana-agent-chef Goto Github PK
View Code? Open in Web Editor NEWInstana agent chef cookbook
Home Page: https://www.instana.com/
License: Apache License 2.0
Instana agent chef cookbook
Home Page: https://www.instana.com/
License: Apache License 2.0
Hi,
It'd be nice to have this cookbook published on Chef Supermarket.
Check out https://github.com/sethvargo/stove
Thanks!
Using the custom data library makes it more difficult for users to override attributes as it locks them in to using a specific data bag. This cookbook should move away from the library and instead just allow users to override the attributes as they wish, either with an attributes file or in a Policyfile or even in their Chef recipe if, for example, they're using Chef Vault for the secrets.
I'd be willing to take on this task as well as Windows support but I wanted to see the thoughts before submitting a Pull Request for that work.
Hi,
I've tried to use this cookbook to install the agent on a fairly wide range of OSs, all of which should be supported according to your docs with mixed success. All the instances are less than 2 months old on AWS from official images.
What worked:
Ubuntu 16.04
Ubuntu 14.04
Amazon linux
Centos 6
Debian 9
What didn't work:
Redhat 7: Initially errored, after updating the nss
package it was able to install and complete. This may not be related to the cookbook but it's certainly not handled nicely nor noted anywhere.
Redhat 6: Errors:
[2018-07-19T10:50:11-04:00] INFO: execute[yum clean metadata Instana-Agent] ran successfully
- execute yum clean metadata --disablerepo=* --enablerepo=Instana-Agent
[2018-07-19T10:50:11-04:00] INFO: template[/etc/yum.repos.d/Instana-Agent.repo] sending run action to execute[yum-makecache-Instana-Agent] (immediate)
* execute[yum-makecache-Instana-Agent] action run[2018-07-19T10:50:11-04:00] INFO: Processing execute[yum-makecache-Instana-Agent] action run (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60)
[execute] https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
================================================================================
Error executing action `run` on resource 'execute[yum-makecache-Instana-Agent]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
STDOUT:
STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1
Resource Declaration:
---------------------
# In /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb
60: declare_resource(:execute, "yum-makecache-#{new_resource.repositoryid}") do
61: command "yum -q -y makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
62: action :nothing
63: only_if { new_resource.enabled }
64: end
65:
Compiled Resource:
------------------
# Declared in /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb:60:in `block in <class:YumRepository>'
execute("yum-makecache-Instana-Agent") do
action [:nothing]
default_guard_interpreter :execute
command "yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent"
backup 5
declared_type :execute
cookbook_name "instana-agent"
user nil
domain nil
only_if { #code block }
end
System Info:
------------
chef_version=14.2.0
platform=redhat
platform_version=6.7
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
[2018-07-19T10:50:12-04:00] INFO: Running queued delayed notifications before re-raising exception
================================================================================
Error executing action `create` on resource 'yum_repository[Instana-Agent]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
execute[yum-makecache-Instana-Agent] (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
STDOUT:
STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/instana-agent/recipes/system.rb
37: yum_repository 'Instana-Agent' do
38: description 'The Agent repository by Instana, Inc.'
39: baseurl "#{domain}/agent/generic/x86_64"
40: gpgkey gpg_path
41: repo_gpgcheck true
42: gpgcheck false
43: action %i[create makecache]
44: only_if { %w[rhel suse amazon].include? node['platform_family'] }
45: end
46:
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/instana-agent/recipes/system.rb:37:in `from_file'
yum_repository("Instana-Agent") do
action [:create, :makecache]
updated true
updated_by_last_action true
default_guard_interpreter :default
declared_type :yum_repository
cookbook_name "instana-agent"
recipe_name "system"
baseurl "https://_:****************@packages.instana.io/agent/generic/x86_64"
gpgkey "https://packages.instana.io/Instana.gpg"
repo_gpgcheck true
gpgcheck false
repositoryid "Instana-Agent"
only_if { #code block }
end
System Info:
------------
chef_version=14.2.0
platform=redhat
platform_version=6.7
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client
[2018-07-19T10:50:12-04:00] INFO: Running queued delayed notifications before re-raising exception
Running handlers:
[2018-07-19T10:50:12-04:00] ERROR: Running exception handlers
- CRChefReporting
Running handlers complete
[2018-07-19T10:50:12-04:00] ERROR: Exception handlers complete
Chef Client failed. 6 resources updated in 57 seconds
[2018-07-19T10:50:12-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-07-19T10:50:12-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-07-19T10:50:12-04:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: yum_repository[Instana-Agent] (instana-agent::system line 37) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[yum-makecache-Instana-Agent] (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
STDOUT:
STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1
This is the same error that Redhat 7 originally had, however updating nss
did not solve it.
Centos 7: The agent installed but fails to start:
[root@ip-10-0-1-107 ~]# service instana-agent start
Starting Instana Agent
Not running.
Instana Agent hasn't started within the timeout allowed
please review file "/opt/instana/agent/data/log/instana-agent-console.log" to see the status of the service
[root@ip-10-0-1-107 ~]# cat /opt/instana/agent/data/log/instana-agent-console.log
null
Error occurred shutting down framework: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:214)
at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:228)
at org.apache.karaf.main.Main.main(Main.java:193)
I figured it would support windows as the docs point to the instana docs for supported OSs but realised that's not the case. Is this something that's expected?
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.