Issue #3937 has been updated by James Turnbull.

Assignee set to Michael Kincaid


----------------------------------------
Feature #3937: There should be a 'mounts' fact
https://projects.puppetlabs.com/issues/3937

Author: Mario Verbelen
Status: Code Insufficient
Priority: Normal
Assignee: Michael Kincaid
Category: library
Target version: 2.0.0
Keywords: 
Branch: 


I use myself a mount list for monitoring purposes

So here the code I use

mounts.rb
<pre>Facter.add("mounts") do
        mounts = []
        mntpoints=`mount -t ext2,ext3,ext4,reiserfs`
        mntpoints.split(/\n/).each do |m|
                mount = m.split(/ /)[2]
                mounts << mount
        end
        setcode do
                mounts.join(',')
        end
end</pre>

output: 
<pre>10:48:15|root@leo:~ 0 # facter mounts
/,/boot,/home,/usr,/var,/tmp,/data</pre>

In the template for snmpd.conf.erb I use
<pre><%- if has_variable?("mounts") then
        mounts.split(',').each do |val| -%>
disk <%= val %>
<% end end -%></pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to