From 08156d7433c3052205a545951af7f0c5670a3a36 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 20 Jul 2009 10:15:15 +0200 Subject: Move interfaces fact to munin_interfaces This is to avoid clashes with newer facter versions which bring their own interfaces fact. --- plugins/facter/munin_interfaces.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 plugins/facter/munin_interfaces.rb (limited to 'plugins/facter/munin_interfaces.rb') 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 -- cgit v1.2.3