Advertisement
Guest User

New Relic Puppet manifest

a guest
Aug 19th, 2014
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. # Installs Newrelic Server monitoring
  2.  
  3. class newrelic {
  4.  
  5. $licensekey = 'xxxx'
  6.  
  7. # Derive display name
  8. if $::prettyname != undef {
  9. $displayname = $::prettyname
  10. }
  11. else {
  12. $displayname = $::hostname
  13. }
  14.  
  15. if $::osfamily == 'RedHat' and $::operatingsystemmajrelease >= 5 {
  16.  
  17. package { 'newrelic-repo':
  18. ensure => installed,
  19. provider => 'rpm',
  20. source => 'http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm',
  21. }
  22.  
  23. package { 'newrelic-sysmond':
  24. ensure => latest,
  25. notify => Service['newrelic-sysmond'],
  26. }
  27.  
  28. service { 'newrelic-sysmond':
  29. ensure => running,
  30. enable => true,
  31. require => Exec[$licensekey],
  32. }
  33.  
  34. file { '/etc/newrelic/nrsysmond.cfg':
  35. ensure => file,
  36. mode => '0640',
  37. owner => root,
  38. group => newrelic,
  39. #require => User['newrelic'],
  40. require => Package['newrelic-sysmond'],
  41. }
  42.  
  43. exec { $licensekey:
  44. path => '/bin:/usr/bin',
  45. command => "/usr/sbin/nrsysmond-config --set license_key=${licensekey}",
  46. user => 'root',
  47. group => 'root',
  48. unless => "grep ${licensekey} /etc/newrelic/nrsysmond.cfg",
  49. require => Package[newrelic-sysmond],
  50. notify => Service[newrelic-sysmond],
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement