- From: Alan Harper <
>
- To:
- Subject: [chef] Re: bash -> chef
- Date: Fri, 10 Aug 2012 10:52:09 +1000
Have a look at the new relic cookbook at https://github.com/heavywater/chef-newrelicOn 10/08/2012, at 10:45 AM, Edward Morbius <
">
> wrote: I've been trying to wrap my head around chef and translating what would be a trivial bash script into the chef equivalent.
The goal is to include NewRelic's host server (not application) monitoring on an Ubuntu box.
The bash process:
# Grab New Relic's apt sources.list fragment and tuck it away in /etc/apt/sources.list.d wget -O /etc/apt/sources.list.d/newrelic.list http://download.newrelic.com/debian/newrelic.list # Get their signing key (value previously ascertained) apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 548C16BF # Run apt-get update and install package apt-get update apt-get install newrelic-sysmond # Set your license key (presumably stuffed in an encrypted data bag) nrsysmond-config --set license_key=<% key_ID %> # Launch the daemon /etc/init.d/newrelic-sysmond start
The easiest JGID method would be to write a ruby wrapper around the bash. For parts of this I find chef methods.
There's an "apt" cookbook which can do some things, including adding a sources.list line, but apparently not downloading a sources.list.d/ fragment from a known URL. Am I missing something?
The apt cookbook provides for getting the signing key:
apt_repository "newrelic-servermon" do keyserver "keyserver.pgp.edu" key "548C16BF" end
Running the config step looks like another shell wrapper.
The service resource should be able to start the daemon:
service "newrelic-servermon" do supports :status -> true, :restart => true, :reload => true action [:enable, :start] end
A nice "plus" feature would be an easy way to add, say, "monit" monitoring and possibly Nagios configuration for any given service, rather than managing these separately in a Nagios recipe.
TIA.
-- Dr. Ed Morbius Chief Scientist / Philologist / Robot Wrangler / Powerplant Operator Krell Power Systems Unlimited
|
- [chef] bash -> chef, Edward Morbius, 08/09/2012
- [chef] Re: bash -> chef, Alan Harper, 08/09/2012
Archive powered by MHonArc 2.6.16.