From 551262955361a05b9f28c4871a89efaf51488139 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 10:32:13 +0200 Subject: implemented cgi usage for munin graphing for centso --- manifests/host.pp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'manifests/host.pp') diff --git a/manifests/host.pp b/manifests/host.pp index 8f79020..aeb254d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -8,6 +8,16 @@ class munin::host File <<| tag == 'munin' |>> + file{'/etc/munin/munin.conf.header': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", + "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/files/munin/config/host/munin.conf.header", + "puppet://$server/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/munin/config/host/munin.conf.header" ], + notify => Exec['concat_/etc/munin/munin.conf'], + owner => root, group => 0, mode => 0644; + } + concatenated_file { "/etc/munin/munin.conf": dir => $NODESDIR, header => "/etc/munin/munin.conf.header", @@ -20,6 +30,27 @@ class munin::host } include munin::plugins::muninhost + + case $operatingsystem { + centos: { include munin::host::cgi } + } +} + +class munin::host::cgi { + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + + file{'/etc/logrotate.d/munin' + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate" + "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/files/munin/config/host/logrotate", + "puppet://$server/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } class munin::snmp_collector -- cgit v1.2.3