Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

newrelic_redis_plugin (1) Versions 1.0.0

Installs/Configures a Redis monitoring plugin for Newrelic

Policyfile
Berkshelf
Knife
cookbook 'newrelic_redis_plugin', '~> 1.0.0', :supermarket
cookbook 'newrelic_redis_plugin', '~> 1.0.0'
knife supermarket install newrelic_redis_plugin
knife supermarket download newrelic_redis_plugin
README
Dependencies
Quality 17%

Chef-newrelic_redis_plugin

Coverage Status Build Status Cookbook Version

Cookbook to install monitoring for Redis servers on Newrelic.

Credit

These scripts use the newrelic_redis_plugin designed by Ken Jibiki (@kenjij on GitHub)

Plugin Documentation on NewRelic: https://rpm.newrelic.com/accounts/883690/plugins/directory/249

Original scripts on Github: https://github.com/kenjij/newrelic_redis_plugin

Several additional features have been added to the original scripts to make them more useful in unattended install and monitoring situations:

  • Multiple monitoring services can be generated to monitor multiple Redis instances.
  • Generic init.d scripts are implemented to facilitate running the scripts as services.

Recipes

  • newrelic_redis_plugin::install - This will install the plugin as (a) service(s)
  • newrelic_redis_plugin::enable - This will start the service(s)

Attributes

Required Attributes

  • ['newrelic_redis_plugin']['newrelic_license_key']
    • WARNING: You must set this value. You can retrieve your license key from NewRelic at the bottom of this page.
    • Default: nil
  • default['newrelic_redis_plugin']['instances']
    • An array of parameters for Redis instances to monitor.
    • Default: [{name: nil, url: 'redis://localhost:6379', database: nil}]
    • While there is a default value for this attribute, it is likely not what you want for your implementation. Check out the Examples below.

Optional Attributes

  • ['newrelic_redis_plugin']['ruby_interpreter']
    • The ruby interpreter that should be used to execute the scripts.
    • Default: '/usr/bin/env ruby'
    • Note: If no ruby is installed on your server and you have no other reason to install one you can use the one that is bundled into Chef by setting this to '/opt/chef/embedded/bin/ruby'
  • ['newrelic_redis_plugin']['newrelic_user']
    • User that will own installed files and will run the services. THIS USER MUST EXIST before running the install recipe. This is usually handled by installing Newrelic Server Monitoring before executing these recipes.
    • Default: 'newrelic'
  • ['newrelic_redis_plugin']['newrelic_group']
  • Group that will have access to any installed files. THIS GROUP MUST EXIST before running the install recipe. This is usually handled by installing Newrelic Server Monitoring before executing these recipes.
    • Default: 'newrelic'
  • ['newrelic_redis_plugin']['install_path']
    • Specifies where to create the executable scripts
    • Default '/opt/newrelic_redis_plugin'
  • ['newrelic_redis_plugin']['pid_file_path']
    • Specifies where the service(s) should store PID files
    • Default: '/var/run/newrelic_redis_plugin'
  • ['newrelic_redis_plugin']['log_file_path']
    • Specifies where the service(s) should store log files
    • Default: '/var/log/newrelic_redis_plugin'
  • ['newrelic_redis_plugin']['agent_guid']
    • The agent_guid that identifies which plugin is being utilized on the NewRelic platform. This should only need to be changed if the GUID changes which is outside of the control of this chef recipe.
    • Default: 'net.kenjij.newrelic_redis_plugin'
  • ['newrelic_redis_plugin']['agent_version']
    • The version of the agent that this script is configured to work with. You will likely not change this value.
    • Default: '1.0.1'

Examples

Single Instance:

node['newrelic_redis_plugin']['newrelic_license_key'] = 'YOUR_LICENSE_KEY_HERE'
node['newrelic_redis_plugin']['instances'] = [
  {
    name:     'ExampleInstance',
    url:    'redis://localhost:6379',
    database:   'db0'
  }
]

In this example a single monitoring instance will be created to monitor a Redis instance on the local machine at port 6379.

  • The service will be called ExampleInstance and will be located at /opt/newrelic_redis_plugin/ExampleInstance
  • The PID file will be written to /var/run/newrelic_redis_plugin/ExampleInstance.pid
  • Logs will be written to /var/logs/newrelic_redis_plugin/ExampleInstance.log
  • Database key metrics will be reported to the "Keyspace" tab for the default database db0.
  • A newrelic_ExampleInstance script will be written to /etc/init.d/newrelic_ExampleInstance (NOTE: This script will be written but NOT started or set to start at boot until the newrelic_redis_plugin::enable recipe is run.)
  • Running service newrelic_ExampleInstance start, service newrelic_ExampleInstance stop, service newrelic_ExampleInstance restart, and service newrelic_ExampleInstance status should perform all the necessary functions for managing the service.

Multiple Instances:

node['newrelic_redis_plugin']['newrelic_license_key'] = 'YOUR_LICENSE_KEY_HERE'
node['newrelic_redis_plugin']['instances'] = [
  {
    name:     'ExampleInstance_1',
    url:    'redis://localhost:6379',
    database:   'db0'
  },
  {
    name:     'ExampleInstance_2',
    url:    'redis://localhost:6380',
    database:   'db0'
  }
]

In this example a two monitoring instances will be created to monitor a Redis instances on the local machine at ports 6379 and 6380.

  • The services will be called ExampleInstance_1 and ExampleInstance_2 and will be located in the /opt/newrelic_redis_plugin directory
  • The PID files will be written to /var/run/newrelic_redis_plugin
  • Logs will be written to /var/logs/newrelic_redis_plugin
  • Database key metrics will be reported to the "Keyspace" tab for the default database db0.
  • A script will be written to both /etc/init.d/newrelic_ExampleInstance_1 and /etc/init.d/newrelic_ExampleInstance_2
  • Running service newrelic_ExampleInstance_1 start, service newrelic_ExampleInstance_1 stop, service newrelic_ExampleInstance_1 restart, and service newrelic_ExampleInstance_1 status should perform all the necessary functions for managing the 'ExampleInstance_1' monitoring instance, the same would be true for 'ExampleInstance_2'.

Design Notes

You should name your monitoring instances something unique and identifiable as this is the name that will be reported on the redis tab of the plugins page on NewRelic. Suggestions could be something like 'ActiveJob_Redis_Production' which would describe the role and environment of the instance.

DO NOT USE SPACES IN YOUR INSTANCE NAMES

There is no provision for monitoring multiple databases per instance. You will usually want to just set the database setting to 'db0'. Best practices indicate that running multiple databases per instance is not as performant and increases complexity. The creator of Redis has stated that they are an undesirable way to divide data, and that separate instances should be used instead.

Supports

  • Ubuntu
  • CentOS
  • Debian
  • Amazon

Contributing

Please see CONTRIBUTING for details.

Authors:: Nate Flood for ECHO Inc. < nflood@echonet.org >

License: MIT

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

1.0.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

1.0.0 failed this metric

FC066: Ensure chef_version is set in metadata: newrelic_redis_plugin/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

1.0.0 passed this metric

Testing File Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

1.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number