Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Installs Newrelic Server monitoring
- class newrelic {
- $licensekey = 'xxxx'
- # Derive display name
- if $::prettyname != undef {
- $displayname = $::prettyname
- }
- else {
- $displayname = $::hostname
- }
- if $::osfamily == 'RedHat' and $::operatingsystemmajrelease >= 5 {
- package { 'newrelic-repo':
- ensure => installed,
- provider => 'rpm',
- source => 'http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm',
- }
- package { 'newrelic-sysmond':
- ensure => latest,
- notify => Service['newrelic-sysmond'],
- }
- service { 'newrelic-sysmond':
- ensure => running,
- enable => true,
- require => Exec[$licensekey],
- }
- file { '/etc/newrelic/nrsysmond.cfg':
- ensure => file,
- mode => '0640',
- owner => root,
- group => newrelic,
- #require => User['newrelic'],
- require => Package['newrelic-sysmond'],
- }
- exec { $licensekey:
- path => '/bin:/usr/bin',
- command => "/usr/sbin/nrsysmond-config --set license_key=${licensekey}",
- user => 'root',
- group => 'root',
- unless => "grep ${licensekey} /etc/newrelic/nrsysmond.cfg",
- require => Package[newrelic-sysmond],
- notify => Service[newrelic-sysmond],
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement