]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
add some munin magic
authorStephen Gran <steve@lobefin.net>
Sun, 20 May 2012 07:54:15 +0000 (08:54 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 20 May 2012 07:54:15 +0000 (08:54 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/munin/manifests/conf.pp [new file with mode: 0644]
modules/vsftpd/manifests/init.pp
modules/vsftpd/manifests/site.pp
modules/vsftpd/templates/munin.erb [new file with mode: 0644]

diff --git a/modules/munin/manifests/conf.pp b/modules/munin/manifests/conf.pp
new file mode 100644 (file)
index 0000000..a4ac0ab
--- /dev/null
@@ -0,0 +1,24 @@
+define munin::conf (
+       $ensure=present,
+       $content='',
+       $source=''
+) {
+
+       include munin
+
+       case $ensure {
+               present: {
+                       if ! ($source or $content) {
+                               fail ( "No configuration found for ${name}" )
+                       }
+               }
+               absent:  {}
+               default: { fail ( "Unknown ensure value: '$ensure'" ) }
+       }
+
+       file { "/etc/munin/plugin-conf.d/${name}":
+               ensure  => $ensure,
+               require => Package['munin-node'],
+               notify  => Service['munin-node'],
+       }
+}
index 11755b49d9c1fb6134877b35a63f4470d29ececd..d664b7e0d4a5eca005d0fd747729b81e8cecd5fb 100644 (file)
@@ -18,7 +18,9 @@ class vsftpd {
                notify  => Service['vsftpd']
        }
 
-       munin::check { 'vsftpd': }
+       munin::check { "vsftpd-${name}":
+               ensure => absent
+       }
        munin::check { 'ps_vsftpd':
                script => 'ps_'
        }
index 46c805edb7121b35bd2a23f2286dc1bea821da6c..f8a71a0fb52d9aa297949593bf0df5af0efb635a 100644 (file)
@@ -29,6 +29,13 @@ define vsftpd::site (
                ensure => absent
        }
 
+       munin::check { "vsftpd-${name}":
+               script => 'vsftpd'
+       }
+       munin::conf { "vsftpd-${name}":
+               content => template('vsftpd/munin.erb')
+       }
+
        # We don't need a firewall rule because it's added in vsftp.pp
        xinetd::service { "vsftpd-${name}":
                bind        => $bind,
diff --git a/modules/vsftpd/templates/munin.erb b/modules/vsftpd/templates/munin.erb
new file mode 100644 (file)
index 0000000..dd980e6
--- /dev/null
@@ -0,0 +1,3 @@
+[vsftpd-<%= scope.lookupvar('ftpsite') %>]
+user root
+env.logfile /var/log/ftp/<%= scope.lookupvar('ftpsite') %>.log