diff options
author | David Schmitt <david@dasz.at> | 2009-07-20 10:15:15 +0200 |
---|---|---|
committer | David Schmitt <david@dasz.at> | 2009-07-20 10:15:15 +0200 |
commit | 08156d7433c3052205a545951af7f0c5670a3a36 (patch) | |
tree | e8124773caade7e83f815f43b7261c013f3be349 /plugins/facter/munin_interfaces.rb | |
parent | 1868c2508f01c6b85f9086ddac00998521067fbc (diff) |
Move interfaces fact to munin_interfaces
This is to avoid clashes with newer facter versions which bring
their own interfaces fact.
Diffstat (limited to 'plugins/facter/munin_interfaces.rb')
-rwxr-xr-x | plugins/facter/munin_interfaces.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/facter/munin_interfaces.rb b/plugins/facter/munin_interfaces.rb new file mode 100755 index 0000000..5366573 --- /dev/null +++ b/plugins/facter/munin_interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("munin_interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end |