module Keystone module Os class Unix < AbstractOs def ip_address ifconfig = `/sbin/ifconfig` ips = [] # TODO mac ifconfig.gsub(/inet addr:(\d+\.\d+\.\d+\.\d+)/){|ip| if $1 != '127.0.0.1' ips << $1 end } return ips end def hostname `/bin/hostname`.chomp end def disk `/bin/df -h`.chomp end def process_list `/bin/ps -ef`.chomp end def netstat `/usr/sbin/netstat -an`.chomp end end end end