chr4-cookbooks / newrelic-ng Goto Github PK
View Code? Open in Web Editor NEWChef cookbook to install and configure different monitoring services for newrelic
Chef cookbook to install and configure different monitoring services for newrelic
I am seeing failures from nrsysmond-default
test suite which appear to be related to the TESTKEY_NRSYSMOND
key being invalid. For some reason I can consistently reproduce this on certain platforms (e.g. centos-59, ubuntu-1204), but I believe it is actually a timing issue and not particular to the platforms in question.
If you try to use the external startup mode for the php-agent by setting the attribute
default['newrelic-ng']['app_monitoring']['php-agent']['startup_mode'] = 'external'
The newrelic-daemon would fail to start with the message
"Starting New Relic Daemon: newrelic-daemoninvalid configuration: config: syntax error, expected keyword or comment, got '['"
I think this refactor commit (4a3ed31) by @jeffbyrnes has taken the assumption the .cfg and .ini config files should be the same.
While the 2 contain the same config, the different format is a killer for this.
As much as I wish the 2 configs where the same, it seems they are not, and the daemon isn't able to parse the ini file if it's put as the .cfg file as shown by the daemon error.
Can also see it in the template files:
https://github.com/chr4-cookbooks/newrelic-ng/blob/master/templates/default/newrelic.cfg.erb
https://github.com/chr4-cookbooks/newrelic-ng/blob/master/templates/default/newrelic.ini.php.erb
I think the place of the issue and the fix reside around these 2 lines:
https://github.com/chr4-cookbooks/newrelic-ng/blob/master/providers/php_agent.rb#L60
https://github.com/chr4-cookbooks/newrelic-ng/blob/master/providers/php_agent.rb#L86
Either one of them should change to another variable name that contains the other template or some more fancy condition/and or dynamic format/header..
* package[ruby-mode] action install[2013-09-08T15:39:17+00:00] INFO: Processing package[ruby-mode] action install (ruby::1.9.1 line 73)
* No version specified, and no candidate version available for ruby-mode
================================================================================
Error executing action `install` on resource 'package[ruby-mode]'
================================================================================
Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for ruby-mode
Resource Declaration:
---------------------
# In /tmp/kitchen-chef-solo/cookbooks/ruby/definitions/ruby_packages.rb
73: package pkg do
74: action params[:action]
75: end
76: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen-chef-solo/cookbooks/ruby/definitions/ruby_packages.rb:73:in `block (2 levels) in from_file'
package("ruby-mode") do
params {:action=>:install, :name=>"1.9.1"}
action [:install]
retries 0
retry_delay 2
package_name "ruby-mode"
cookbook_name :ruby
recipe_name "1.9.1"
end
newrelic-sysmond service cannot start, because no valid license_key is found.
The recipe works though, but I couldn't find a valid newrelic testkey to make the test work.
Convenction is afaik that cookbooks should prefer _
over -
. This might be changed in a future version.
When running the tests for the php-agent
, kitchen tests the cookbooks specified as dependencies in Berksfile
also.
This shouldn't be our job, as it's already done by the cookbook maintainers.
Is there a simple way to skip running the tests on the dependency cookbooks?
One approach would be using a wrapper cookbook similar to https://github.com/chr4-cookbooks/iptables-ng/tree/master/test/cookbooks/iptables_ng_test
See #21 for more information.
newrelic-plugin-agent 1.3.0 use different executable name
/usr/local/bin/newrelic-plugin-agent
instead of
/usr/local/bin/newrelic_plugin_agent
causing the startup script to fail.
Thanks for putting together the newrelic-ng cookbook.
I'm having some trouble with the generic agent. As I understand the output below, the newrelic_nginx_agent.daemon
is being started as newrelic
user, but the ruby installation is not available. I have ruby installed with rbenv, which I believe does not make it available globally.
Would you say this is a bug in the script or my setup? Any tips on how to get it sorted?
Thanks!
* service[newrelic_plugin_nginx_status_agent] action start
================================================================================
Error executing action `start` on resource 'service[newrelic_plugin_nginx_status_agent]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon start' ----
STDOUT:
STDERR: /usr/bin/env: ruby: No such file or directory
---- End output of su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon start' ----
Ran su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon start' returned 127
Resource Declaration:
---------------------
# In /root/chef-solo/cookbooks-1/newrelic-ng/providers/generic_agent.rb
88: service "newrelic_plugin_#{new_resource.plugin_name}" do
89: provider Chef::Provider::Service::Simple
90: supports status: true
91: start_command "su #{new_resource.owner} -c '#{daemon} start'"
92: stop_command "su #{new_resource.owner} -c '#{daemon} stop'"
93: restart_command "su #{new_resource.owner} -c '#{daemon} restart'"
94:
95: # status always returns 0, so we're grepping for pid as a workaround
96: status_command "su #{new_resource.owner} -c '#{daemon} status |grep -q pid'"
97:
98: subscribes :restart, "template[#{config_file}]"
99: action :start
100: end
101: end
Compiled Resource:
------------------
# Declared in /root/chef-solo/cookbooks-1/newrelic-ng/providers/generic_agent.rb:88:in `configure_agent'
service("newrelic_plugin_nginx_status_agent") do
provider Chef::Provider::Service::Simple
action [:start]
supports {:status=>true}
retries 0
retry_delay 2
service_name "newrelic_plugin_nginx_status_agent"
pattern "newrelic_plugin_nginx_status_agent"
start_command "su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon start'"
stop_command "su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon stop'"
status_command "su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon status |grep -q pid'"
restart_command "su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon restart'"
startup_type :automatic
cookbook_name :"newrelic-ng"
end
could not find recipe server-monitoring-default for cookbook newrelic-ng
I realize these are necessary for their respective monitors, but they should be recommends
rather than depends
as their dependencies shouldn't be installed if we're just using the ruby agent.
Support application level labels.
"newrelic.labels" @
https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration
(probably relevant for other languages as well)
[root@generic-agent-default-centos-59 vagrant]# su newrelic -c '/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon start'
/opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon:5:in `require': no such file to load -- rubygems (LoadError)
from /opt/newrelic-agents/nginx_status_agent/newrelic_nginx_agent.daemon:5
Init script starts the process over and over again, as the PID stored in the pidfile is not correct. This seems to be an issue of the plugin agent code, but we should find a workaround.
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.