class KPM::SystemProxy::EntropyAvailable
def build_hash(data)
def build_hash(data) entropy_available = {} entropy_available['entropy_available'] = { entropy: 'available', value: data } entropy_available end
def fetch
def fetch entropy_available = nil if OS.windows? entropy_available = fetch_windows elsif OS.linux? entropy_available = fetch_linux elsif OS.mac? entropy_available = fetch_mac end entropy_available end
def fetch_linux
def fetch_linux entropy_available_data = `cat /proc/sys/kernel/random/entropy_avail 2>&1`.gsub("\n", '') build_hash(entropy_available_data) end
def fetch_mac
def fetch_mac build_hash('-') end
def fetch_windows
def fetch_windows build_hash('-') end
def initialize
def initialize @entropy_available = fetch @labels = [{ label: :entropy }, { label: :value }] end