Updated munin::server for Munin 2.0
This commit is contained in:
parent
32d897c223
commit
a2ca8e60ac
5 changed files with 66 additions and 23 deletions
7
munin/files/cgi-htaccess
Normal file
7
munin/files/cgi-htaccess
Normal file
|
@ -0,0 +1,7 @@
|
|||
Options +ExecCGI
|
||||
<IfModule mod_fcgid.c>
|
||||
SetHandler fcgid-script
|
||||
</IfModule>
|
||||
<IfModule !mod_fcgid.c>
|
||||
SetHandler cgi-script
|
||||
</IfModule>
|
4
munin/files/munin-htaccess
Normal file
4
munin/files/munin-htaccess
Normal file
|
@ -0,0 +1,4 @@
|
|||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} !^/munin/cgi
|
||||
RewriteCond %{REQUEST_URI} !^/munin/static
|
||||
RewriteRule ^(.*)$ cgi/munin-cgi-html/$1 [QSA,PT,L]
|
3
munin/files/munin-httpd.conf
Normal file
3
munin/files/munin-httpd.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
<Directory "/srv/www/https/*/munin">
|
||||
AllowOverride All
|
||||
</Directory>
|
|
@ -55,11 +55,10 @@ class munin::node {
|
|||
}
|
||||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${homename}.conf":
|
||||
@@file { "/etc/munin/conf.d/${homename}.conf":
|
||||
ensure => present,
|
||||
content => "[${homename}]\n address ${ipaddress}\n use_node_name yes\n",
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
exec { "munin-node-configure":
|
||||
|
@ -104,11 +103,10 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
|||
notify => Service["munin-node"],
|
||||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${name}.conf":
|
||||
@@file { "/etc/munin/conf.d/${name}.conf":
|
||||
ensure => present,
|
||||
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -238,9 +236,9 @@ class munin::server {
|
|||
|
||||
file { "/var/cache/munin":
|
||||
ensure => directory,
|
||||
mode => "0755",
|
||||
mode => "0775",
|
||||
owner => "munin",
|
||||
group => "munin",
|
||||
group => $apache::sslserver::group,
|
||||
seltype => "httpd_munin_content_t",
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
@ -253,13 +251,40 @@ class munin::server {
|
|||
atboot => true,
|
||||
device => "none",
|
||||
fstype => "tmpfs",
|
||||
options => "uid=munin,gid=munin,mode=0755",
|
||||
options => "uid=munin,gid=${$apache::sslserver::group},mode=0775",
|
||||
dump => "0",
|
||||
pass => "0",
|
||||
require => File["/var/cache/munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/nodes.d":
|
||||
file { [ "/var/log/munin/munin-cgi-graph.log",
|
||||
"/var/log/munin/munin-cgi-html.log", ]:
|
||||
ensure => present,
|
||||
mode => "0664",
|
||||
owner => "munin",
|
||||
group => $apache::sslserver::group,
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/var/www/html/munin/.htaccess":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
source => [ "puppet:///files/munin/htaccess",
|
||||
"puppet:///modules/munin/munin-htaccess", ],
|
||||
require => Package["munin"],
|
||||
}
|
||||
file { "/var/www/html/munin/cgi/.htaccess":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
source => "puppet:///modules/munin/cgi-htaccess",
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/conf.d":
|
||||
ensure => directory,
|
||||
purge => true,
|
||||
force => true,
|
||||
|
@ -271,22 +296,13 @@ class munin::server {
|
|||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/munin.conf.in":
|
||||
file { "/etc/munin/munin.conf":
|
||||
ensure => present,
|
||||
content => template("munin/munin.conf.in.erb"),
|
||||
content => template("munin/munin.conf.erb"),
|
||||
owner => "root",
|
||||
group => "root",
|
||||
mode => "0644",
|
||||
require => Package["munin"],
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
exec { "generate-munin-conf":
|
||||
command => "cat /etc/munin/munin.conf.in /etc/munin/nodes.d/*.conf > /etc/munin/munin.conf",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
refreshonly => true,
|
||||
require => File["/etc/munin/munin.conf.in"],
|
||||
}
|
||||
|
||||
File <<| tag == "munin" |>>
|
||||
|
@ -294,12 +310,17 @@ class munin::server {
|
|||
define configwebhost() {
|
||||
file { "/srv/www/https/${name}/munin":
|
||||
ensure => link,
|
||||
target => "/var/cache/munin",
|
||||
target => "/var/www/html/munin",
|
||||
require => File["/srv/www/https/${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
if $munin_webhosts {
|
||||
apache::configfile { "munin.conf":
|
||||
http => false,
|
||||
source => "puppet:///modules/munin/munin-httpd.conf",
|
||||
}
|
||||
|
||||
configwebhost { $munin_webhosts: }
|
||||
}
|
||||
|
||||
|
|
|
@ -2,13 +2,21 @@
|
|||
# databases, the HTML output, and the logs, severally. They all
|
||||
# must be writable by the user running munin-cron.
|
||||
dbdir /var/lib/munin
|
||||
htmldir /var/cache/munin
|
||||
htmldir /var/www/html/munin
|
||||
logdir /var/log/munin
|
||||
rundir /var/run/munin
|
||||
cgitmpdir /var/cache/munin
|
||||
|
||||
# Where to look for the HTML templates
|
||||
tmpldir /etc/munin/templates
|
||||
|
||||
# Number of graph processes
|
||||
max_graph_jobs <%= processorcount %>
|
||||
# Create html and graphs on-demand
|
||||
html_strategy cgi
|
||||
graph_strategy cgi
|
||||
cgiurl_graph /munin/cgi/munin-cgi-graph
|
||||
|
||||
# Number of graph processes
|
||||
munin_cgi_graph_jobs <%= processorcount %>
|
||||
|
||||
# Include nodes
|
||||
includedir /etc/munin/conf.d
|
Loading…
Add table
Reference in a new issue