summaryrefslogtreecommitdiff
path: root/plugins/facter/interfaces.rb
diff options
context:
space:
mode:
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-01-31 18:05:28 +0000
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-01-31 18:05:28 +0000
commitded0ef9de27bda5ea6c722991054b47ed3b8fc13 (patch)
tree55fc3b69bc9e9d0f5a57979c2ea2e9abe2663250 /plugins/facter/interfaces.rb
parentfe4187be6078076fa34c8d272561554b8f205e8b (diff)
reverted namechange
git-svn-id: https://svn/ipuppet/trunk/modules/munin@642 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'plugins/facter/interfaces.rb')
-rwxr-xr-xplugins/facter/interfaces.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb
new file mode 100755
index 0000000..a498d64
--- /dev/null
+++ b/plugins/facter/interfaces.rb
@@ -0,0 +1,13 @@
+# return the set of active interfaces as an array
+Facter.add("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