Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ The `newrelic_server_monitor` resource will handle the requirements to configure

#### Actions

- :install - will setup the New Relic repository, install and install package.
- :remove - Uninstall the New Relic package
- :install - Setup the New Relic repository, and install package.
- :configure - Configure the installed package.
- :remove - Uninstall the New Relic package.

#### Attribute parameters

Expand Down
17 changes: 14 additions & 3 deletions providers/server_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use_inline_resources if defined?(use_inline_resources)

action :install do
check_license
newrelic_repository
case node['platform_family']
when 'debian', 'rhel', 'fedora'
Expand All @@ -22,6 +21,17 @@
end
end

action :configure do
check_license
case node['platform_family']
when 'debian', 'rhel', 'fedora'
configure_newrelic_service_linux
when 'windows'
# on Windows service creation/startup is done by the installer
end

end

action :remove do
case node['platform_family']
when 'debian', 'rhel', 'fedora'
Expand All @@ -35,7 +45,9 @@ def install_newrelic_service_linux
package new_resource.service_name do
action new_resource.action
end
# configure your New Relic license key
end

def configure_newrelic_service_linux
template "#{new_resource.config_path}/nrsysmond.cfg" do
cookbook new_resource.cookbook
source new_resource.source
Expand Down Expand Up @@ -74,7 +86,6 @@ def install_newrelic_service_windows
checksum new_resource.windows32_checksum
end
end
# on Windows service creation/startup is done by the installer
end

def remove_newrelic_service_linux
Expand Down
4 changes: 2 additions & 2 deletions resources/server_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Copyright 2012-2015, Escape Studios
#

actions :install, :remove
default_action :install
actions :install, :configure, :remove
default_action [:install, :configure]

attribute :license, :kind_of => String, :default => NewRelic.server_monitoring_license(node)

Expand Down