Sha256: ef7ea4d0d9d2f7eb5f0259d589e281af9de0c4012f87a5da699f8f24bc7aeb79

Contents?: true

Size: 576 Bytes

Versions: 8

Compression:

Stored size: 576 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
kanamei-kanamei-keystone-0.0.12 lib/keystone/os/unix.rb
kanamei-kanamei-keystone-0.0.13 lib/keystone/os/unix.rb
kanamei-keystone-0.0.11 lib/keystone/os/unix.rb
kanamei-keystone-0.0.12 lib/keystone/os/unix.rb
kanamei-keystone-0.0.14 lib/keystone/os/unix.rb
kanamei-keystone-0.0.15 lib/keystone/os/unix.rb
kanamei-keystone-0.0.16 lib/keystone/os/unix.rb
kanamei-keystone-0.0.17 lib/keystone/os/unix.rb